diff --git a/intercom/api_operations/find_all.py b/intercom/api_operations/find_all.py index cd8b251e..8538f57a 100644 --- a/intercom/api_operations/find_all.py +++ b/intercom/api_operations/find_all.py @@ -8,6 +8,8 @@ class FindAll(object): """A mixin that provides `find_all` functionality.""" + proxy_class = CollectionProxy + def find_all(self, **params): """Find all instances of the resource based on the supplied parameters.""" collection = utils.resource_class_to_collection_name( @@ -17,6 +19,6 @@ def find_all(self, **params): else: finder_url = "/%s" % (collection) finder_params = params - return CollectionProxy( + return self.proxy_class( self.client, self.collection_class, collection, finder_url, finder_params) diff --git a/intercom/service/event.py b/intercom/service/event.py index 2243e6fe..2ae1492c 100644 --- a/intercom/service/event.py +++ b/intercom/service/event.py @@ -3,10 +3,20 @@ from intercom import event from intercom.api_operations.bulk import Submit from intercom.api_operations.save import Save +from intercom.api_operations.find_all import FindAll from intercom.service.base_service import BaseService +from intercom.collection_proxy import CollectionProxy -class Event(BaseService, Save, Submit): +class EventCollectionProxy(CollectionProxy): + + def paging_info_present(self, response): + return 'pages' in response and 'next' in response['pages'] + + +class Event(BaseService, Save, Submit, FindAll): + + proxy_class = EventCollectionProxy @property def collection_class(self):