diff --git a/VERSION b/VERSION index c4e41f94..c5106e6d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.3 +4.0.4 diff --git a/hubspot/discovery/crm/objects/discovery.py b/hubspot/discovery/crm/objects/discovery.py index cb51bcda..d07cb759 100644 --- a/hubspot/discovery/crm/objects/discovery.py +++ b/hubspot/discovery/crm/objects/discovery.py @@ -1,5 +1,4 @@ import hubspot.crm.objects as api_client -from hubspot.utils.objects import fetch_all from ...discovery_base import DiscoveryBase from .feedback_submissions.discovery import Discovery as FeedbackSubmissionsDiscovery @@ -29,5 +28,19 @@ def gdpr_api(self) -> api_client.GDPRApi: def feedback_submissions(self): return FeedbackSubmissionsDiscovery(self.config) - def get_all(self, **kwargs): - return fetch_all(self.basic_api, **kwargs) + def get_all(self, object_type, **kwargs): + return self.fetch_all(object_type, **kwargs) + + def fetch_all(self, object_type, **kwargs): + results = [] + after = None + PAGE_MAX_SIZE = 100 + + while True: + page = self.basic_api.get_page(object_type, after=after, limit=PAGE_MAX_SIZE, **kwargs) + results.extend(page.results) + if page.paging is None: + break + after = page.paging.next.after + + return results