Example #1
0
def update_contact(contact, connection):
    property_type_by_property_name = \
        get_property_type_by_property_name(connection)
    properties_data = format_contact_properties_for_saving(
        contact.properties,
        property_type_by_property_name,
    )
    path = _CONTACT_UPDATING_URL_TEMPLATE.format(contact_id=contact.vid)
    connection.send_post_request(
        path,
        properties_data,
    )
def update_contact(contact, connection):
    property_type_by_property_name = \
        get_property_type_by_property_name(connection)
    properties_data = format_contact_properties_for_saving(
            contact.properties,
            property_type_by_property_name,
    )
    path = _CONTACT_UPDATING_URL_TEMPLATE.format(contact_id=contact.vid)
    connection.send_post_request(
            path,
            properties_data,
    )
    def __call__(self):
        api_calls = self._available_properties_simulator()

        request_body_deserialization = format_contact_properties_for_saving(
                self._contact.properties,
                self._property_type_by_property_name,
        )
        api_call = SuccessfulAPICall(
                CONTACTS_API_SCRIPT_NAME + '/contact/vid/' + str(self._contact.vid) + '/profile',
                'POST',
                request_body_deserialization=request_body_deserialization,
                response_body_deserialization=None,
                )
        api_calls.append(api_call)

        return api_calls
Example #4
0
    def __call__(self):
        api_calls = self._available_properties_simulator()

        request_body_deserialization = format_contact_properties_for_saving(
                self._contact.properties,
                self._property_type_by_property_name,
        )
        api_call = SuccessfulAPICall(
                CONTACTS_API_SCRIPT_NAME + '/contact/vid/' + str(self._contact.vid) + '/profile',
                'POST',
                request_body_deserialization=request_body_deserialization,
                response_body_deserialization=None,
                )
        api_calls.append(api_call)

        return api_calls