Module: Hubspot::Helpers::GetAllHelper
- Included in:
- Crm::Associations::V4::BasicApi, Crm::Companies::BasicApi, Crm::Contacts::BasicApi, Crm::Deals::BasicApi, Crm::LineItems::BasicApi, Crm::Objects::BasicApi, Crm::Objects::Calls::BasicApi, Crm::Objects::Communications::BasicApi, Crm::Objects::Emails::BasicApi, Crm::Objects::FeedbackSubmissions::BasicApi, Crm::Objects::Goals::BasicApi, Crm::Objects::Leads::BasicApi, Crm::Objects::Meetings::BasicApi, Crm::Objects::Notes::BasicApi, Crm::Objects::PostalMail::BasicApi, Crm::Objects::Tasks::BasicApi, Crm::Objects::Taxes::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 25 |
# File 'lib/hubspot/helpers/get_all_helper.rb', line 12 def get_all(opts = {}) after = nil objects = [] opts[:limit] ||= MAX_PAGE_SIZE loop do page_opts = opts.merge(after: after) page = get_page(page_opts) objects.concat(page.results) break objects if page.paging.nil? after = page.paging._next.after end end |