def get_rooms(args):
        """
        1. Create an API client with headers
        2. Get rooms
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Get rooms
        rooms_api = RoomsApi(api_client)
        rooms = rooms_api.get_rooms(account_id=args["account_id"])
        return rooms.rooms
    def worker(args):
        """
        1. Create an API client with headers
        2. Add the form to the room
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Add the form to the room
        rooms_api = RoomsApi(api_client)
        response = rooms_api.add_form_to_room(
            room_id=args['room_id'],
            body=FormForAdd(form_id=args['form_id']),
            account_id=args["account_id"])
        return response
    def testGetRooms(self):
        # Testing for the UserInfo which is true if auth is successful
        print(self.user_info)
        self.assertIsNotNone(self.user_info)
        self.assertTrue(len(self.user_info.accounts) > 0)
        self.assertIsNotNone(self.user_info.accounts[0].account_id)

        # Get the active room
        accountId = self.user_info.accounts[0].account_id
        rooms = RoomsApi()
        activeRoom = rooms.get_rooms(accountId)

        self.assertIsNotNone(activeRoom)
        self.assertTrue(len(activeRoom.rooms) > 0)
        self.assertIsNotNone(activeRoom.rooms[0].room_id)
    def worker(args):
        """
        1. Create an API client with headers
        2. Get room field data using SDK
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Get room field data using SDK
        rooms_api = RoomsApi(api_client)
        response = rooms_api.get_room_field_data(
            room_id=args['room_id'],
            account_id=args["account_id"]
        )
        return response
Example #5
0
    def worker(args):
        """
        1. Create an API client with headers
        2. Get Default Admin role id
        3. Create RoomForCreate object
        4. Post the room using SDK
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Get Default Admin role id
        roles_api = RolesApi(api_client)
        roles = roles_api.get_roles(account_id=args["account_id"])
        role_id = [
            role.role_id for role in roles.roles if role.is_default_for_admin
        ][0]

        # Step 3. Create RoomForCreate object
        room = RoomForCreate(
            name=args["room_name"],
            role_id=role_id,
            transaction_side_id="listbuy",
            field_data=FieldDataForCreate(
                data={
                    'address1':
                    '123 EZ Street',
                    'address2':
                    'unit 10',
                    'city':
                    'Galaxian',
                    'state':
                    'US-HI',
                    'postalCode':
                    '88888',
                    'companyRoomStatus':
                    '5',
                    'comments':
                    '''Lorem ipsum dolor sit amet, consectetur adipiscin'''
                }))

        # Step 4. Post the room using SDK
        rooms_api = RoomsApi(api_client)
        response = rooms_api.create_room(body=room,
                                         account_id=args["account_id"])
        return response
    def worker(args):
        """
        1. Create an API client with headers
        2. Get room field data using SDK
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Get room field data using SDK
        rooms_api = RoomsApi(api_client)
        response = rooms_api.get_rooms(
            account_id=args["account_id"],
            field_data_changed_start_date=datetime.strptime(
                args['start_date'], "%Y-%m-%d"),
            field_data_changed_end_date=datetime.strptime(
                args['end_date'], "%Y-%m-%d"),
        )
        return response
Example #7
0
    def get_forms(args):
        """
        1. Create an API client with headers
        2. Get room documents
        2. Get room forms
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Get room documents
        rooms_api = RoomsApi(api_client)
        room_documents = rooms_api.get_documents(room_id=args["room_id"],
                                                 account_id=args["account_id"])

        # Step 2. Get room forms
        room_forms = [
            form for form in room_documents.documents if form.docu_sign_form_id
        ]
        return room_forms
Example #8
0
    def worker(args):
        """
        1. Create an API client with headers
        2. Get Default Admin role id
        3. Create RoomForCreate object
        4. Post the room using SDK
        """
        # Step 1. Create an API client with headers
        api_client = create_rooms_api_client(access_token=args["access_token"])

        # Step 2. Get Default Admin role id
        roles_api = RolesApi(api_client)
        roles = roles_api.get_roles(account_id=args["account_id"])
        role_id = [
            role.role_id for role in roles.roles if role.is_default_for_admin
        ][0]

        # Step 3. Create RoomForCreate object
        room = RoomForCreate(name=args["room_name"],
                             role_id=role_id,
                             template_id=args['template_id'],
                             field_data=FieldDataForCreate(
                                 data={
                                     'address1': '123 EZ Street',
                                     'city': 'Galaxian',
                                     'state': 'US-HI',
                                     'postalCode': '11111',
                                 }))

        # Step 4. Create the room using a POST API call.
        rooms_api = RoomsApi(api_client)
        response = rooms_api.create_room(
            room_for_create=room,
            account_id=args["account_id"],
        )
        return response