forked from intercom/python-intercom
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathall.py
More file actions
19 lines (14 loc) · 604 Bytes
/
all.py
File metadata and controls
19 lines (14 loc) · 604 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
"""Operation to retrieve all instances of a particular resource."""
from intercom import utils
from intercom.collection_proxy import CollectionProxy
class All(object):
"""A mixin that provides `all` functionality."""
proxy_class = CollectionProxy
def all(self):
"""Return a CollectionProxy for the resource."""
collection = utils.resource_class_to_collection_name(
self.collection_class)
finder_url = "/%s" % (collection)
return self.proxy_class(
self.client, self.collection_class, collection, finder_url)