truto-python-sdk 0.1.3__tar.gz → 0.1.4__tar.gz
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.
- truto_python_sdk-0.1.4/PKG-INFO +122 -0
- truto_python_sdk-0.1.4/README.md +104 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/pyproject.toml +1 -1
- truto_python_sdk-0.1.3/PKG-INFO +0 -80
- truto_python_sdk-0.1.3/README.md +0 -63
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/LICENSE +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/__init__.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/alarm.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/api_token.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/base_resource.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/batch_request.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/category.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/custom_api.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/daemon.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/daemon_job.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/daemon_job_cron_trigger.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/daemon_job_run.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/datastore.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/dict_to_query_string.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/documentation.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/environment.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/environment_integration.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/environment_integration_webhook.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/environment_unified_model.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/integrated_account.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/integrated_account_webhook.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/integration.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/link_token.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/log.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/mcp.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/pagination_result.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/proxy_api.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/sandbox_integrated_account.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/static_gate.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/sync_job.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/sync_job_cron_trigger.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/sync_job_run.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/team.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/truto_api.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/unified_api.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/unified_model.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/user.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/webhook.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/workflow.py +0 -0
- {truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/workflow_run.py +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: truto-python-sdk
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Python3 SDK for the Truto API
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: Roopendra Talekar
|
|
7
|
+
Author-email: roopendratalekar@gmail.com
|
|
8
|
+
Requires-Python: >=3.12,<4.0
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Requires-Dist: aiohttp (==3.12.14)
|
|
14
|
+
Requires-Dist: asyncio (==3.4.3)
|
|
15
|
+
Project-URL: Repository, https://github.com/trutohq/truto-python-sdk
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# truto-python-sdk
|
|
19
|
+
|
|
20
|
+
`truto-python-sdk` is a Python SDK to interact with the Truto API, a powerful integration platform for connecting multiple SaaS applications. The SDK mirrors the Truto REST API endpoints, which are documented in the Truto Postman Collection.
|
|
21
|
+
|
|
22
|
+
[](https://app.getpostman.com/run-collection/25523816-b3550004-776b-4372-be86-562791b192ce?action=collection%2Ffork&collection-url=entityId%3D25523816-b3550004-776b-4372-be86-562791b192ce%26entityType%3Dcollection%26workspaceId%3D7cc4fe33-eb97-4dc7-98b5-2a7ff2e94e67)
|
|
23
|
+
|
|
24
|
+
## Requires
|
|
25
|
+
|
|
26
|
+
Python 3.8+
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
Install the package via pip:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install truto-python-sdk
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import asyncio
|
|
40
|
+
from truto_python_sdk import TrutoApi
|
|
41
|
+
|
|
42
|
+
truto_api = TrutoApi(token="<your_api_token>")
|
|
43
|
+
|
|
44
|
+
async def main():
|
|
45
|
+
# Fetch all installed integrations for the environment
|
|
46
|
+
installed_integrations = truto_api.environment_integrations.list()
|
|
47
|
+
async for integration in installed_integrations:
|
|
48
|
+
print(integration)
|
|
49
|
+
|
|
50
|
+
# Fetch integrated accounts for a tenant
|
|
51
|
+
integrated_accounts = truto_api.integrated_accounts.list(tenant_id="acme-1")
|
|
52
|
+
print(await integrated_accounts.to_array())
|
|
53
|
+
|
|
54
|
+
# Make a request to the unified API
|
|
55
|
+
unified_cursor = truto_api.unified_api.list(
|
|
56
|
+
"accounting",
|
|
57
|
+
"accounts",
|
|
58
|
+
{
|
|
59
|
+
"integrated_account_id": "766cc1ee-6637-4aa1-a73e-a0c89ccc867c",
|
|
60
|
+
"created_at": "2023-05-01T00:00:00.000Z",
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
async for account in unified_cursor:
|
|
64
|
+
print(account)
|
|
65
|
+
|
|
66
|
+
unified_resource = await truto_api.unified_api.get(
|
|
67
|
+
"accounting",
|
|
68
|
+
"accounts",
|
|
69
|
+
"1",
|
|
70
|
+
{"integrated_account_id": "766cc1ee-6637-4aa1-a73e-a0c89ccc867c"},
|
|
71
|
+
)
|
|
72
|
+
print(unified_resource)
|
|
73
|
+
|
|
74
|
+
asyncio.run(main())
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## List Calls and Pagination
|
|
78
|
+
|
|
79
|
+
The SDK uses async iterators for list calls. This allows you to iterate through resources without manually handling pagination.
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
cursor = truto_api.unified_api.list(
|
|
83
|
+
"ticketing",
|
|
84
|
+
"tickets",
|
|
85
|
+
{"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
|
|
86
|
+
)
|
|
87
|
+
async for ticket in cursor:
|
|
88
|
+
print(ticket)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
You can also call `to_array()` to auto-paginate and collect all resources:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
tickets = await truto_api.unified_api.list(
|
|
95
|
+
"ticketing",
|
|
96
|
+
"tickets",
|
|
97
|
+
{"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
|
|
98
|
+
).to_array()
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Or fetch one page at a time with `next_page()`:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
page = await truto_api.unified_api.list(
|
|
105
|
+
"ticketing",
|
|
106
|
+
"tickets",
|
|
107
|
+
{"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
|
|
108
|
+
).next_page()
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Additional Endpoints
|
|
112
|
+
|
|
113
|
+
The SDK also includes endpoints for Custom API, MCP, Workflows, Workflow Runs, Alarms, Static Gates, Sandbox Integrated Accounts, and Webhooks. See full reference in [ADVANCED_USAGE.md](./ADVANCED_USAGE.md).
|
|
114
|
+
|
|
115
|
+
## Contributing
|
|
116
|
+
|
|
117
|
+
We welcome contributions to improve `truto-python-sdk`. Please submit issues or pull requests on the GitHub repository.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
|
122
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# truto-python-sdk
|
|
2
|
+
|
|
3
|
+
`truto-python-sdk` is a Python SDK to interact with the Truto API, a powerful integration platform for connecting multiple SaaS applications. The SDK mirrors the Truto REST API endpoints, which are documented in the Truto Postman Collection.
|
|
4
|
+
|
|
5
|
+
[](https://app.getpostman.com/run-collection/25523816-b3550004-776b-4372-be86-562791b192ce?action=collection%2Ffork&collection-url=entityId%3D25523816-b3550004-776b-4372-be86-562791b192ce%26entityType%3Dcollection%26workspaceId%3D7cc4fe33-eb97-4dc7-98b5-2a7ff2e94e67)
|
|
6
|
+
|
|
7
|
+
## Requires
|
|
8
|
+
|
|
9
|
+
Python 3.8+
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Install the package via pip:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install truto-python-sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
import asyncio
|
|
23
|
+
from truto_python_sdk import TrutoApi
|
|
24
|
+
|
|
25
|
+
truto_api = TrutoApi(token="<your_api_token>")
|
|
26
|
+
|
|
27
|
+
async def main():
|
|
28
|
+
# Fetch all installed integrations for the environment
|
|
29
|
+
installed_integrations = truto_api.environment_integrations.list()
|
|
30
|
+
async for integration in installed_integrations:
|
|
31
|
+
print(integration)
|
|
32
|
+
|
|
33
|
+
# Fetch integrated accounts for a tenant
|
|
34
|
+
integrated_accounts = truto_api.integrated_accounts.list(tenant_id="acme-1")
|
|
35
|
+
print(await integrated_accounts.to_array())
|
|
36
|
+
|
|
37
|
+
# Make a request to the unified API
|
|
38
|
+
unified_cursor = truto_api.unified_api.list(
|
|
39
|
+
"accounting",
|
|
40
|
+
"accounts",
|
|
41
|
+
{
|
|
42
|
+
"integrated_account_id": "766cc1ee-6637-4aa1-a73e-a0c89ccc867c",
|
|
43
|
+
"created_at": "2023-05-01T00:00:00.000Z",
|
|
44
|
+
},
|
|
45
|
+
)
|
|
46
|
+
async for account in unified_cursor:
|
|
47
|
+
print(account)
|
|
48
|
+
|
|
49
|
+
unified_resource = await truto_api.unified_api.get(
|
|
50
|
+
"accounting",
|
|
51
|
+
"accounts",
|
|
52
|
+
"1",
|
|
53
|
+
{"integrated_account_id": "766cc1ee-6637-4aa1-a73e-a0c89ccc867c"},
|
|
54
|
+
)
|
|
55
|
+
print(unified_resource)
|
|
56
|
+
|
|
57
|
+
asyncio.run(main())
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## List Calls and Pagination
|
|
61
|
+
|
|
62
|
+
The SDK uses async iterators for list calls. This allows you to iterate through resources without manually handling pagination.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
cursor = truto_api.unified_api.list(
|
|
66
|
+
"ticketing",
|
|
67
|
+
"tickets",
|
|
68
|
+
{"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
|
|
69
|
+
)
|
|
70
|
+
async for ticket in cursor:
|
|
71
|
+
print(ticket)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
You can also call `to_array()` to auto-paginate and collect all resources:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
tickets = await truto_api.unified_api.list(
|
|
78
|
+
"ticketing",
|
|
79
|
+
"tickets",
|
|
80
|
+
{"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
|
|
81
|
+
).to_array()
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Or fetch one page at a time with `next_page()`:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
page = await truto_api.unified_api.list(
|
|
88
|
+
"ticketing",
|
|
89
|
+
"tickets",
|
|
90
|
+
{"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
|
|
91
|
+
).next_page()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Additional Endpoints
|
|
95
|
+
|
|
96
|
+
The SDK also includes endpoints for Custom API, MCP, Workflows, Workflow Runs, Alarms, Static Gates, Sandbox Integrated Accounts, and Webhooks. See full reference in [ADVANCED_USAGE.md](./ADVANCED_USAGE.md).
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
We welcome contributions to improve `truto-python-sdk`. Please submit issues or pull requests on the GitHub repository.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|
truto_python_sdk-0.1.3/PKG-INFO
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: truto-python-sdk
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: Python3 SDK for the Truto API
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Author: Roopendra Talekar
|
|
7
|
-
Author-email: roopendratalekar@gmail.com
|
|
8
|
-
Requires-Python: >=3.12,<4.0
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
-
Requires-Dist: aiohttp (==3.12.14)
|
|
14
|
-
Requires-Dist: asyncio (==3.4.3)
|
|
15
|
-
Project-URL: Repository, https://github.com/trutohq/truto-python-sdk
|
|
16
|
-
Description-Content-Type: text/markdown
|
|
17
|
-
|
|
18
|
-
# truto-python-sdk
|
|
19
|
-
Python3 SDK for the Truto API. The SDK mirrors the Truto REST API endpoints which are documented in the Truto Postman Collection.
|
|
20
|
-
|
|
21
|
-
[](https://app.getpostman.com/run-collection/25523816-b3550004-776b-4372-be86-562791b192ce?action=collection%2Ffork&collection-url=entityId%3D25523816-b3550004-776b-4372-be86-562791b192ce%26entityType%3Dcollection%26workspaceId%3D7cc4fe33-eb97-4dc7-98b5-2a7ff2e94e67)
|
|
22
|
-
|
|
23
|
-
## Installation
|
|
24
|
-
```bash
|
|
25
|
-
pip install truto-python-sdk
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Usage
|
|
29
|
-
|
|
30
|
-
```python
|
|
31
|
-
import asyncio
|
|
32
|
-
from truto_python_sdk import TrutoApi
|
|
33
|
-
|
|
34
|
-
# Initialize the SDK with your token
|
|
35
|
-
truto_api = TrutoApi(token="<your_api_token>")
|
|
36
|
-
|
|
37
|
-
async def main():
|
|
38
|
-
async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
|
|
39
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
40
|
-
}):
|
|
41
|
-
print(await truto_api.proxy_api.get("ticketing-tickets", ticket["id"], {
|
|
42
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
43
|
-
}))
|
|
44
|
-
|
|
45
|
-
# Run the async function
|
|
46
|
-
asyncio.run(main())
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## List calls and pagination
|
|
50
|
-
|
|
51
|
-
The SDK uses async generators to handle list calls. This allows you to iterate over the results of a list call without having to worry about pagination. The SDK will automatically fetch the next page of results when needed.
|
|
52
|
-
|
|
53
|
-
```python
|
|
54
|
-
async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
|
|
55
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
56
|
-
}):
|
|
57
|
-
print(ticket)
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
You can also call `to_array()`, which will auto-paginate all the resources and return them as a list.
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
tickets = await truto_api.unified_api.list("ticketing", "tickets", {
|
|
64
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
65
|
-
}).to_array()
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Getting each page of results manually is also possible.
|
|
69
|
-
|
|
70
|
-
```python
|
|
71
|
-
page = await truto_api.unified_api.list("ticketing", "tickets", {
|
|
72
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
73
|
-
}).next_page()
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Contributing
|
|
77
|
-
We welcome contributions to improve `truto-python-sdk`. Please submit issues or pull requests on the GitHub repository.
|
|
78
|
-
|
|
79
|
-
## License
|
|
80
|
-
MIT
|
truto_python_sdk-0.1.3/README.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# truto-python-sdk
|
|
2
|
-
Python3 SDK for the Truto API. The SDK mirrors the Truto REST API endpoints which are documented in the Truto Postman Collection.
|
|
3
|
-
|
|
4
|
-
[](https://app.getpostman.com/run-collection/25523816-b3550004-776b-4372-be86-562791b192ce?action=collection%2Ffork&collection-url=entityId%3D25523816-b3550004-776b-4372-be86-562791b192ce%26entityType%3Dcollection%26workspaceId%3D7cc4fe33-eb97-4dc7-98b5-2a7ff2e94e67)
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
```bash
|
|
8
|
-
pip install truto-python-sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```python
|
|
14
|
-
import asyncio
|
|
15
|
-
from truto_python_sdk import TrutoApi
|
|
16
|
-
|
|
17
|
-
# Initialize the SDK with your token
|
|
18
|
-
truto_api = TrutoApi(token="<your_api_token>")
|
|
19
|
-
|
|
20
|
-
async def main():
|
|
21
|
-
async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
|
|
22
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
23
|
-
}):
|
|
24
|
-
print(await truto_api.proxy_api.get("ticketing-tickets", ticket["id"], {
|
|
25
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
26
|
-
}))
|
|
27
|
-
|
|
28
|
-
# Run the async function
|
|
29
|
-
asyncio.run(main())
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## List calls and pagination
|
|
33
|
-
|
|
34
|
-
The SDK uses async generators to handle list calls. This allows you to iterate over the results of a list call without having to worry about pagination. The SDK will automatically fetch the next page of results when needed.
|
|
35
|
-
|
|
36
|
-
```python
|
|
37
|
-
async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
|
|
38
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
39
|
-
}):
|
|
40
|
-
print(ticket)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
You can also call `to_array()`, which will auto-paginate all the resources and return them as a list.
|
|
44
|
-
|
|
45
|
-
```python
|
|
46
|
-
tickets = await truto_api.unified_api.list("ticketing", "tickets", {
|
|
47
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
48
|
-
}).to_array()
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Getting each page of results manually is also possible.
|
|
52
|
-
|
|
53
|
-
```python
|
|
54
|
-
page = await truto_api.unified_api.list("ticketing", "tickets", {
|
|
55
|
-
"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
|
|
56
|
-
}).next_page()
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Contributing
|
|
60
|
-
We welcome contributions to improve `truto-python-sdk`. Please submit issues or pull requests on the GitHub repository.
|
|
61
|
-
|
|
62
|
-
## License
|
|
63
|
-
MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/daemon_job_cron_trigger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/environment_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
{truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/environment_unified_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/integrated_account_webhook.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{truto_python_sdk-0.1.3 → truto_python_sdk-0.1.4}/truto_python_sdk/sandbox_integrated_account.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|