@@ -45,8 +45,7 @@ Intercom documentation: `Create or Update Users <https://developers.intercom.io/
4545
4646::
4747
48- from intercom import User
49- User.create(user_id='1234', email='bob@example.com')
48+ intercom.users.create(user_id='1234', email='bob@example.com')
5049
5150Updating the Last Seen Time
5251+++++++++++++++++++++++++++
@@ -55,7 +54,7 @@ Intercom documentation: `Updating the Last Seen Time <https://developers.interco
5554
5655::
5756
58- user = User. create(used_id='25', last_request_at=datetime.now ())
57+ user = intercom.users. create(used_id='25', last_request_at=datetime.utcnow ())
5958
6059List Users
6160++++++++++
@@ -64,7 +63,7 @@ Intercom documentation: `List Users <https://developers.intercom.io/reference#li
6463
6564::
6665
67- for user in User .all():
66+ for user in intercom.users .all():
6867 ...
6968
7069List by Tag, Segment, Company
@@ -75,10 +74,10 @@ Intercom documentation: `List by Tag, Segment, Company <https://developers.inter
7574::
7675
7776 # tag request
78- User .find_all(tag_id='30126')
77+ intercom.users .find_all(tag_id='30126')
7978
8079 # segment request
81- User .find_all(segment_id='30126')
80+ intercom.users .find_all(segment_id='30126')
8281
8382
8483View a User
@@ -89,13 +88,13 @@ Intercom documentation: `View a User <https://developers.intercom.io/reference#v
8988::
9089
9190 # ID request
92- User .find(id='1')
91+ intercom.users .find(id='1')
9392
9493 # User ID request
95- User .find(user_id='1')
94+ intercom.users .find(user_id='1')
9695
9796 # Email request
98- User .find(email='bob@example.com')
97+ intercom.users .find(email='bob@example.com')
9998
10099Delete a User
101100+++++++++++++
@@ -105,13 +104,13 @@ Intercom documentation: `Deleting a User <https://developers.intercom.io/referen
105104::
106105
107106 # ID Delete Request
108- deleted_user = User .find(id='1').delete()
107+ deleted_user = intercom.users .find(id='1').delete()
109108
110109 # User ID Delete Request
111- deleted_user = User .find(user_id='1').delete()
110+ deleted_user = intercom.users .find(user_id='1').delete()
112111
113112 # Email Delete Request
114- deleted_user = User .find(email='bob@example.com').delete()
113+ deleted_user = intercom.users .find(email='bob@example.com').delete()
115114
116115
117116Companies
@@ -124,7 +123,7 @@ Intercom documentation: `Create or Update Company <https://developers.intercom.i
124123
125124::
126125
127- Company .create(company_id=6, name="Blue Sun", plan="Paid")
126+ intercom.companies .create(company_id=6, name="Blue Sun", plan="Paid")
128127
129128List Companies
130129++++++++++++++
@@ -133,7 +132,7 @@ Intercom documentation: `List Companies <https://developers.intercom.io/referenc
133132
134133::
135134
136- for company in Company .all():
135+ for company in intercom.companies .all():
137136 ...
138137
139138List by Tag or Segment
@@ -144,10 +143,10 @@ Intercom documentation: `List by Tag or Segment <https://developers.intercom.io/
144143::
145144
146145 # tag request
147- Company .find(tag_id="1234")
146+ intercom.companies .find(tag_id="1234")
148147
149148 # segment request
150- Company .find(segment_id="4567")
149+ intercom.companies .find(segment_id="4567")
151150
152151View a Company
153152++++++++++++++
@@ -156,7 +155,7 @@ Intercom documentation: `View a Company <https://developers.intercom.io/referenc
156155
157156::
158157
159- Company .find(id="41e66f0313708347cb0000d0")
158+ intercom.companies .find(id="41e66f0313708347cb0000d0")
160159
161160List Company Users
162161++++++++++++++++++
@@ -165,7 +164,7 @@ Intercom documentation: `List Company Users <https://developers.intercom.io/refe
165164
166165::
167166
168- company = Company .find(id="41e66f0313708347cb0000d0")
167+ company = intercom.companies .find(id="41e66f0313708347cb0000d0")
169168 for user in company.users:
170169 ...
171170
@@ -179,8 +178,7 @@ Intercom documentation: `List Admins <https://developers.intercom.io/reference#l
179178
180179::
181180
182- from intercom import Admin
183- for admin in Admin.all():
181+ for admin in intercom.admins.all():
184182 ...
185183
186184Tags
@@ -193,13 +191,11 @@ Intercom documentation: `Create and Update Tags <https://developers.intercom.io/
193191
194192::
195193
196- from intercom import Tag
197-
198194 # Create Request
199- tag = Tag .create(name='Independentt')
195+ tag = intercom.tags .create(name='Independentt')
200196
201197 # Update Request
202- Tag .tag_users(name='Independent', id=tag.id)
198+ intercom.tags .tag_users(name='Independent', id=tag.id)
203199
204200
205201Tag or Untag Users & Companies
@@ -210,10 +206,10 @@ Intercom documentation: `Tag or Untag Users & Companies <https://developers.inte
210206::
211207
212208 # Multi-User Tag Request
213- Tag .tag_users('Independent', ["42ea2f1b93891f6a99000427", "42ea2f1b93891f6a99000428"])
209+ intercom.tags .tag_users('Independent', ["42ea2f1b93891f6a99000427", "42ea2f1b93891f6a99000428"])
214210
215211 # Untag Request
216- Tag .untag_users('blue', ["42ea2f1b93891f6a99000427"])
212+ intercom.tags .untag_users('blue', ["42ea2f1b93891f6a99000427"])
217213
218214Delete a Tag
219215++++++++++++
@@ -222,7 +218,7 @@ Intercom documentation: `Delete a Tag <https://developers.intercom.io/reference#
222218
223219::
224220
225- tag .delete()
221+ intercom.tags .delete()
226222
227223
228224List Tags for an App
@@ -232,7 +228,7 @@ Intercom Documentation: `List Tags for an App <https://developers.intercom.io/re
232228
233229::
234230
235- for tag in Tag.all():
231+ for intercom.tags in Tag.all():
236232 ...
237233
238234Segments
@@ -245,9 +241,7 @@ Intercom Documentation: `List Segments <https://developers.intercom.io/reference
245241
246242::
247243
248- from intercom import Segment
249-
250- for segment in Segment.all():
244+ for segment in intercom.segments.all():
251245 ...
252246
253247View a Segment
@@ -257,7 +251,7 @@ Intercom Documentation: `View a Segment <https://developers.intercom.io/referenc
257251
258252::
259253
260- Segment .find(id='1234')
254+ intercom.segments .find(id='1234')
261255
262256Notes
263257-----
@@ -269,9 +263,7 @@ Intercom documentation: `Create a Note <https://developers.intercom.io/reference
269263
270264::
271265
272- from intercom import Note
273-
274- Note.create(email="joe@exampe.com", body="Text for the note")
266+ intercom.notes.create(email="joe@exampe.com", body="Text for the note")
275267
276268
277269List Notes for a User
@@ -282,11 +274,11 @@ Intercom documentation: `List Notes for a User <https://developers.intercom.io/r
282274::
283275
284276 # User ID Request
285- for note in Note .find_all(user_id='123'):
277+ for note in intercom.notes .find_all(user_id='123'):
286278 ...
287279
288280 # User Email Request
289- for note in Note .find_all(email='foo@bar.com'):
281+ for note in intercom.notes .find_all(email='foo@bar.com'):
290282 ...
291283
292284View a Note
@@ -296,7 +288,7 @@ Intercom documentation: `View a Note <https://developers.intercom.io/reference#v
296288
297289::
298290
299- Note .find(id='1234')
291+ intercom.notes .find(id='1234')
300292
301293Events
302294------
@@ -308,8 +300,7 @@ Intercom documentation: `Submitting Events <https://developers.intercom.io/refer
308300
309301::
310302
311- from intercom import Event
312- Event.create(event_name="Eventful 1", email=user.email, created_at=1403001013)
303+ intercom.events.create(event_name="Eventful 1", email=user.email, created_at=1403001013)
313304
314305
315306Counts
@@ -318,35 +309,27 @@ Counts
318309Getting counts
319310++++++++++++++
320311
321- Intercom documentation: `Creating a Tag <https://developers.intercom.io/reference#getting-counts >`_.
312+ Intercom documentation: `Getting Counts <https://developers.intercom.io/reference#getting-counts >`_.
322313
323314::
324315
325- from intercom import Count
326-
327316 # Conversation Admin Count
328- Count.conversation_counts_for_each_admin
317+ intercom.counts.for_type(type='converation', count='admin')
329318
330319 # User Tag Count
331- Count.user_counts_for_each_tag
320+ intercom.counts.for_type(type='user', count='tag')
332321
333322 # User Segment Count
334- Count.user_counts_for_each_segment
335-
336- # Company Segment Count
337- Count.company_counts_for_each_segment
338-
323+ intercom.counts.for_type(type='user', count='segment')
324+
339325 # Company Tag Count
340- Count.company_counts_for_each_tag
341-
326+ intercom.counts.for_type(type='company', count='tag')
327+
342328 # Company User Count
343- Count.company_counts_for_each_user
329+ intercom.counts.for_type(type='company', count='user')
344330
345331 # Global App Counts
346- Company.count
347- User.count
348- Segment.count
349- Tag.count
332+ intercom.counts.for_type()
350333
351334Conversations
352335-------------
@@ -358,7 +341,6 @@ Intercom documentation: `Admin Initiated Conversation <https://developers.interc
358341
359342::
360343
361- from intercom import Message
362344 message_data = {
363345 'message_type': 'email',
364346 'subject': 'This Land',
@@ -373,7 +355,7 @@ Intercom documentation: `Admin Initiated Conversation <https://developers.interc
373355 'id': "536e564f316c83104c000020"
374356 }
375357 }
376- Message .create(**message_data)
358+ intercom.messages .create(**message_data)
377359
378360User Initiated Conversation
379361+++++++++++++++++++++++++++
@@ -389,7 +371,7 @@ Intercom documentation: `User Initiated Conversation <https://developers.interco
389371 },
390372 'body': "Hey"
391373 }
392- Message .create(**message_data)
374+ intercom.messages .create(**message_data)
393375
394376List Conversations
395377++++++++++++++++++
@@ -398,8 +380,7 @@ Intercom documentation: `List Conversations <https://developers.intercom.io/refe
398380
399381::
400382
401- from intercom import Conversation
402- Conversation.find_all(type='admin', id=25, open=True)
383+ intercom.conversations.find_all(type='admin', id=25, open=True)
403384
404385
405386Get a Single Conversation
@@ -409,7 +390,7 @@ Intercom documentation: `Get a Single Conversation <https://developers.intercom.
409390
410391::
411392
412- Conversation .find(id='147')
393+ intercom.conversations .find(id='147')
413394
414395Replying to a Conversation
415396++++++++++++++++++++++++++
@@ -442,8 +423,7 @@ Intercom documentation: `Manage Subscriptions <https://developers.intercom.io/re
442423
443424::
444425
445- from intercom import Subscription
446- Subscription.create(service_type='web', url='http://example.com', topics=['all'])
426+ intercom.subscriptions.create(service_type='web', url='http://example.com', topics=['all'])
447427
448428
449429View a Subscription
@@ -453,7 +433,7 @@ Intercom documentation: `View a Subscription <https://developers.intercom.io/ref
453433
454434::
455435
456- Subscription .find(id='123')
436+ intercom.subscriptions .find(id='123')
457437
458438List Subscriptions
459439++++++++++++++++++
@@ -462,7 +442,7 @@ Intercom documentation: `List Subscriptions <https://developers.intercom.io/refe
462442
463443::
464444
465- for subscription in Subscription .all():
445+ for subscription in intercom.subscriptions .all():
466446 ...
467447
468448Development
0 commit comments