示例#1
0
def _get_contacts_data(connection, path_info, pagination_keys, property_names):
    if property_names:
        query_string_args = {'property': property_names}
    else:
        query_string_args = None

    data_retriever = PaginatedDataRetriever('contacts', pagination_keys)
    url_path = CONTACTS_API_SCRIPT_NAME + path_info
    contacts_data = \
        data_retriever.get_data(connection, url_path, query_string_args)
    return contacts_data
示例#2
0
def _get_contacts_data(connection, path_info, pagination_keys, property_names):
    if property_names:
        query_string_args = {'property': property_names}
    else:
        query_string_args = None

    data_retriever = PaginatedDataRetriever('contacts', pagination_keys)
    url_path = CONTACTS_API_SCRIPT_NAME + path_info
    contacts_data = \
        data_retriever.get_data(connection, url_path, query_string_args)
    return contacts_data
示例#3
0
def get_all_contact_lists(connection):
    """
    Get the meta-information for all the contact lists in the portal.
    
    :return: An iterator with :class:`ContactList` instances
    :raises hubspot.connection.exc.HubspotException:
    
    This function is a generator and requests are sent on demand. This is, the
    first request to HubSpot is deferred until the first list in the result
    is used, and from there on subsequent requests may be sent as the iterator
    is consumed.
    
    End-point documentation:
    http://developers.hubspot.com/docs/methods/lists/get_lists
    
    """
    data_retriever = PaginatedDataRetriever('lists', ['offset'])
    contact_lists_data = \
        data_retriever.get_data(connection, _CONTACT_LIST_COLLECTION_URL_PATH)
    contact_lists = _build_contact_lists_from_data(contact_lists_data)
    return contact_lists
示例#4
0
def get_all_contact_lists(connection):
    """
    Get the meta-information for all the contact lists in the portal.
    
    :return: An iterator with :class:`ContactList` instances
    :raises hubspot.connection.exc.HubspotException:
    
    This function is a generator and requests are sent on demand. This is, the
    first request to HubSpot is deferred until the first list in the result
    is used, and from there on subsequent requests may be sent as the iterator
    is consumed.
    
    End-point documentation:
    http://developers.hubspot.com/docs/methods/lists/get_lists
    
    """
    data_retriever = PaginatedDataRetriever('lists', ['offset'])
    contact_lists_data = \
        data_retriever.get_data(connection, _CONTACT_LIST_COLLECTION_URL_PATH)
    contact_lists = _build_contact_lists_from_data(contact_lists_data)
    return contact_lists