Skip to content

Commit 341f844

Browse files
committed
Moving Count to it's own module.
1 parent 736f3cb commit 341f844

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

intercom/api_operations/count.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from intercom import Intercom
2+
from intercom import utils
3+
4+
5+
class Count(object):
6+
7+
@classmethod
8+
def count(cls):
9+
response = Intercom.get("/counts/")
10+
return response[utils.resource_class_to_name(cls)]['count']

intercom/user.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import time
1212
import types
1313
from intercom.api_operations.all import All
14+
from intercom.api_operations.count import Count
1415
from intercom.api_operations.delete import Delete
1516
from intercom.api_operations.find import Find
1617
from intercom.api_operations.find_all import FindAll
@@ -237,15 +238,6 @@ def increment(self, key, value=1):
237238
self.custom_attributes[key] = existing_value + value
238239

239240

240-
241-
class Count(object):
242-
243-
@classmethod
244-
def count(cls):
245-
response = Intercom.get("/counts/")
246-
return response[utils.resource_class_to_name(cls)]['count']
247-
248-
249241
class User(Resource, Find, FindAll, All, Count, Save, Delete, IncrementableAttributes):
250242
@property
251243
def flat_store_attributes(self):

0 commit comments

Comments
 (0)