Module: Hubspot::Helpers::GetAllHelper
- Included in:
- Crm::Companies::BasicApi, Crm::Contacts::BasicApi, Crm::Deals::BasicApi, Crm::LineItems::BasicApi, Crm::Objects::BasicApi, Crm::Products::BasicApi, Crm::Quotes::BasicApi, Crm::Tickets::BasicApi
- Defined in:
- lib/hubspot/helpers/get_all_helper.rb
Constant Summary collapse
- MAX_PAGE_SIZE =
100
Instance Method Summary collapse
-
#get_all(opts = {}) ⇒ Object
List Read all contacts.
Instance Method Details
#get_all(opts = {}) ⇒ Object
List Read all contacts. Control what is returned via the ‘properties` query param.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hubspot/helpers/get_all_helper.rb', line 12 def get_all(opts = {}) after = nil objects = [] loop do page_opts = opts.merge(limit: MAX_PAGE_SIZE, after: after) page = get_page(page_opts) objects.concat(page.results) break objects if page.paging.nil? after = page.paging._next.after end end |