Tapi 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. tapi/__init__.py +2 -0
  2. tapi/api/__init__.py +46 -0
  3. tapi/api/action/__init__.py +7 -0
  4. tapi/api/action/actions.py +106 -0
  5. tapi/api/action/events.py +33 -0
  6. tapi/api/action/logs.py +34 -0
  7. tapi/api/admin/__init__.py +12 -0
  8. tapi/api/admin/action_egress_control_rules.py +87 -0
  9. tapi/api/admin/admin.py +43 -0
  10. tapi/api/admin/ip_access_control.py +76 -0
  11. tapi/api/admin/job.py +42 -0
  12. tapi/api/admin/scim.py +27 -0
  13. tapi/api/admin/template.py +86 -0
  14. tapi/api/admin/user.py +104 -0
  15. tapi/api/audit_log/__init__.py +5 -0
  16. tapi/api/audit_log/audit_logs.py +24 -0
  17. tapi/api/case/__init__.py +20 -0
  18. tapi/api/case/actions.py +90 -0
  19. tapi/api/case/activities.py +35 -0
  20. tapi/api/case/assignees.py +21 -0
  21. tapi/api/case/blocks.py +112 -0
  22. tapi/api/case/cases.py +132 -0
  23. tapi/api/case/comments.py +102 -0
  24. tapi/api/case/fields.py +69 -0
  25. tapi/api/case/files.py +77 -0
  26. tapi/api/case/inputs.py +64 -0
  27. tapi/api/case/linked_cases.py +57 -0
  28. tapi/api/case/metadata.py +65 -0
  29. tapi/api/case/notes.py +78 -0
  30. tapi/api/case/records.py +54 -0
  31. tapi/api/case/subscribers.py +56 -0
  32. tapi/api/credential/__init__.py +1 -0
  33. tapi/api/credential/credentials.py +240 -0
  34. tapi/api/event/__init__.py +1 -0
  35. tapi/api/event/events.py +44 -0
  36. tapi/api/folder/__init__.py +1 -0
  37. tapi/api/folder/folders.py +71 -0
  38. tapi/api/note/__init__.py +5 -0
  39. tapi/api/note/notes.py +76 -0
  40. tapi/api/record/__init__.py +7 -0
  41. tapi/api/record/artifacts.py +17 -0
  42. tapi/api/record/records.py +85 -0
  43. tapi/api/record/types.py +52 -0
  44. tapi/api/report/__init__.py +5 -0
  45. tapi/api/report/reporting.py +41 -0
  46. tapi/api/resource/__init__.py +1 -0
  47. tapi/api/resource/resources.py +152 -0
  48. tapi/api/story/__init__.py +10 -0
  49. tapi/api/story/change_requests.py +64 -0
  50. tapi/api/story/drafts.py +45 -0
  51. tapi/api/story/groups.py +38 -0
  52. tapi/api/story/runs.py +43 -0
  53. tapi/api/story/stories.py +162 -0
  54. tapi/api/story/versions.py +65 -0
  55. tapi/api/team/__init__.py +4 -0
  56. tapi/api/team/members.py +62 -0
  57. tapi/api/team/teams.py +60 -0
  58. tapi/api/tenant.py +68 -0
  59. tapi/client/__init__.py +1 -0
  60. tapi/client/client.py +55 -0
  61. tapi/utils/helpers.py +9 -0
  62. tapi/utils/http.py +8 -0
  63. tapi/utils/testing_decorators.py +5 -0
  64. tapi/utils/types.py +300 -0
  65. tapi-0.1.2.dist-info/METADATA +2487 -0
  66. tapi-0.1.2.dist-info/RECORD +69 -0
  67. tapi-0.1.2.dist-info/WHEEL +5 -0
  68. tapi-0.1.2.dist-info/licenses/LICENSE +674 -0
  69. tapi-0.1.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2487 @@
1
+ Metadata-Version: 2.4
2
+ Name: Tapi
3
+ Version: 0.1.2
4
+ Summary: Tines REST API wrapper
5
+ Home-page: https://github.com/1Doomdie1/Tapi
6
+ Author: Todoran Horia
7
+ License: GPL-3.0
8
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: annotated-types==0.7.0
15
+ Requires-Dist: build==1.2.2.post1
16
+ Requires-Dist: certifi==2024.12.14
17
+ Requires-Dist: charset-normalizer==3.4.1
18
+ Requires-Dist: colorama==0.4.6
19
+ Requires-Dist: idna==3.10
20
+ Requires-Dist: packaging==24.2
21
+ Requires-Dist: pydantic==2.10.6
22
+ Requires-Dist: pydantic_core==2.27.2
23
+ Requires-Dist: pyproject_hooks==1.2.0
24
+ Requires-Dist: python-dotenv==1.0.1
25
+ Requires-Dist: requests==2.32.3
26
+ Requires-Dist: setuptools==75.8.0
27
+ Requires-Dist: typing_extensions==4.12.2
28
+ Requires-Dist: urllib3==2.3.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: twine; extra == "dev"
32
+ Dynamic: author
33
+ Dynamic: classifier
34
+ Dynamic: description
35
+ Dynamic: description-content-type
36
+ Dynamic: home-page
37
+ Dynamic: license
38
+ Dynamic: license-file
39
+ Dynamic: provides-extra
40
+ Dynamic: requires-dist
41
+ Dynamic: requires-python
42
+ Dynamic: summary
43
+
44
+ # About Tapi
45
+ A simple Python wrapper for the Tines API.
46
+
47
+ ## ⚙️Installation
48
+
49
+ ```bash
50
+ pip install tapi-python
51
+ ```
52
+
53
+ ## 🔄 Usage
54
+
55
+ ### ✨ Using the main `TenantAPI` class
56
+ This class provides access to all endpoints offered by the Tines API.
57
+
58
+ ```python
59
+ from tapi import TenantAPI
60
+
61
+ def main():
62
+ tenant = TenantAPI("<DOMAIN>", "<API_KEY>")
63
+ teams = tenant.teams.list()
64
+ cases = tenant.cases.list()
65
+ stories = tenant.stories.list()
66
+
67
+ if __name__ == "__main__":
68
+ main()
69
+ ```
70
+
71
+ ### 🔧 Using specific endpoint classes
72
+ While the main `TenantAPI` class is convenient, using specific endpoint classes may be preferable in certain scenarios. Each class requires `DOMAIN` and `API_KEY` to be passed explicitly.
73
+
74
+ ```python
75
+ from tapi import CasesAPI, TeamsAPI, StoriesAPI
76
+
77
+ def main():
78
+ DOMAIN = "MY_COOL_DOMAIN"
79
+ API_KEY = "DO_NOT_PUT_THIS_ON_GITHUB"
80
+
81
+ cases_api = CasesAPI(DOMAIN, API_KEY)
82
+ teams_api = TeamsAPI(DOMAIN, API_KEY)
83
+ stories_api = StoriesAPI(DOMAIN, API_KEY)
84
+
85
+ if __name__ == "__main__":
86
+ main()
87
+ ```
88
+
89
+ ### Disabling SSL verification
90
+ There are cases when SSL verification can pose a problem in making a request to Tines REST API, fortunately
91
+ there is an easy way of disabling SSL verification in Tapi. Here is how:
92
+
93
+ ```python
94
+ from tapi.utils.http import disable_ssl_verification
95
+
96
+ disable_ssl_verification()
97
+ ```
98
+
99
+ ## Endpoint Classes
100
+
101
+ <details>
102
+ <summary>TenantAPI</summary>
103
+ This class is designed to be used as a "parent" class from which all other endpoints in tines can be accessed.
104
+
105
+ ### Methods
106
+
107
+ | **Method** | **Description** |
108
+ |---------------------|----------------------------------------------------------------------------|
109
+ | `info` | Retries information about the tenant. |
110
+ | `web_statistics` | Retrieve operational information about your web server. (Self Hosted Only) |
111
+ | `trigger_webhook` | Trigger a webhook from the tenant or external tenants. |
112
+ | `worker_statistics` | Retrieve essential information about worker statistics. (Self Hosted Only) |
113
+
114
+ ### Subclasses
115
+
116
+ | **Path** | **Class** | **Description** |
117
+ |-------------------------|------------------|----------------------------------------|
118
+ | `TenantAPI.cases` | `CasesAPI` | Manage cases. |
119
+ | `TenantAPI.teams` | `TeamsAPI` | Manage teams. |
120
+ | `TenantAPI.admin` | `AdminAPI` | Manage tenant through admin endpoints. |
121
+ | `TenantAPI.events` | `EventsAPI` | Manage tenant-wide action events. |
122
+ | `TenantAPI.stories` | `StoriesAPI` | Manage workflows. |
123
+ | `TenantAPI.folders` | `FoldersAPI` | Manage folders. |
124
+ | `TenantAPI.records` | `RecordsAPI` | Manage records. |
125
+ | `TenantAPI.resources` | `ResourcesAPI` | Manage resources. |
126
+ | `TenantAPI.reporting` | `ReportingAPI` | Pull action performance & time saved |
127
+ | `TenantAPI.audit_logs` | `AuditLogsAPI` | Pull tenant logs. |
128
+ | `TenantAPI.credentials` | `CredentialsAPI` | Manage tenant credentials. |
129
+
130
+
131
+ ### Usage:
132
+ ```python
133
+ from json import dumps
134
+ from tapi import TenantAPI
135
+
136
+ def main():
137
+ DOMAIN = "my-cool-domain-1234"
138
+ API_KEY = "do_not_put_this_on_github_lol"
139
+
140
+ tenant = TenantAPI(DOMAIN, API_KEY)
141
+
142
+ tenant_info = tenant.info()
143
+
144
+ print(dumps(tenant_info, indent = 4))
145
+ ```
146
+ ```json5
147
+ {
148
+ "body": {
149
+ "stack": {...}
150
+ },
151
+ "headers": {...},
152
+ "status_code": ...
153
+ }
154
+ ```
155
+
156
+ </details>
157
+
158
+ <details>
159
+ <summary>StoriesAPI</summary>
160
+ Manage tines workflows.
161
+
162
+ ### Methods
163
+
164
+ | **Method** | **Description** |
165
+ |----------------|------------------------------------------|
166
+ | `create` | Create story. |
167
+ | `get` | Get story details. |
168
+ | `update` | Update story details. |
169
+ | `list` | List all stories in the tenant or team. |
170
+ | `delete` | Delete story. |
171
+ | `batch_delete` | Delete multiple stories. |
172
+ | `export` | Export story. |
173
+ | `import_` | Import story. |
174
+ | `disable` | Update the disabled state of a story. |
175
+
176
+ ### Subclasses
177
+
178
+ | **Path** | **Class** | **Description** |
179
+ |------------------------------------|--------------------|------------------------------|
180
+ | `TenantAPI.stories.runs` | `RunsAPI` | Manage case runs. |
181
+ | `TenantAPI.stories.notes` | `NotesAPI` | Manage case notes. |
182
+ | `TenantAPI.stories.groups` | `GroupsAPI` | Pull action groups logs. |
183
+ | `TenantAPI.stories.drafts` | `DraftsAPI` | Manage story drafts. |
184
+ | `TenantAPI.stories.actions` | `ActionsAPI` | Manage case actions. |
185
+ | `TenantAPI.stories.versions` | `VersionsAPI` | Manage case versions. |
186
+ | `TenantAPI.stories.change_request` | `ChangeRequestAPI` | Manage case change requests. |
187
+
188
+ ### Usage:
189
+
190
+ ```python
191
+ from json import dumps
192
+ from tapi import StoriesAPI
193
+
194
+ def main():
195
+ DOMAIN = "my-cool-domain-1234"
196
+ API_KEY = "do_not_put_this_on_github_lol"
197
+
198
+ stories_api = StoriesAPI(DOMAIN, API_KEY)
199
+
200
+ stories = stories_api.list()
201
+
202
+ print(dumps(stories, indent = 4))
203
+ ```
204
+ ```json5
205
+ {
206
+ "body": {
207
+ "stories": [
208
+ {
209
+ "name": "Testing",
210
+ "user_id": 1234,
211
+ "description": null,
212
+ "keep_events_for": 604800,
213
+ "disabled": false,
214
+ "priority": false
215
+ //...[snip]...//
216
+ }
217
+ //...[snip]...//
218
+ ]
219
+ },
220
+ "headers": {...},
221
+ "status_code": ...
222
+ }
223
+ ```
224
+
225
+ </details>
226
+
227
+ <details>
228
+ <summary>RunsAPI</summary>
229
+ Manage workflows runs.
230
+
231
+ ### Methods
232
+
233
+ | **Method** | **Description** |
234
+ |------------|--------------------------------------------|
235
+ | `events` | Retrieve a list of events for a story run. |
236
+ | `list` | Retrieve a list of story runs. |
237
+
238
+ ### Subclasses
239
+ - **None**
240
+
241
+ ### Usage
242
+
243
+ ```python
244
+ from json import dumps
245
+ from tapi import RunsAPI
246
+
247
+ def main():
248
+ DOMAIN = "my-cool-domain-1234"
249
+ API_KEY = "do_not_put_this_on_github_lol"
250
+
251
+ story_run_api = RunsAPI(DOMAIN, API_KEY)
252
+
253
+ runs = story_run_api.list(
254
+ story_id = 1234
255
+ )
256
+
257
+ print(dumps(runs, indent = 4))
258
+ ```
259
+ ```json5
260
+ {
261
+ "body": {
262
+ "story_runs": [
263
+ {
264
+ "guid": "1b3087a2-1589-4fb8-8259-d74d38fccfb2",
265
+ "duration": 0,
266
+ "story_id": 1234,
267
+ "start_time": "2025-01-27T21:13:20Z",
268
+ "end_time": "2025-01-27T21:13:20Z",
269
+ "action_count": 1,
270
+ "event_count": 1,
271
+ "story_mode": "LIVE"
272
+ },
273
+ //...[snip]...//
274
+ ]
275
+ },
276
+ "headers": {...},
277
+ "status_code": ...
278
+ }
279
+ ```
280
+
281
+ </details>
282
+
283
+ <details>
284
+ <summary>VersionsAPI</summary>
285
+ Manage stories versions.
286
+
287
+ ### Methods
288
+
289
+ | **Method** | **Description** |
290
+ |------------|------------------------------------|
291
+ | `create` | Create a story version. |
292
+ | `get` | Retrieve a story version. |
293
+ | `update` | Update a story version. |
294
+ | `list` | Retrieve a list of story versions. |
295
+ | `delete` | Delete a story version. |
296
+
297
+ ### Subclasses
298
+ - **None**
299
+
300
+ ### Usage:
301
+
302
+ ```python
303
+ from json import dumps
304
+ from tapi import VersionsAPI
305
+
306
+ def main():
307
+ DOMAIN = "my-cool-domain-1234"
308
+ API_KEY = "do_not_put_this_on_github_lol"
309
+
310
+ story_version_api = VersionsAPI(DOMAIN, API_KEY)
311
+
312
+ versions = story_version_api.list(
313
+ story_id = 1234
314
+ )
315
+
316
+ print(dumps(versions, indent = 4))
317
+ ```
318
+ ```json5
319
+ {
320
+ "body": {
321
+ "story_versions": [
322
+ {
323
+ "id": 69670,
324
+ "name": "",
325
+ "description": "",
326
+ "timestamp": "2025-01-27T21:20:00Z"
327
+ },
328
+ //...[snip]...//
329
+ ],
330
+ },
331
+ "headers": {...},
332
+ "status_code": ...
333
+ }
334
+ ```
335
+
336
+ </details>
337
+
338
+ <details>
339
+ <summary>TeamsAPI</summary>
340
+ Manage tines teams.
341
+
342
+ ### Methods
343
+
344
+ | **Method** | **Description** |
345
+ |------------|---------------------------------------|
346
+ | `create` | Create a team in Tines. |
347
+ | `get` | Retrieve a single team or case group. |
348
+ | `update` | Update a team. |
349
+ | `list` | Retrieve a list of teams. |
350
+ | `delete` | Delete a team or case group. |
351
+
352
+ ### Subclasses
353
+
354
+ | **Path** | **Class** | **Description** |
355
+ |---------------------------|--------------------|----------------------|
356
+ | `TenantAPI.teams.members` | `MembersAPI` | Manage team members. |
357
+
358
+ ### Usage:
359
+
360
+ ```python
361
+ from json import dumps
362
+ from tapi import TeamsAPI
363
+
364
+ def main():
365
+ DOMAIN = "my-cool-domain-1234"
366
+ API_KEY = "do_not_put_this_on_github_lol"
367
+
368
+ teams_api = TeamsAPI(DOMAIN, API_KEY)
369
+
370
+ teams = teams_api.list()
371
+
372
+ print(dumps(teams, indent = 4))
373
+ ```
374
+ ```json5
375
+ {
376
+ "body": {
377
+ "teams": [
378
+ {
379
+ "id": 12345,
380
+ "name": "My Team",
381
+ "groups": []
382
+ },
383
+ //...[snip]...//
384
+ ],
385
+ },
386
+ "headers": {...},
387
+ "status_code": ...
388
+ }
389
+ ```
390
+
391
+ </details>
392
+
393
+ <details>
394
+ <summary>MembersAPI</summary>
395
+ Manage teams members.
396
+
397
+ ### Methods
398
+
399
+ | **Method** | **Description** |
400
+ |-----------------|-------------------------------------|
401
+ | `list` | Retrieve a list of team members. |
402
+ | `remove` | Remove a user from a team. |
403
+ | `invite` | Invite a user to join a team. |
404
+ | `resend_invite` | Resend a team invitation to a user. |
405
+
406
+ ### Subclasses
407
+ - **None**
408
+
409
+ ### Usage:
410
+
411
+ ```python
412
+ from json import dumps
413
+ from tapi import MembersAPI
414
+
415
+ def main():
416
+ DOMAIN = "my-cool-domain-1234"
417
+ API_KEY = "do_not_put_this_on_github_lol"
418
+
419
+ members_api = MembersAPI(DOMAIN, API_KEY)
420
+
421
+ members = members_api.list(team_id = 1234)
422
+
423
+ print(dumps(members, indent = 4))
424
+ ```
425
+ ```json5
426
+ {
427
+ "body": {
428
+ "members": [
429
+ {
430
+ "id": 1234,
431
+ "first_name": "John",
432
+ "last_name": "Doe",
433
+ "email": "john@doe.io",
434
+ "is_admin": true,
435
+ "created_at": "2025-01-27T17:33:33Z",
436
+ "last_seen": "2025-02-03T18:42:23Z",
437
+ "invitation_accepted": true,
438
+ "role": "TEAM_ADMIN"
439
+ },
440
+ //...[snip]...//
441
+ ],
442
+ },
443
+ "headers": {...},
444
+ "status_code": ...
445
+ }
446
+ ```
447
+
448
+ </details>
449
+
450
+ <details>
451
+ <summary>CasesAPI</summary>
452
+ Manage tines cases.
453
+
454
+ ### Methods
455
+
456
+ | **Method** | **Description** |
457
+ |------------|---------------------------|
458
+ | `create` | Create a case. |
459
+ | `get` | Retrieve a single case. |
460
+ | `download` | Retrieve a PDF of a case. |
461
+ | `update` | Update a case. |
462
+ | `list` | Retrieve a list of cases. |
463
+ | `delete` | Delete a case. |
464
+
465
+ ### Subclasses
466
+
467
+ | **Path** | **Class** | **Description** |
468
+ |--------------------------------|----------------------|--------------------------|
469
+ | `TenantAPI.cases.files` | `CaseFilesAPI` | Manage case files. |
470
+ | `TenantAPI.cases.notes` | `CaseNotesAPI` | Manage case notes. |
471
+ | `TenantAPI.cases.inputs` | `CaseInputsAPI` | Manage case inputs. |
472
+ | `TenantAPI.cases.fields` | `CaseFieldsAPI` | Manage case fields. |
473
+ | `TenantAPI.cases.blocks` | `CaseBlocksAPI` | Manage case blocks. |
474
+ | `TenantAPI.cases.linked_cases` | `LinkedCasesAPI` | Manage linked cases. |
475
+ | `TenantAPI.cases.actions` | `CaseActionsAPI` | Manage case actions. |
476
+ | `TenantAPI.cases.records` | `CaseRecordsAPI` | Manage case records. |
477
+ | `TenantAPI.cases.comments` | `CaseCommentsAPI` | Manage case comments. |
478
+ | `TenantAPI.cases.metadata` | `CaseMetadataAPI` | Manage case metadata. |
479
+ | `TenantAPI.cases.assignees` | `CaseAssigneesAPI` | Manage case assignees. |
480
+ | `TenantAPI.cases.activities` | `CaseActivitiesAPI` | Manage case activities. |
481
+ | `TenantAPI.cases.subscribers` | `CaseSubscribersAPI` | Manage case subscribers. |
482
+
483
+ ### Usage:
484
+
485
+ ```python
486
+ from json import dumps
487
+ from tapi import CasesAPI
488
+
489
+ def main():
490
+ DOMAIN = "my-cool-domain-1234"
491
+ API_KEY = "do_not_put_this_on_github_lol"
492
+
493
+ case_api = CasesAPI(DOMAIN, API_KEY)
494
+
495
+ cases = case_api.list()
496
+
497
+ print(dumps(cases, indent = 4))
498
+ ```
499
+ ```json5
500
+ {
501
+ "body": {
502
+ "cases": [
503
+ {
504
+ "case_id": 1,
505
+ "name": "My Case",
506
+ "description": "",
507
+ "status": "OPEN",
508
+ "sub_status": {
509
+ "id": 38482,
510
+ "name": "To do"
511
+ },
512
+ //...[snip]...//
513
+ },
514
+ ],
515
+ },
516
+ "headers": {...},
517
+ "status_code": ...
518
+ }
519
+ ```
520
+
521
+ </details>
522
+
523
+ <details>
524
+ <summary>CaseActionsAPI</summary>
525
+ Manage case actions.
526
+
527
+ ### Methods
528
+
529
+ | **Method** | **Description** |
530
+ |----------------|------------------------------------------------------|
531
+ | `create` | Create a new case action on a specified case. |
532
+ | `get` | Retrieve a specific case action. |
533
+ | `update` | Update an action. |
534
+ | `list` | Retrieve a list of case actions for a specific case. |
535
+ | `delete` | Delete an existing case action. |
536
+ | `batch_update` | Update the actions on a case |
537
+
538
+ ### Subclasses
539
+ - **None**
540
+
541
+ ### Usage:
542
+
543
+ ```python
544
+ from json import dumps
545
+ from tapi import CaseActionsAPI
546
+
547
+ def main():
548
+ DOMAIN = "my-cool-domain-1234"
549
+ API_KEY = "do_not_put_this_on_github_lol"
550
+
551
+ case_actions_api = CaseActionsAPI(DOMAIN, API_KEY)
552
+
553
+ actions = case_actions_api.list(case_id=1234)
554
+
555
+ print(dumps(actions, indent = 4))
556
+ ```
557
+ ```json5
558
+ {
559
+ "body": {
560
+ "case_id": 1234,
561
+ "actions": [
562
+ {
563
+ "id": 29907,
564
+ "url": "https://example.tines.com",
565
+ "label": "Complete request",
566
+ "story_name": null,
567
+ "page_emoji": null,
568
+ "story_emoji": null,
569
+ "action_type": "page",
570
+ "action_text": "Open",
571
+ "created_at": "2025-02-03T18:41:59Z",
572
+ "updated_at": "2025-02-03T18:41:59Z"
573
+ },
574
+ //...[snip]...//
575
+ ],
576
+ },
577
+ "headers": {...},
578
+ "status_code": ...
579
+ }
580
+ ```
581
+
582
+ </details>
583
+
584
+ <details>
585
+ <summary>CaseActivitiesAPI</summary>
586
+ Manage case activities.
587
+
588
+ ### Methods
589
+
590
+ | **Method** | **Description** |
591
+ |------------|------------------------------------------------|
592
+ | `get` | Retrieve a single case activity. |
593
+ | `list` | Retrieve a list of case activities for a case. |
594
+
595
+ ### Subclasses
596
+ - **None**
597
+
598
+ ### Usage:
599
+
600
+ ```python
601
+ from json import dumps
602
+ from tapi import CaseActivitiesAPI
603
+
604
+ def main():
605
+ DOMAIN = "my-cool-domain-1234"
606
+ API_KEY = "do_not_put_this_on_github_lol"
607
+
608
+ case_activities_api = CaseActivitiesAPI(DOMAIN, API_KEY)
609
+
610
+ activities = case_activities_api.list(case_id=1234)
611
+
612
+ print(dumps(activities, indent = 4))
613
+ ```
614
+ ```json5
615
+ {
616
+ "body": {
617
+ "case_id": 26,
618
+ "activities": [
619
+ {
620
+ "id": 591299,
621
+ "activity_type": "COMMENTED",
622
+ "value": "Some random comment",
623
+ "created_at": "2025-01-29T21:39:27Z",
624
+ "user": {
625
+ "user_id": "6868",
626
+ "first_name": "John",
627
+ "last_name": "Doe",
628
+ "email": "john@doe.io",
629
+ "avatar_url": "",
630
+ "is_service_account": false
631
+ },
632
+ "reactions": []
633
+ },
634
+ //...[snip]...//
635
+ ],
636
+ },
637
+ "headers": {...},
638
+ "status_code": ...
639
+ }
640
+ ```
641
+
642
+ </details>
643
+
644
+ <details>
645
+ <summary>CaseAssigneesAPI</summary>
646
+ Manage case assignees.
647
+
648
+ ### Methods
649
+
650
+ | **Method** | **Description** |
651
+ |------------|-----------------------------------------|
652
+ | `list` | Retrieve a list of assignees of a case. |
653
+
654
+ ### Subclasses
655
+ - **None**
656
+
657
+ ### Usage:
658
+
659
+ ```python
660
+ from json import dumps
661
+ from tapi import CaseAssigneesAPI
662
+
663
+ def main():
664
+ DOMAIN = "my-cool-domain-1234"
665
+ API_KEY = "do_not_put_this_on_github_lol"
666
+
667
+ case_assignees_api = CaseAssigneesAPI(DOMAIN, API_KEY)
668
+
669
+ assignees = case_assignees_api.list(case_id=1234)
670
+
671
+ print(dumps(assignees, indent = 4))
672
+ ```
673
+ ```json5
674
+ {
675
+ "body": {
676
+ "case_id": 1234,
677
+ "assignees": [...],
678
+ //...[snip]...//
679
+ },
680
+ "headers": {...},
681
+ "status_code": ...
682
+ }
683
+ ```
684
+
685
+ </details>
686
+
687
+ <details>
688
+ <summary>CaseInputsAPI</summary>
689
+ Manage case inputs.
690
+
691
+ ### Methods
692
+
693
+ | **Method** | **Description** |
694
+ |------------|---------------------------------|
695
+ | `create` | Create a case input on a team. |
696
+ | `get` | Returns a case input. |
697
+ | `list` | Returns a list of case inputs. |
698
+
699
+ ### Subclasses
700
+
701
+ | **Path** | **Class** | **Description** |
702
+ |--------------------------|-----------------------|---------------------|
703
+ | `TenantAPI.cases.inputs` | `CaseInputsFieldsAPI` | Manage Case Inputs. |
704
+
705
+ ### Usage:
706
+
707
+ ```python
708
+ from json import dumps
709
+ from tapi import CaseInputsAPI
710
+
711
+ def main():
712
+ DOMAIN = "my-cool-domain-1234"
713
+ API_KEY = "do_not_put_this_on_github_lol"
714
+
715
+ case_inputs_api = CaseInputsAPI(DOMAIN, API_KEY)
716
+
717
+ inputs = case_inputs_api.list()
718
+
719
+ print(dumps(inputs, indent = 4))
720
+ ```
721
+ ```json5
722
+ {
723
+ "body": {
724
+ "case_inputs": [
725
+ {
726
+ "id": 412,
727
+ "name": "Create Case Input Unit Test",
728
+ "key": "create_case_input_unit_test",
729
+ "input_type": "number",
730
+ "validation_type": "none",
731
+ "validation_options": {},
732
+ "team": {
733
+ "id": 10445,
734
+ "name": "Collaboration Space"
735
+ },
736
+ "created_at": "2025-01-29T18:07:07Z",
737
+ "updated_at": "2025-01-29T18:07:07Z"
738
+ }
739
+ ],
740
+ },
741
+ "headers": {...},
742
+ "status_code": ...
743
+ }
744
+ ```
745
+
746
+ </details>
747
+
748
+ <details>
749
+ <summary>CaseInputsFieldsAPI</summary>
750
+ Manage case input fields.
751
+
752
+ ### Methods
753
+
754
+ | **Method** | **Description** |
755
+ |------------|--------------------------------------------|
756
+ | `list` | Retrieve a list of fields of a case input. |
757
+
758
+ ### Subclasses
759
+ - **None**
760
+
761
+ ### Usage:
762
+
763
+ ```python
764
+ from json import dumps
765
+ from tapi import CaseInputsFieldsAPI
766
+
767
+ def main():
768
+ DOMAIN = "my-cool-domain-1234"
769
+ API_KEY = "do_not_put_this_on_github_lol"
770
+
771
+ case_input_fields_api = CaseInputsFieldsAPI(DOMAIN, API_KEY)
772
+
773
+ input_fields = case_input_fields_api.list(case_input_id=1234)
774
+
775
+ print(dumps(input_fields, indent = 4))
776
+ ```
777
+ ```json5
778
+ {
779
+ "body": {
780
+ "fields": [
781
+ {
782
+ "id": 65221,
783
+ "value": "2",
784
+ "case": {
785
+ "id": 26
786
+ },
787
+ "case_input": {
788
+ "id": 412,
789
+ "name": "Input Name"
790
+ }
791
+ }
792
+ ],
793
+ },
794
+ "headers": {...},
795
+ "status_code": ...
796
+ }
797
+ ```
798
+
799
+ </details>
800
+
801
+ <details>
802
+ <summary>CaseCommentsAPI</summary>
803
+ Manage case comments.
804
+
805
+ ### Methods
806
+
807
+ | **Method** | **Description** |
808
+ |------------|-----------------------------------------|
809
+ | `create` | Add a comment to a case. |
810
+ | `get` | Retrieve a single comment for a case. |
811
+ | `update` | Update an existing case comment. |
812
+ | `list` | Retrieve a list of comments for a case. |
813
+ | `delete` | Delete a comment from a case. |
814
+
815
+ ### Subclasses
816
+
817
+ | **Path** | **Class** | **Description** |
818
+ |--------------------------------------|----------------------------|---------------------------------|
819
+ | `TenantAPI.cases.comments.reactions` | `CaseCommentsReactionsAPI` | Manage case comments reactions. |
820
+
821
+ ### Usage:
822
+
823
+ ```python
824
+ from json import dumps
825
+ from tapi import CaseCommentsAPI
826
+
827
+ def main():
828
+ DOMAIN = "my-cool-domain-1234"
829
+ API_KEY = "do_not_put_this_on_github_lol"
830
+
831
+ case_comments_api = CaseCommentsAPI(DOMAIN, API_KEY)
832
+
833
+ comments = case_comments_api.list(case_id=1234)
834
+
835
+ print(dumps(comments, indent = 4))
836
+ ```
837
+ ```json5
838
+ {
839
+ "body": {
840
+ "case_id": 1234,
841
+ "comments": [
842
+ {
843
+ "id": 591299,
844
+ "activity_type": "COMMENTED",
845
+ "value": "Some Comment",
846
+ "created_at": "2025-01-29T21:39:27Z",
847
+ "user": {
848
+ "user_id": "6868",
849
+ "first_name": "John",
850
+ "last_name": "Doe",
851
+ "email": "john@doe.io",
852
+ "avatar_url": "",
853
+ "is_service_account": false
854
+ },
855
+ "reactions": []
856
+ }
857
+ //...[snip]...//
858
+ ],
859
+ },
860
+ "headers": {...},
861
+ "status_code": ...
862
+ }
863
+ ```
864
+
865
+ </details>
866
+
867
+ <details>
868
+ <summary>CaseCommentsReactionsAPI</summary>
869
+ Manage comments reactions.
870
+
871
+ ### Methods
872
+
873
+ | **Method** | **Description** |
874
+ |------------|-----------------------------------|
875
+ | `add` | Add a reaction to a comment. |
876
+ | `remove` | Remove a reaction from a comment. |
877
+
878
+
879
+ ### Subclasses
880
+ - **None**
881
+
882
+ ### Usage:
883
+
884
+ ```python
885
+ from json import dumps
886
+ from tapi.utils.types import ReactionType
887
+ from tapi import CaseCommentsReactionsAPI
888
+
889
+
890
+ def main():
891
+ DOMAIN = "my-cool-domain-1234"
892
+ API_KEY = "do_not_put_this_on_github_lol"
893
+
894
+ comments_reactions_api = CaseCommentsReactionsAPI(DOMAIN, API_KEY)
895
+
896
+ reaction = comments_reactions_api.add(
897
+ case_id=1234,
898
+ comment_id=5678,
899
+ value=ReactionType.PLUS_ONE
900
+ )
901
+
902
+ print(dumps(reaction, indent=4))
903
+ ```
904
+ ```json5
905
+ {
906
+ "body": {
907
+ "reactions": [
908
+ {
909
+ "emoji": ":+1:",
910
+ "reactants": [
911
+ {
912
+ "user_id": 6866,
913
+ "user_name": "John Doe",
914
+ "reacted_at": "2025-02-04T03:40:14+00:00"
915
+ }
916
+ ]
917
+ }
918
+ ],
919
+ //...[snip]...//
920
+ },
921
+ "headers": {...},
922
+ "status_code": ...
923
+ }
924
+ ```
925
+
926
+ </details>
927
+
928
+ <details>
929
+ <summary>CaseFieldsAPI</summary>
930
+ Manage case fields.
931
+
932
+ ### Methods
933
+
934
+ | **Method** | **Description** |
935
+ |------------|---------------------------------------|
936
+ | `create` | Add a field to a case. |
937
+ | `get` | Retrieve a single field for a case. |
938
+ | `update` | Update an existing case field. |
939
+ | `list` | Retrieve a list of fields for a case. |
940
+ | `delete` | Delete a field from a case. |
941
+
942
+ ### Subclasses
943
+ - **None**
944
+
945
+ ### Usage:
946
+
947
+ ```python
948
+ from json import dumps
949
+ from tapi import CaseFieldsAPI
950
+
951
+ def main():
952
+ DOMAIN = "my-cool-domain-1234"
953
+ API_KEY = "do_not_put_this_on_github_lol"
954
+
955
+ case_fields_api = CaseFieldsAPI(DOMAIN, API_KEY)
956
+
957
+ case_fields = case_fields_api.list(case_id=1234)
958
+
959
+ print(dumps(case_fields, indent = 4))
960
+ ```
961
+ ```json5
962
+ {
963
+ "body": {
964
+ "case_id": 1234,
965
+ "fields": [
966
+ {
967
+ "id": 65221,
968
+ "value": "2",
969
+ "case_input": {
970
+ "id": 412,
971
+ "key": "input_name",
972
+ "name": "Input Name"
973
+ }
974
+ },
975
+ //...[snip]...//
976
+ ],
977
+ },
978
+ "headers": {...},
979
+ "status_code": ...
980
+ }
981
+ ```
982
+
983
+ </details>
984
+
985
+ <details>
986
+ <summary>CaseFilesAPI</summary>
987
+ Manage case files.
988
+
989
+ ### Methods
990
+
991
+ | **Method** | **Description** |
992
+ |------------|--------------------------------------|
993
+ | `create` | Attach a file to a case. |
994
+ | `get` | Retrieve details for a case file. |
995
+ | `list` | Retrieve a list of files for a case. |
996
+ | `delete` | Delete a file from a case. |
997
+ | `download` | Retrieve a case file attachment. |
998
+
999
+ ### Subclasses
1000
+ - **None**
1001
+
1002
+ ### Usage:
1003
+
1004
+ ```python
1005
+ from json import dumps
1006
+ from tapi import CaseFilesAPI
1007
+
1008
+ def main():
1009
+ DOMAIN = "my-cool-domain-1234"
1010
+ API_KEY = "do_not_put_this_on_github_lol"
1011
+
1012
+ case_files_api = CaseFilesAPI(DOMAIN, API_KEY)
1013
+
1014
+ files = case_files_api.list(case_id=1234)
1015
+
1016
+ print(dumps(files, indent = 4))
1017
+ ```
1018
+ ```json5
1019
+ {
1020
+ "body": {
1021
+ "files": [
1022
+ {
1023
+ "id": 592294,
1024
+ "activity_type": "FILE_ATTACHED_AND_COMMENTED",
1025
+ "value": "Testing comment",
1026
+ "file": {
1027
+ "filename": "My File",
1028
+ "url": "https://my-cool-domain-1234.tines.com/api/v2/cases/1234/files/592294/download"
1029
+ },
1030
+ "created_at": "2025-02-01T22:14:36Z",
1031
+ "user": {
1032
+ "user_id": "6868",
1033
+ "first_name": "john",
1034
+ "last_name": "doe",
1035
+ "email": "john@doe.io",
1036
+ "avatar_url": "",
1037
+ "is_service_account": false
1038
+ },
1039
+ "reactions": []
1040
+ },
1041
+ //...[snip]...//
1042
+ ],
1043
+ //...[snip]...//
1044
+ },
1045
+ "headers": {...},
1046
+ "status_code": ...
1047
+ }
1048
+ ```
1049
+
1050
+ </details>
1051
+
1052
+ <details>
1053
+ <summary>LinkedCasesAPI</summary>
1054
+ Manage linked cases.
1055
+
1056
+ ### Methods
1057
+
1058
+ | **Method** | **Description** |
1059
+ |----------------|--------------------------------------------------------|
1060
+ | `create` | Link two cases together by creating a new case link. |
1061
+ | `list` | Retrieve the linked cases for a case. |
1062
+ | `delete` | Unlink two cases by deleting a case link. |
1063
+ | `batch_create` | Batch link cases together by creating a new case link. |
1064
+
1065
+ ### Subclasses
1066
+ - **None**
1067
+
1068
+ ### Usage:
1069
+
1070
+ ```python
1071
+ from json import dumps
1072
+ from tapi import LinkedCasesAPI
1073
+
1074
+ def main():
1075
+ DOMAIN = "my-cool-domain-1234"
1076
+ API_KEY = "do_not_put_this_on_github_lol"
1077
+
1078
+ link_case_api = LinkedCasesAPI(DOMAIN, API_KEY)
1079
+
1080
+ linked_cases = link_case_api.list(case_id=1234)
1081
+
1082
+ print(dumps(linked_cases, indent = 4))
1083
+ ```
1084
+ ```json5
1085
+ {
1086
+ "body": {
1087
+ "case_id": 1234,
1088
+ "name": "Action Testing Case",
1089
+ "linked_cases": [
1090
+ {
1091
+ "case_id": 58,
1092
+ "name": "Case 2 link"
1093
+ }
1094
+ ],
1095
+ //...[snip]...//
1096
+ },
1097
+ "headers": {...},
1098
+ "status_code": ...
1099
+ }
1100
+ ```
1101
+
1102
+ </details>
1103
+
1104
+ <details>
1105
+ <summary>CaseMetadataAPI</summary>
1106
+ Manage case metadata.
1107
+
1108
+ ### Methods
1109
+
1110
+ | **Method** | **Description** |
1111
+ |----------------|-----------------------------------------------------------------|
1112
+ | `create` | Create new metadata key-value pairs for a specified case. |
1113
+ | `get` | Retrieve a specific key-value pair from the metadata of a case. |
1114
+ | `update` | Update metadata key-value pairs for a case. |
1115
+ | `list` | Retrieve the metadata from a case. |
1116
+ | `delete` | Delete existing metadata key-value pairs in a case. |
1117
+
1118
+ ### Subclasses
1119
+ - **None**
1120
+
1121
+ ### Usage:
1122
+
1123
+ ```python
1124
+ from json import dumps
1125
+ from tapi import CaseMetadataAPI
1126
+
1127
+ def main():
1128
+ DOMAIN = "my-cool-domain-1234"
1129
+ API_KEY = "do_not_put_this_on_github_lol"
1130
+
1131
+ case_metadata_api = CaseMetadataAPI(DOMAIN, API_KEY)
1132
+
1133
+ metadata = case_metadata_api.list(case_id=1234)
1134
+
1135
+ print(dumps(metadata, indent = 4))
1136
+ ```
1137
+ ```json5
1138
+ {
1139
+ "body": {
1140
+ "case_id": 1234,
1141
+ "metadata": {
1142
+ "name": "John Doe",
1143
+ }
1144
+ },
1145
+ "headers": {...},
1146
+ "status_code": ...
1147
+ }
1148
+ ```
1149
+
1150
+ </details>
1151
+
1152
+ <details>
1153
+ <summary>CaseNotesAPI</summary>
1154
+ Manage case notes.
1155
+
1156
+ ### Methods
1157
+
1158
+ | **Method** | **Description** |
1159
+ |----------------|--------------------------------------|
1160
+ | `create` | Add a note to a case. |
1161
+ | `get` | Retrieve a single note for a case. |
1162
+ | `update` | Update an existing case note. |
1163
+ | `list` | Retrieve a list of notes for a case. |
1164
+ | `delete` | Delete a note from a case. |
1165
+
1166
+ ### Subclasses
1167
+ - **None**
1168
+
1169
+ ### Usage:
1170
+
1171
+ ```python
1172
+ from json import dumps
1173
+ from tapi import CaseNotesAPI
1174
+
1175
+ def main():
1176
+ DOMAIN = "my-cool-domain-1234"
1177
+ API_KEY = "do_not_put_this_on_github_lol"
1178
+
1179
+ case_notes_api = CaseNotesAPI(DOMAIN, API_KEY)
1180
+
1181
+ notes = case_notes_api.list(case_id=1234)
1182
+
1183
+ print(dumps(notes, indent = 4))
1184
+ ```
1185
+ ```json5
1186
+ {
1187
+ "body": {
1188
+ "case_id": 1234,
1189
+ "notes": [
1190
+ {
1191
+ "id": 87,
1192
+ "title": "My Note",
1193
+ "content": "This is a very helpful note, as you can see",
1194
+ "color": "blue",
1195
+ "author": {
1196
+ "user_id": "6868",
1197
+ "first_name": "john",
1198
+ "last_name": "doe",
1199
+ "email": "john@doe.io",
1200
+ "avatar_url": "",
1201
+ "is_service_account": false
1202
+ },
1203
+ "created_at": "2025-02-02T20:58:53Z",
1204
+ "updated_at": "2025-02-02T20:58:53Z"
1205
+ },
1206
+ //...[snip]...//
1207
+ ],
1208
+ //...[snip]...//
1209
+ },
1210
+ "headers": {...},
1211
+ "status_code": ...
1212
+ }
1213
+ ```
1214
+
1215
+ </details>
1216
+
1217
+ <details>
1218
+ <summary>CaseRecordsAPI</summary>
1219
+ Manage case records.
1220
+
1221
+ ### Methods
1222
+
1223
+ | **Method** | **Description** |
1224
+ |----------------|------------------------------------------------|
1225
+ | `create` | Add an existing record to a case. |
1226
+ | `get` | Retrieve a single record attached to a case. |
1227
+ | `list` | Retrieve a list of records attached to a case. |
1228
+ | `delete` | Remove a record from a case. |
1229
+
1230
+ ### Subclasses
1231
+ - **None**
1232
+
1233
+ ### Usage:
1234
+
1235
+ ```python
1236
+ from json import dumps
1237
+ from tapi import CaseRecordsAPI
1238
+
1239
+ def main():
1240
+ DOMAIN = "my-cool-domain-1234"
1241
+ API_KEY = "do_not_put_this_on_github_lol"
1242
+
1243
+ case_records_api = CaseRecordsAPI(DOMAIN, API_KEY)
1244
+
1245
+ records = case_records_api.list(case_id=1234)
1246
+
1247
+ print(dumps(records, indent = 4))
1248
+ ```
1249
+ ```json5
1250
+ {
1251
+ "body": {
1252
+ "case_id": 1234,
1253
+ "records": [
1254
+ {
1255
+ "record_type_id": 1419,
1256
+ "record_type_name": "My Record Type",
1257
+ "record_type_record_results": [...]
1258
+ },
1259
+ //...[snip]...//
1260
+ ],
1261
+ //...[snip]...//
1262
+ },
1263
+ "headers": {...},
1264
+ "status_code": ...
1265
+ }
1266
+ ```
1267
+
1268
+ </details>
1269
+
1270
+ <details>
1271
+ <summary>CaseSubscribersAPI</summary>
1272
+ Manage case records.
1273
+
1274
+ ### Methods
1275
+
1276
+ | **Method** | **Description** |
1277
+ |----------------|-------------------------------------------|
1278
+ | `create` | Subscribe to a case. |
1279
+ | `list` | Retrieve a list of subscribers of a case. |
1280
+ | `delete` | Unsubscribe from a case. |
1281
+ | `batch_create` | Batch subscribe users to a case. |
1282
+
1283
+ ### Subclasses
1284
+ - **None**
1285
+
1286
+ ### Usage:
1287
+
1288
+ ```python
1289
+ from json import dumps
1290
+ from tapi import CaseSubscribersAPI
1291
+
1292
+ def main():
1293
+ DOMAIN = "my-cool-domain-1234"
1294
+ API_KEY = "do_not_put_this_on_github_lol"
1295
+
1296
+ case_subs_api = CaseSubscribersAPI(DOMAIN, API_KEY)
1297
+
1298
+ subscribers = case_subs_api.list(case_id=1234)
1299
+
1300
+ print(dumps(subscribers, indent = 4))
1301
+ ```
1302
+ ```json5
1303
+ {
1304
+ "body": {
1305
+ "case_id": 1234,
1306
+ "subscribers": [
1307
+ {
1308
+ "user_id": "6866",
1309
+ "first_name": "John",
1310
+ "last_name": "Doe",
1311
+ "email": "john@doe.io",
1312
+ "avatar_url": "https://www.gravatar.com/avatar/aaaabbbbccccddddeeeeffffgggghhhh",
1313
+ "id": 2231
1314
+ }
1315
+ ],
1316
+ //...[snip]...//
1317
+ },
1318
+ "headers": {...},
1319
+ "status_code": ...
1320
+ }
1321
+ ```
1322
+
1323
+ </details>
1324
+
1325
+ <details>
1326
+ <summary>CaseBlocksAPI</summary>
1327
+ Manage case blocks.
1328
+
1329
+ ### Methods
1330
+
1331
+ | **Method** | **Description** |
1332
+ |----------------|---------------------------------------|
1333
+ | `create` | Add a block to a case. |
1334
+ | `get` | Retrieve a single block for a case. |
1335
+ | `update` | Update an existing block. |
1336
+ | `list` | Retrieve a list of blocks for a case. |
1337
+ | `delete` | Delete a block from a case. |
1338
+
1339
+ ### Subclasses
1340
+
1341
+ | **Path** | **Class** | **Description** |
1342
+ |-----------------------------------|------------------------|------------------------------|
1343
+ | `TenantAPI.cases.blocks.elements` | `CaseBlockElementsAPI` | Manage case blocks elements. |
1344
+
1345
+ ### Usage:
1346
+
1347
+ ```python
1348
+ from json import dumps
1349
+ from tapi import CaseBlocksAPI
1350
+
1351
+ def main():
1352
+ DOMAIN = "my-cool-domain-1234"
1353
+ API_KEY = "do_not_put_this_on_github_lol"
1354
+
1355
+ case_blocks_api = CaseBlocksAPI(DOMAIN, API_KEY)
1356
+
1357
+ blocks = case_blocks_api.list(case_id = 1234)
1358
+
1359
+ print(dumps(blocks, indent = 4))
1360
+ ```
1361
+ ```json5
1362
+ {
1363
+ "body": {
1364
+ "blocks": [...],
1365
+ //...[snip]...//
1366
+ },
1367
+ "headers": {...},
1368
+ "status_code": ...
1369
+ }
1370
+ ```
1371
+
1372
+ </details>
1373
+
1374
+ <details>
1375
+ <summary>CaseBlockElementsAPI</summary>
1376
+ Manage case block elements.
1377
+
1378
+ ### Methods
1379
+
1380
+ | **Method** | **Description** |
1381
+ |----------------|---------------------------------------|
1382
+ | `get` | Retrieve a single block for a case. |
1383
+ | `update` | Update an existing block. |
1384
+
1385
+ ### Subclasses
1386
+ - **None**
1387
+
1388
+ ### Usage:
1389
+
1390
+ ```python
1391
+ from json import dumps
1392
+ from tapi import CaseBlockElementsAPI
1393
+
1394
+ def main():
1395
+ DOMAIN = "my-cool-domain-1234"
1396
+ API_KEY = "do_not_put_this_on_github_lol"
1397
+
1398
+ case_blocks_elements_api = CaseBlockElementsAPI(DOMAIN, API_KEY)
1399
+
1400
+ element = case_blocks_elements_api.get(
1401
+ case_id = 123,
1402
+ block_id = 456,
1403
+ element_id = 789
1404
+ )
1405
+
1406
+ print(dumps(element, indent = 4))
1407
+ ```
1408
+ ```json5
1409
+ {
1410
+ "body": {
1411
+ "element_id": 789,
1412
+ "id": 456,
1413
+ "element_type": "note",
1414
+ //...[snip]...//
1415
+ },
1416
+ "headers": {...},
1417
+ "status_code": ...
1418
+ }
1419
+ ```
1420
+
1421
+ </details>
1422
+
1423
+ <details>
1424
+ <summary>ActionsAPI</summary>
1425
+ Manage actions.
1426
+
1427
+ ### Methods
1428
+
1429
+ | **Method** | **Description** |
1430
+ |----------------|----------------------------------------|
1431
+ | `create` | Create action. |
1432
+ | `get` | Retrieve details of a specific action. |
1433
+ | `update` | Update an action. |
1434
+ | `list` | Retrieve a list of actions. |
1435
+ | `delete` | Delete a specific action. |
1436
+ | `clear_memory` | Clears action memory. |
1437
+
1438
+ ### Subclasses
1439
+
1440
+ | **Path** | **Class** | **Description** |
1441
+ |------------------------------------|-------------------|-----------------------|
1442
+ | `TenantAPI.stories.actions.logs` | `ActionLogsAPI` | Manage action logs. |
1443
+ | `TenantAPI.stories.actions.events` | `ActionEventsAPI` | Manage action events. |
1444
+
1445
+
1446
+ ### Usage:
1447
+
1448
+ ```python
1449
+ from json import dumps
1450
+ from tapi import ActionsAPI
1451
+
1452
+ def main():
1453
+ DOMAIN = "my-cool-domain-1234"
1454
+ API_KEY = "do_not_put_this_on_github_lol"
1455
+
1456
+ actions_api = ActionsAPI(DOMAIN, API_KEY)
1457
+
1458
+ actions = actions_api.list(story_id=1234)
1459
+
1460
+ print(dumps(actions, indent = 4))
1461
+ ```
1462
+ ```json5
1463
+ {
1464
+ "body": {
1465
+ "agents": [
1466
+ {
1467
+ "id": 111111,
1468
+ "type": "Agents::EventTransformationAgent",
1469
+ "user_id": 6866,
1470
+ "options": {
1471
+ "mode": "message_only",
1472
+ "loop": false,
1473
+ "payload": {
1474
+ "message": "This is an automatically generated message from Tines"
1475
+ }
1476
+ },
1477
+ "name": "My Action"
1478
+ //...[snip]...//
1479
+ }
1480
+ ],
1481
+ //...[snip]...//
1482
+ },
1483
+ "headers": {...},
1484
+ "status_code": ...
1485
+ }
1486
+ ```
1487
+
1488
+ </details>
1489
+
1490
+ <details>
1491
+ <summary>ActionEventsAPI</summary>
1492
+ Manage action events.
1493
+
1494
+ ### Methods
1495
+
1496
+ | **Method** | **Description** |
1497
+ |----------------|----------------------------------------------------------|
1498
+ | `list` | Retrieve a list of events emitted by a specified action. |
1499
+ | `delete` | Delete all events emitted by a specific action. |
1500
+
1501
+ ### Subclasses
1502
+ - **None**
1503
+
1504
+ ### Usage:
1505
+
1506
+ ```python
1507
+ from json import dumps
1508
+ from tapi import ActionEventsAPI
1509
+
1510
+ def main():
1511
+ DOMAIN = "my-cool-domain-1234"
1512
+ API_KEY = "do_not_put_this_on_github_lol"
1513
+
1514
+ action_events_api = ActionEventsAPI(DOMAIN, API_KEY)
1515
+
1516
+ events = action_events_api.list(action_id=1234)
1517
+
1518
+ print(dumps(events, indent = 4))
1519
+ ```
1520
+ ```json5
1521
+ {
1522
+ "body": {
1523
+ "agents":[...],
1524
+ //...[snip]...//
1525
+ },
1526
+ "headers": {...},
1527
+ "status_code": ...
1528
+ }
1529
+ ```
1530
+
1531
+ </details>
1532
+
1533
+ <details>
1534
+ <summary>ActionLogsAPI</summary>
1535
+ Manage action logs.
1536
+
1537
+ ### Methods
1538
+
1539
+ | **Method** | **Description** |
1540
+ |----------------|-----------------------------------------------|
1541
+ | `list` | List all logs emitted by a specific action. |
1542
+ | `delete` | Delete all logs emitted by a specific action. |
1543
+
1544
+ ### Subclasses
1545
+ - **None**
1546
+
1547
+ ### Usage:
1548
+
1549
+ ```python
1550
+ from json import dumps
1551
+ from tapi import ActionLogsAPI
1552
+
1553
+ def main():
1554
+ DOMAIN = "my-cool-domain-1234"
1555
+ API_KEY = "do_not_put_this_on_github_lol"
1556
+
1557
+ action_logs_api = ActionLogsAPI(DOMAIN, API_KEY)
1558
+
1559
+ logs = action_logs_api.list(action_id=1234)
1560
+
1561
+ print(dumps(logs, indent = 4))
1562
+ ```
1563
+ ```json5
1564
+ {
1565
+ "body": {
1566
+ "action_logs":[...],
1567
+ //...[snip]...//
1568
+ },
1569
+ "headers": {...},
1570
+ "status_code": ...
1571
+ }
1572
+ ```
1573
+
1574
+ </details>
1575
+
1576
+ <details>
1577
+ <summary>NotesAPI</summary>
1578
+ Manage story notes.
1579
+
1580
+ ### Methods
1581
+
1582
+ | **Method** | **Description** |
1583
+ |------------|----------------------------------|
1584
+ | `create` | Create a note on the storyboard. |
1585
+ | `get` | Retrieve a note. |
1586
+ | `update` | Update a note. |
1587
+ | `list` | List notes. |
1588
+ | `delete` | Delete a note. |
1589
+
1590
+ ### Subclasses
1591
+ - **None**
1592
+
1593
+ ### Usage:
1594
+
1595
+ ```python
1596
+ from json import dumps
1597
+ from tapi import NotesAPI
1598
+
1599
+ def main():
1600
+ DOMAIN = "my-cool-domain-1234"
1601
+ API_KEY = "do_not_put_this_on_github_lol"
1602
+
1603
+ notes_api = NotesAPI(DOMAIN, API_KEY)
1604
+
1605
+ notes = notes_api.list()
1606
+
1607
+ print(dumps(notes, indent = 4))
1608
+ ```
1609
+ ```json5
1610
+ {
1611
+ "body": {
1612
+ "annotations":[...],
1613
+ //...[snip]...//
1614
+ },
1615
+ "headers": {...},
1616
+ "status_code": ...
1617
+ }
1618
+ ```
1619
+
1620
+ </details>
1621
+
1622
+ <details>
1623
+ <summary>AuditLogsAPI</summary>
1624
+ Pull tenant audit logs.
1625
+
1626
+ ### Methods
1627
+
1628
+ | **Method** | **Description** |
1629
+ |------------|--------------------------------------------------------------|
1630
+ | `list` | Returns a list of audit logs gathered from the Tines tenant. |
1631
+
1632
+ ### Subclasses
1633
+ - **None**
1634
+
1635
+ ### Usage:
1636
+
1637
+ ```python
1638
+ from json import dumps
1639
+ from tapi import AuditLogsAPI
1640
+ from tapi.utils.types import AuditLogType
1641
+
1642
+
1643
+ def main():
1644
+ DOMAIN = "my-cool-domain-1234"
1645
+ API_KEY = "do_not_put_this_on_github_lol"
1646
+
1647
+ audit_logs_api = AuditLogsAPI(DOMAIN, API_KEY)
1648
+
1649
+ logs = audit_logs_api.list(
1650
+ operation_name=[
1651
+ AuditLogType.STORY_CREATION
1652
+ ]
1653
+ )
1654
+
1655
+ print(dumps(logs, indent=4))
1656
+ ```
1657
+ ```json5
1658
+ {
1659
+ "body": {
1660
+ "audit_logs":[...],
1661
+ //...[snip]...//
1662
+ },
1663
+ "headers": {...},
1664
+ "status_code": ...
1665
+ }
1666
+ ```
1667
+
1668
+ </details>
1669
+
1670
+
1671
+ <details>
1672
+ <summary>CredentialsAPI</summary>
1673
+ Manage tenant credentials
1674
+
1675
+ ### Methods
1676
+
1677
+ | **Method** | **Description** |
1678
+ |------------------------|------------------------------------|
1679
+ | `get` | Retrieve a credential. |
1680
+ | `update` | Update a credential. |
1681
+ | `list` | Retrieve a list of credentials. |
1682
+ | `delete` | Delete a credential. |
1683
+ | `create_aws` | Create a AWS credential. |
1684
+ | `create_http_request` | Create a HTTP Request credential. |
1685
+ | `create_jwt` | Create a JWT credential. |
1686
+ | `create_mtls` | Create a MTLS credential. |
1687
+ | `create_multi_request` | Create a Multi Request credential. |
1688
+ | `create_oauth` | Create a OAUTH credential. |
1689
+ | `create_text` | Create a TEXT credential. |
1690
+
1691
+ ### Subclasses
1692
+ - **None**
1693
+
1694
+ ### Usage:
1695
+
1696
+ ```python
1697
+ from json import dumps
1698
+ from tapi import CredentialsAPI
1699
+
1700
+
1701
+ def main():
1702
+ DOMAIN = "my-cool-domain-1234"
1703
+ API_KEY = "do_not_put_this_on_github_lol"
1704
+
1705
+ credentials_api = CredentialsAPI(DOMAIN, API_KEY)
1706
+
1707
+ creds = credentials_api.list()
1708
+
1709
+ print(dumps(creds, indent=4))
1710
+ ```
1711
+ ```json5
1712
+ {
1713
+ "body": {
1714
+ "user_credentials":[...],
1715
+ //...[snip]...//
1716
+ },
1717
+ "headers": {...},
1718
+ "status_code": ...
1719
+ }
1720
+ ```
1721
+
1722
+ </details>
1723
+
1724
+
1725
+ <details>
1726
+ <summary>EventsAPI</summary>
1727
+ Manage tenant-wide action events
1728
+
1729
+ ### Methods
1730
+
1731
+ | **Method** | **Description** |
1732
+ |------------|----------------------------|
1733
+ | `get` | Retrieve an event. |
1734
+ | `list` | Retrieve a list of events. |
1735
+ | `re_emit` | Re‑emit an event. |
1736
+
1737
+ ### Subclasses
1738
+ - **None**
1739
+
1740
+ ### Usage:
1741
+
1742
+ ```python
1743
+ from json import dumps
1744
+ from tapi import EventsAPI
1745
+
1746
+
1747
+ def main():
1748
+ DOMAIN = "my-cool-domain-1234"
1749
+ API_KEY = "do_not_put_this_on_github_lol"
1750
+
1751
+ events_api = EventsAPI(DOMAIN, API_KEY)
1752
+
1753
+ events = events_api.list()
1754
+
1755
+ print(dumps(events, indent=4))
1756
+ ```
1757
+ ```json5
1758
+ {
1759
+ "body": {
1760
+ "events":[...],
1761
+ //...[snip]...//
1762
+ },
1763
+ "headers": {...},
1764
+ "status_code": ...
1765
+ }
1766
+ ```
1767
+
1768
+ </details>
1769
+
1770
+
1771
+ <details>
1772
+ <summary>FoldersAPI</summary>
1773
+ Manage folders
1774
+
1775
+ ### Methods
1776
+
1777
+ | **Method** | **Description** |
1778
+ |------------|-----------------------------|
1779
+ | `create` | Create a folder. |
1780
+ | `get` | Retrieve a single folder. |
1781
+ | `udpate` | Update a folder. |
1782
+ | `list` | Retrieve a list of folders. |
1783
+ | `delete` | Delete a folder. |
1784
+
1785
+ ### Subclasses
1786
+ - **None**
1787
+
1788
+ ### Usage:
1789
+
1790
+ ```python
1791
+ from json import dumps
1792
+ from tapi import FoldersAPI
1793
+
1794
+
1795
+ def main():
1796
+ DOMAIN = "my-cool-domain-1234"
1797
+ API_KEY = "do_not_put_this_on_github_lol"
1798
+
1799
+ folders_api = FoldersAPI(DOMAIN, API_KEY)
1800
+
1801
+ folders = folders_api.list()
1802
+
1803
+ print(dumps(folders, indent=4))
1804
+ ```
1805
+ ```json5
1806
+ {
1807
+ "body": {
1808
+ "folders":[...],
1809
+ //...[snip]...//
1810
+ },
1811
+ "headers": {...},
1812
+ "status_code": ...
1813
+ }
1814
+ ```
1815
+
1816
+ </details>
1817
+
1818
+
1819
+ <details>
1820
+ <summary>ResourcesAPI</summary>
1821
+ Manage resources
1822
+
1823
+ ### Methods
1824
+
1825
+ | **Method** | **Description** |
1826
+ |-------------------|--------------------------------------------------------------------------------|
1827
+ | `create` | Create a resource (text or json). |
1828
+ | `get` | Retrieve a resource. |
1829
+ | `udpate` | Update a resource. |
1830
+ | `list` | Retrieve a list of resources. |
1831
+ | `delete` | Delete a resource. |
1832
+ | `remove_element` | Remove a top level element from an array or key from an object in a resource. |
1833
+ | `append_element` | Append a string or an array to a resource. |
1834
+ | `replace_element` | Replace a top level element from an array or key from an object in a resource. |
1835
+
1836
+ ### Subclasses
1837
+ - **None**
1838
+
1839
+ ### Usage:
1840
+
1841
+ ```python
1842
+ from json import dumps
1843
+ from tapi import ResourcesAPI
1844
+
1845
+
1846
+ def main():
1847
+ DOMAIN = "my-cool-domain-1234"
1848
+ API_KEY = "do_not_put_this_on_github_lol"
1849
+
1850
+ resources_api = ResourcesAPI(DOMAIN, API_KEY)
1851
+
1852
+ resources = resources_api.list()
1853
+
1854
+ print(dumps(resources, indent=4))
1855
+ ```
1856
+ ```json5
1857
+ {
1858
+ "body": {
1859
+ "global_resources":[...],
1860
+ //...[snip]...//
1861
+ },
1862
+ "headers": {...},
1863
+ "status_code": ...
1864
+ }
1865
+ ```
1866
+
1867
+ </details>
1868
+
1869
+ <details>
1870
+ <summary>RecordsAPI</summary>
1871
+ Manage records.
1872
+
1873
+ ### Methods
1874
+
1875
+ | **Method** | **Description** |
1876
+ |----------------|-----------------------------|
1877
+ | `create` | Create record. |
1878
+ | `get` | Retrieve a single record. |
1879
+ | `update` | Updates a single record. |
1880
+ | `list` | Retrieve a list of records. |
1881
+ | `delete` | Delete a record. |
1882
+
1883
+
1884
+ ### Subclasses
1885
+
1886
+ | **Path** | **Class** | **Description** |
1887
+ |-------------------------------|----------------------|---------------------------|
1888
+ | `TenantAPI.records.types` | `RecordTypesAPI` | Manage record types. |
1889
+ | `TenantAPI.records.artifacts` | `RecordArtifactsAPI` | Manage records artifacts. |
1890
+
1891
+
1892
+ ### Usage:
1893
+
1894
+ ```python
1895
+ from json import dumps
1896
+ from tapi import RecordsAPI
1897
+
1898
+ def main():
1899
+ DOMAIN = "my-cool-domain-1234"
1900
+ API_KEY = "do_not_put_this_on_github_lol"
1901
+
1902
+ records_api = RecordsAPI(DOMAIN, API_KEY)
1903
+
1904
+ records = records_api.list(record_type_id=1234)
1905
+
1906
+ print(dumps(records, indent = 4))
1907
+ ```
1908
+ ```json5
1909
+ {
1910
+ "body": {
1911
+ "record_results": [...],
1912
+ //...[snip]...//
1913
+ },
1914
+ "headers": {...},
1915
+ "status_code": ...
1916
+ }
1917
+ ```
1918
+
1919
+ </details>
1920
+
1921
+ <details>
1922
+ <summary>RecordTypesAPI</summary>
1923
+ Manage record types
1924
+
1925
+ ### Methods
1926
+
1927
+ | **Method** | **Description** |
1928
+ |-------------------|----------------------------------|
1929
+ | `create` | Create a new record type. |
1930
+ | `get` | Retrieve a single record type. |
1931
+ | `list` | Retrieve a list of record types. |
1932
+ | `delete` | Delete a record type. |
1933
+
1934
+ ### Subclasses
1935
+ - **None**
1936
+
1937
+ ### Usage:
1938
+
1939
+ ```python
1940
+ from json import dumps
1941
+ from tapi import RecordTypesAPI
1942
+
1943
+
1944
+ def main():
1945
+ DOMAIN = "my-cool-domain-1234"
1946
+ API_KEY = "do_not_put_this_on_github_lol"
1947
+
1948
+ record_types_api = RecordTypesAPI(DOMAIN, API_KEY)
1949
+
1950
+ record_types = record_types_api.list(team_id=1234)
1951
+
1952
+ print(dumps(record_types, indent=4))
1953
+ ```
1954
+ ```json5
1955
+ {
1956
+ "body": {
1957
+ "record_types":[...],
1958
+ //...[snip]...//
1959
+ },
1960
+ "headers": {...},
1961
+ "status_code": ...
1962
+ }
1963
+ ```
1964
+
1965
+ </details>
1966
+
1967
+ <details>
1968
+ <summary>RecordArtifactsAPI</summary>
1969
+ Pull record artifacts.
1970
+
1971
+ ### Methods
1972
+
1973
+ | **Method** | **Description** |
1974
+ |-------------------|-----------------------------------------|
1975
+ | `get` | Retrieve an individual record artifact. |
1976
+
1977
+ ### Subclasses
1978
+ - **None**
1979
+
1980
+ ### Usage:
1981
+
1982
+ ```python
1983
+ from json import dumps
1984
+ from tapi import RecordArtifactsAPI
1985
+
1986
+
1987
+ def main():
1988
+ DOMAIN = "my-cool-domain-1234"
1989
+ API_KEY = "do_not_put_this_on_github_lol"
1990
+
1991
+ record_artifacts_api = RecordArtifactsAPI(DOMAIN, API_KEY)
1992
+
1993
+ record_artifacts = record_artifacts_api.get(record_id = 1234, artifact_id = 5678)
1994
+
1995
+ print(dumps(record_artifacts, indent=4))
1996
+ ```
1997
+ ```json5
1998
+ {
1999
+ "body": {
2000
+ "id": 1,
2001
+ "value": "artifact value",
2002
+ "record_field": {
2003
+ "id": 1,
2004
+ "name": "record field name"
2005
+ },
2006
+ "created_at": "2024-02-16T15:37:39Z",
2007
+ "updated_at": "2024-02-16T15:37:39Z"
2008
+ //...[snip]...//
2009
+ },
2010
+ "headers": {...},
2011
+ "status_code": ...
2012
+ }
2013
+ ```
2014
+
2015
+ </details>
2016
+
2017
+ <details>
2018
+ <summary>ReportingAPI</summary>
2019
+ Get action performance and time saved metrics
2020
+
2021
+ ### Methods
2022
+
2023
+ | **Method** | **Description** |
2024
+ |----------------------|---------------------------------------------------------------|
2025
+ | `action_performance` | Returns action performance in Tines. |
2026
+ | `time_saved` | Returns timed and dated records of time saved by using Tines. |
2027
+
2028
+ ### Subclasses
2029
+ - **None**
2030
+
2031
+ ### Usage:
2032
+
2033
+ ```python
2034
+ from json import dumps
2035
+ from tapi import ReportingAPI
2036
+
2037
+
2038
+ def main():
2039
+ DOMAIN = "my-cool-domain-1234"
2040
+ API_KEY = "do_not_put_this_on_github_lol"
2041
+
2042
+ reporting_api = ReportingAPI(DOMAIN, API_KEY)
2043
+
2044
+ action_performance = reporting_api.action_performance()
2045
+
2046
+ print(dumps(action_performance, indent=4))
2047
+ ```
2048
+ ```json5
2049
+ {
2050
+ "body": {
2051
+ "action_performance": []
2052
+ //...[snip]...//
2053
+ },
2054
+ "headers": {...},
2055
+ "status_code": ...
2056
+ }
2057
+ ```
2058
+
2059
+ </details>
2060
+
2061
+ <details>
2062
+ <summary>AdminAPI</summary>
2063
+ Manage tenant through admin endpoint
2064
+
2065
+ ### Methods
2066
+
2067
+ | **Method** | **Description** |
2068
+ |------------------------------------|------------------------------------------------------------------------------------------|
2069
+ | `set_custom_certificate_authority` | Set a custom certificate authority for use by all of your IMAP and HTTP Request actions. |
2070
+ | `tunnel_health` | Retrieve the health status of tunnels. |
2071
+
2072
+ ### Subclasses
2073
+
2074
+ | **Path** | **Class** | **Description** |
2075
+ |-------------------------------------------|-------------------------------|-----------------------------------------|
2076
+ | `TenantAPI.admin.jobs` | `JobsAPI` | Manage tenant jobs. (Self Hosted Only) |
2077
+ | `TenantAPI.admin.users` | `UsersAPI` | Manage tenant-wide users. |
2078
+ | `TenantAPI.admin.templates` | `TemplatesAPI` | Manage templates. |
2079
+ | `TenantAPI.admin.ip_access_control` | `IpAccessControlAPI` | Manage IP access control. |
2080
+ | `TenantAPI.admin.scim_user_group_mapping` | `SCIMUserGroupMappingAPI` | Manage SCIM user group mappings. |
2081
+ | `TenantAPI.admin.egress_rules` | `ActionEgressControlRulesAPI` | Manage egress rules. (Self Hosted Only) |
2082
+
2083
+
2084
+ ### Usage:
2085
+
2086
+ ```python
2087
+ from json import dumps
2088
+ from tapi import AdminAPI
2089
+
2090
+
2091
+ def main():
2092
+ DOMAIN = "my-cool-domain-1234"
2093
+ API_KEY = "do_not_put_this_on_github_lol"
2094
+
2095
+ admin_api = AdminAPI(DOMAIN, API_KEY)
2096
+
2097
+ set_sert = admin_api.set_custom_certificate_authority(
2098
+ name = "default",
2099
+ certificate = "<PEM encoded X.509 certificate>"
2100
+ )
2101
+
2102
+ print(dumps(set_sert, indent=4))
2103
+ ```
2104
+ ```json5
2105
+ {
2106
+ "body": "",
2107
+ "headers": {...},
2108
+ "status_code": 200
2109
+ }
2110
+ ```
2111
+
2112
+ </details>
2113
+
2114
+ <details>
2115
+ <summary>ActionEgressControlRulesAPI</summary>
2116
+ Manage egress control rules (Self Hosted Only)
2117
+
2118
+ ### Methods
2119
+
2120
+ | **Method** | **Description** |
2121
+ |------------|--------------------------------------------------|
2122
+ | `create` | Create a new Action egress control rule. |
2123
+ | `get` | Get an Action egress control rule by ID. |
2124
+ | `update` | Update an existing action egress control rule. |
2125
+ | `list` | List Action egress control rules for the tenant. |
2126
+ | `delete` | Delete an existing Action egress control rule. |
2127
+
2128
+ ### Subclasses
2129
+ - **None**
2130
+
2131
+ ### Usage:
2132
+
2133
+ ```python
2134
+ from json import dumps
2135
+ from tapi import ActionEgressControlRulesAPI
2136
+
2137
+
2138
+ def main():
2139
+ DOMAIN = "my-cool-domain-1234"
2140
+ API_KEY = "do_not_put_this_on_github_lol"
2141
+
2142
+ egress_con_api = ActionEgressControlRulesAPI(DOMAIN, API_KEY)
2143
+
2144
+ controls = egress_con_api.list()
2145
+
2146
+ print(dumps(controls, indent=4))
2147
+ ```
2148
+ ```json5
2149
+ {
2150
+ "body": {
2151
+ "admin/action_egress_control_rules": [],
2152
+ //...[snip]...//
2153
+ },
2154
+ "headers": {...},
2155
+ "status_code": ...
2156
+ }
2157
+ ```
2158
+
2159
+ </details>
2160
+
2161
+ <details>
2162
+ <summary>IpAccessControlAPI</summary>
2163
+ Manage tenant IP access rules
2164
+
2165
+ ### Methods
2166
+
2167
+ | **Method** | **Description** |
2168
+ |------------|----------------------------------------------|
2169
+ | `create` | Create a new IP access control rule. |
2170
+ | `get` | Get an IP access control rule by ID. |
2171
+ | `update` | Update an existing IP access control rule. |
2172
+ | `list` | List IP access control rules for the tenant. |
2173
+ | `delete` | Delete an existing IP access control rule. |
2174
+
2175
+ ### Subclasses
2176
+ - **None**
2177
+
2178
+ ### Usage:
2179
+
2180
+ ```python
2181
+ from json import dumps
2182
+ from tapi import IpAccessControlAPI
2183
+
2184
+
2185
+ def main():
2186
+ DOMAIN = "my-cool-domain-1234"
2187
+ API_KEY = "do_not_put_this_on_github_lol"
2188
+
2189
+ ip_acc_con_api = IpAccessControlAPI(DOMAIN, API_KEY)
2190
+
2191
+ ip_rules = ip_acc_con_api.list()
2192
+
2193
+ print(dumps(ip_rules, indent=4))
2194
+ ```
2195
+ ```json5
2196
+ {
2197
+ "body": {
2198
+ "admin/ip_access_control_rules": [],
2199
+ //...[snip]...//
2200
+ },
2201
+ "headers": {...},
2202
+ "status_code": ...
2203
+ }
2204
+ ```
2205
+
2206
+ </details>
2207
+
2208
+ <details>
2209
+ <summary>JobsAPI</summary>
2210
+ Manage tenant jobs. (Self Hosted Only)
2211
+
2212
+ ### Methods
2213
+
2214
+ | **Method** | **Description** |
2215
+ |----------------|-------------------------------------------------------------|
2216
+ | `list` | Retrieve a list of dead, in progress, queued or retry jobs. |
2217
+ | `delete` | Delete all dead, queued or retry jobs. |
2218
+ | `delete_by_id` | Delete all dead, queued or retry jobs by action id. |
2219
+
2220
+
2221
+ ### Subclasses
2222
+ - **None**
2223
+
2224
+ ### Usage:
2225
+
2226
+ ```python
2227
+ from json import dumps
2228
+ from tapi import JobsAPI
2229
+
2230
+
2231
+ def main():
2232
+ DOMAIN = "my-cool-domain-1234"
2233
+ API_KEY = "do_not_put_this_on_github_lol"
2234
+
2235
+ jobs_api = JobsAPI(DOMAIN, API_KEY)
2236
+
2237
+ jobs = jobs_api.list(job_type = "dead")
2238
+
2239
+ print(dumps(jobs, indent=4))
2240
+ ```
2241
+ ```json5
2242
+ {
2243
+ "body": {
2244
+ "admin/dead_jobs": [],
2245
+ //...[snip]...//
2246
+ },
2247
+ "headers": {...},
2248
+ "status_code": ...
2249
+ }
2250
+ ```
2251
+
2252
+ </details>
2253
+
2254
+ <details>
2255
+ <summary>SCIMUserGroupMappingAPI</summary>
2256
+ Manage SCIM user group mappings.
2257
+
2258
+ ### Methods
2259
+
2260
+ | **Method** | **Description** |
2261
+ |------------|----------------------------------------------------|
2262
+ | `list` | Get the SCIM user group mappings for the tenant. |
2263
+ | `update` | Update the SCIM user group mapping for the tenant. |
2264
+
2265
+ ### Subclasses
2266
+ - **None**
2267
+
2268
+ ### Usage:
2269
+
2270
+ ```python
2271
+ from json import dumps
2272
+ from tapi import SCIMUserGroupMappingAPI
2273
+
2274
+
2275
+ def main():
2276
+ DOMAIN = "my-cool-domain-1234"
2277
+ API_KEY = "do_not_put_this_on_github_lol"
2278
+
2279
+ scim_api = SCIMUserGroupMappingAPI(DOMAIN, API_KEY)
2280
+
2281
+ scim_groups = scim_api.list()
2282
+
2283
+ print(dumps(scim_groups, indent=4))
2284
+ ```
2285
+ ```json5
2286
+ {
2287
+ "body": {
2288
+ "mappings": [],
2289
+ //...[snip]...//
2290
+ },
2291
+ "headers": {...},
2292
+ "status_code": ...
2293
+ }
2294
+ ```
2295
+
2296
+ </details>
2297
+
2298
+ <details>
2299
+ <summary>TemplatesAPI</summary>
2300
+ Manage templates
2301
+
2302
+ ### Methods
2303
+
2304
+ | **Method** | **Description** |
2305
+ |------------|---------------------------------------|
2306
+ | `create` | Create a private template. |
2307
+ | `get` | Retrieve a private template. |
2308
+ | `update` | Update a private template. |
2309
+ | `list` | Retrieve a list of private templates. |
2310
+ | `delete` | Delete a private template by ID. |
2311
+
2312
+ ### Subclasses
2313
+ - **None**
2314
+
2315
+ ### Usage:
2316
+
2317
+ ```python
2318
+ from json import dumps
2319
+ from tapi import TemplatesAPI
2320
+
2321
+
2322
+ def main():
2323
+ DOMAIN = "my-cool-domain-1234"
2324
+ API_KEY = "do_not_put_this_on_github_lol"
2325
+
2326
+ templates_api = TemplatesAPI(DOMAIN, API_KEY)
2327
+
2328
+ templates = templates_api.list()
2329
+
2330
+ print(dumps(templates, indent=4))
2331
+ ```
2332
+ ```json5
2333
+ {
2334
+ "body": {
2335
+ "admin/templates": [],
2336
+ //...[snip]...//
2337
+ },
2338
+ "headers": {...},
2339
+ "status_code": ...
2340
+ }
2341
+ ```
2342
+
2343
+ </details>
2344
+
2345
+ <details>
2346
+ <summary>UsersAPI</summary>
2347
+ Manage tenant-wide users
2348
+
2349
+ ### Methods
2350
+
2351
+ | **Method** | **Description** |
2352
+ |---------------------|--------------------------------------------------------------------------------|
2353
+ | `create` | Create a user in a Tines tenant. |
2354
+ | `get` | Retrieve details of a specific user. |
2355
+ | `sign_in_activity` | Retrieve a list of sign-in activities by a specified user. |
2356
+ | `update` | Update a User. |
2357
+ | `list` | Retrieve a list of users from the Tines tenant. |
2358
+ | `delete` | Delete a specific user. |
2359
+ | `resend_invitation` | Resend platform invitation to specified user. |
2360
+ | `expire_session` | Expires a user’s session, signing them out of the Tines tenant on all devices. |
2361
+
2362
+ ### Subclasses
2363
+ - **None**
2364
+
2365
+ ### Usage:
2366
+
2367
+ ```python
2368
+ from json import dumps
2369
+ from tapi import UsersAPI
2370
+
2371
+
2372
+ def main():
2373
+ DOMAIN = "my-cool-domain-1234"
2374
+ API_KEY = "do_not_put_this_on_github_lol"
2375
+
2376
+ users_api = UsersAPI(DOMAIN, API_KEY)
2377
+
2378
+ users = users_api.list()
2379
+
2380
+ print(dumps(users, indent=4))
2381
+ ```
2382
+ ```json5
2383
+ {
2384
+ "body": {
2385
+ "admin/users": [],
2386
+ //...[snip]...//
2387
+ },
2388
+ "headers": {...},
2389
+ "status_code": ...
2390
+ }
2391
+ ```
2392
+
2393
+ </details>
2394
+
2395
+ <details>
2396
+ <summary>GroupsAPI</summary>
2397
+ Pull group actions events and logs
2398
+
2399
+ ### Methods
2400
+
2401
+ | **Method** | **Description** |
2402
+ |-------------------|--------------------------------------------|
2403
+ | `list_run_events` | Retrieve a list of events for a group run. |
2404
+ | `list_runs` | Retrieve a list of group runs. |
2405
+
2406
+
2407
+ ### Subclasses
2408
+ - **None**
2409
+
2410
+ ### Usage:
2411
+
2412
+ ```python
2413
+ from json import dumps
2414
+ from tapi import GroupsAPI
2415
+
2416
+
2417
+ def main():
2418
+ DOMAIN = "my-cool-domain-1234"
2419
+ API_KEY = "do_not_put_this_on_github_lol"
2420
+
2421
+ groups_api = GroupsAPI(DOMAIN, API_KEY)
2422
+
2423
+ events = groups_api.list_run_events(
2424
+ group_id = 1234,
2425
+ group_run_guid = "aaaabbbbccccddddeeeeffff"
2426
+ )
2427
+
2428
+ print(dumps(events, indent=4))
2429
+ ```
2430
+ ```json5
2431
+ {
2432
+ "body": {
2433
+ "group_run_events": [],
2434
+ //...[snip]...//
2435
+ },
2436
+ "headers": {...},
2437
+ "status_code": ...
2438
+ }
2439
+ ```
2440
+
2441
+ </details>
2442
+
2443
+ <details>
2444
+ <summary>DraftsAPI</summary>
2445
+ Manage story drafts
2446
+
2447
+ ### Methods
2448
+
2449
+ | **Method** | **Description** |
2450
+ |------------|----------------------------------------|
2451
+ | `create` | Create a new draft for a story. |
2452
+ | `list` | Retrieve a list of drafts for a story. |
2453
+ | `delete` | Delete a draft for a story. |
2454
+
2455
+
2456
+ ### Subclasses
2457
+ - **None**
2458
+
2459
+ ### Usage:
2460
+
2461
+ ```python
2462
+ from json import dumps
2463
+ from tapi import DraftsAPI
2464
+
2465
+
2466
+ def main():
2467
+ DOMAIN = "my-cool-domain-1234"
2468
+ API_KEY = "do_not_put_this_on_github_lol"
2469
+
2470
+ drafts_api = DraftsAPI(DOMAIN, API_KEY)
2471
+
2472
+ drafts = drafts_api.list(story_id = 1234)
2473
+
2474
+ print(dumps(drafts, indent=4))
2475
+ ```
2476
+ ```json5
2477
+ {
2478
+ "body": {
2479
+ "drafts": [],
2480
+ //...[snip]...//
2481
+ },
2482
+ "headers": {...},
2483
+ "status_code": ...
2484
+ }
2485
+ ```
2486
+
2487
+ </details>