polytomic 0.1.0__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.
- polytomic-0.1.0/LICENSE +21 -0
- polytomic-0.1.0/PKG-INFO +78 -0
- polytomic-0.1.0/README.md +62 -0
- polytomic-0.1.0/pyproject.toml +22 -0
- polytomic-0.1.0/src/polytomic/__init__.py +241 -0
- polytomic-0.1.0/src/polytomic/client.py +86 -0
- polytomic-0.1.0/src/polytomic/core/__init__.py +17 -0
- polytomic-0.1.0/src/polytomic/core/api_error.py +15 -0
- polytomic-0.1.0/src/polytomic/core/client_wrapper.py +67 -0
- polytomic-0.1.0/src/polytomic/core/datetime_utils.py +28 -0
- polytomic-0.1.0/src/polytomic/core/jsonable_encoder.py +103 -0
- polytomic-0.1.0/src/polytomic/core/remove_none_from_dict.py +11 -0
- polytomic-0.1.0/src/polytomic/environment.py +7 -0
- polytomic-0.1.0/src/polytomic/errors/__init__.py +5 -0
- polytomic-0.1.0/src/polytomic/errors/unauthorized_error.py +9 -0
- polytomic-0.1.0/src/polytomic/py.typed +0 -0
- polytomic-0.1.0/src/polytomic/resources/__init__.py +19 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/__init__.py +5 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/client.py +1076 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/resources/__init__.py +5 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/resources/executions/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/resources/executions/client.py +269 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/resources/schemas/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/bulk_sync/resources/schemas/client.py +274 -0
- polytomic-0.1.0/src/polytomic/resources/connections/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/connections/client.py +1018 -0
- polytomic-0.1.0/src/polytomic/resources/events/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/events/client.py +210 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/__init__.py +6 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/client.py +976 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/resources/__init__.py +5 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/resources/executions/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/resources/executions/client.py +156 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/types/__init__.py +6 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/types/v_2_create_sync_request_mode.py +37 -0
- polytomic-0.1.0/src/polytomic/resources/model_sync/types/v_2_update_sync_request_mode.py +37 -0
- polytomic-0.1.0/src/polytomic/resources/models/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/models/client.py +561 -0
- polytomic-0.1.0/src/polytomic/resources/organization/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/organization/client.py +505 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/__init__.py +5 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/client.py +19 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/resources/__init__.py +5 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/resources/policies/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/resources/policies/client.py +432 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/resources/roles/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/permissions/resources/roles/client.py +363 -0
- polytomic-0.1.0/src/polytomic/resources/schemas/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/schemas/client.py +97 -0
- polytomic-0.1.0/src/polytomic/resources/users/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/users/client.py +525 -0
- polytomic-0.1.0/src/polytomic/resources/webhooks/__init__.py +2 -0
- polytomic-0.1.0/src/polytomic/resources/webhooks/client.py +429 -0
- polytomic-0.1.0/src/polytomic/types/__init__.py +209 -0
- polytomic-0.1.0/src/polytomic/types/bulk_schedule.py +33 -0
- polytomic-0.1.0/src/polytomic/types/label_label.py +5 -0
- polytomic-0.1.0/src/polytomic/types/rest_err_response.py +31 -0
- polytomic-0.1.0/src/polytomic/types/schema_association.py +31 -0
- polytomic-0.1.0/src/polytomic/types/sync_destination_properties.py +37 -0
- polytomic-0.1.0/src/polytomic/types/v_2_activate_sync_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_activate_sync_input.py +28 -0
- polytomic-0.1.0/src/polytomic/types/v_2_activate_sync_output.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_api_key_response.py +28 -0
- polytomic-0.1.0/src/polytomic/types/v_2_api_key_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_bulk_sync_dest.py +30 -0
- polytomic-0.1.0/src/polytomic/types/v_2_bulk_sync_dest_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_bulk_sync_list_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_bulk_sync_response.py +40 -0
- polytomic-0.1.0/src/polytomic/types/v_2_bulk_sync_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_configuration_value.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_list_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_meta.py +30 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_meta_response.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_response_schema.py +36 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_type.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_type_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_connection_type_schema.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_create_connection_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_create_connection_response_schema.py +40 -0
- polytomic-0.1.0/src/polytomic/types/v_2_event.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_2_event_types_envelope.py +28 -0
- polytomic-0.1.0/src/polytomic/types/v_2_events_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_execution_counts.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_filter.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_2_get_connection_meta_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_get_execution_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_get_execution_response_schema.py +36 -0
- polytomic-0.1.0/src/polytomic/types/v_2_get_identity_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_get_identity_response_schema.py +36 -0
- polytomic-0.1.0/src/polytomic/types/v_2_identity.py +33 -0
- polytomic-0.1.0/src/polytomic/types/v_2_identity_function.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_list_execution_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_list_policies_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_list_sync_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_list_users_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_mode.py +33 -0
- polytomic-0.1.0/src/polytomic/types/v_2_model_field.py +35 -0
- polytomic-0.1.0/src/polytomic/types/v_2_model_field_request.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_model_field_response.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_model_list_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_model_response.py +43 -0
- polytomic-0.1.0/src/polytomic/types/v_2_model_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_organization.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_2_organization_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_organizations_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_override.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_policy_action.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_policy_response.py +33 -0
- polytomic-0.1.0/src/polytomic/types/v_2_policy_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_relation.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_relation_to.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_role_list_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_role_response.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_role_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_run_after.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_schedule.py +35 -0
- polytomic-0.1.0/src/polytomic/types/v_2_source.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_start_sync_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_start_sync_response_schema.py +30 -0
- polytomic-0.1.0/src/polytomic/types/v_2_supported_mode.py +33 -0
- polytomic-0.1.0/src/polytomic/types/v_2_sync_field.py +33 -0
- polytomic-0.1.0/src/polytomic/types/v_2_sync_response.py +48 -0
- polytomic-0.1.0/src/polytomic/types/v_2_sync_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_sync_status_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_sync_status_response.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_target.py +33 -0
- polytomic-0.1.0/src/polytomic/types/v_2_target_field.py +40 -0
- polytomic-0.1.0/src/polytomic/types/v_2_target_response.py +36 -0
- polytomic-0.1.0/src/polytomic/types/v_2_target_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_user.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_2_user_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_webhook.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_2_webhook_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_2_webhook_list_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_field.py +30 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_schema.py +32 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_schema_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_execution.py +37 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_execution_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_schema_execution.py +35 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_source.py +30 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_source_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_source_schema_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_source_status.py +30 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_source_status_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_status_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_bulk_sync_status_response.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_3_connect_card_response.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_connect_card_response_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_list_bulk_schema_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_list_bulk_sync_executions_envelope.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_pick_value.py +29 -0
- polytomic-0.1.0/src/polytomic/types/v_3_schema.py +31 -0
- polytomic-0.1.0/src/polytomic/types/v_3_schema_field.py +35 -0
- polytomic-0.1.0/src/polytomic/types/v_3_schema_records_response_envelope.py +28 -0
polytomic-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Polytomic.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
polytomic-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: polytomic
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary:
|
|
5
|
+
Requires-Python: >=3.7,<4.0
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Requires-Dist: httpx (>=0.21.2)
|
|
13
|
+
Requires-Dist: pydantic (>=1.9.2,<2.5.0)
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
<!-- Begin Title, generated by Fern -->
|
|
17
|
+
# Polytomic Python Library
|
|
18
|
+
|
|
19
|
+
[](https://github.com/fern-api/fern)
|
|
20
|
+
|
|
21
|
+
The Polytomic Python Library provides convenient access to the Polytomic API from applications written in Python.
|
|
22
|
+
<!-- End Title -->
|
|
23
|
+
|
|
24
|
+
<!-- Begin Installation, generated by Fern -->
|
|
25
|
+
# Installation
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pip install --upgrade polytomic
|
|
29
|
+
```
|
|
30
|
+
<!-- End Installation -->
|
|
31
|
+
|
|
32
|
+
<!-- Begin Usage, generated by Fern -->
|
|
33
|
+
# Usage
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from polytomic.client import Polytomic
|
|
37
|
+
|
|
38
|
+
client = Polytomic(
|
|
39
|
+
polytomic_version="YOUR_POLYTOMIC_VERSION",
|
|
40
|
+
token="YOUR_TOKEN",
|
|
41
|
+
)
|
|
42
|
+
```
|
|
43
|
+
<!-- End Usage -->
|
|
44
|
+
|
|
45
|
+
<!-- Begin Async Usage, generated by Fern -->
|
|
46
|
+
# Async Client
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from polytomic.client import AsyncPolytomic
|
|
50
|
+
|
|
51
|
+
client = AsyncPolytomic(
|
|
52
|
+
polytomic_version="YOUR_POLYTOMIC_VERSION",
|
|
53
|
+
token="YOUR_TOKEN",
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
<!-- End Async Usage -->
|
|
57
|
+
|
|
58
|
+
<!-- Begin Status, generated by Fern -->
|
|
59
|
+
# Beta Status
|
|
60
|
+
|
|
61
|
+
This SDK is in beta, and there may be breaking changes between versions without a major
|
|
62
|
+
version update. Therefore, we recommend pinning the package version to a specific version.
|
|
63
|
+
This way, you can install the same version each time without breaking changes.
|
|
64
|
+
<!-- End Status -->
|
|
65
|
+
|
|
66
|
+
<!-- Begin Contributing, generated by Fern -->
|
|
67
|
+
# Contributing
|
|
68
|
+
|
|
69
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
70
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
71
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
72
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
73
|
+
an issue first to discuss with us!
|
|
74
|
+
|
|
75
|
+
On the other hand, contributions to the README are always very welcome!
|
|
76
|
+
<!-- End Contributing -->
|
|
77
|
+
|
|
78
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!-- Begin Title, generated by Fern -->
|
|
2
|
+
# Polytomic Python Library
|
|
3
|
+
|
|
4
|
+
[](https://github.com/fern-api/fern)
|
|
5
|
+
|
|
6
|
+
The Polytomic Python Library provides convenient access to the Polytomic API from applications written in Python.
|
|
7
|
+
<!-- End Title -->
|
|
8
|
+
|
|
9
|
+
<!-- Begin Installation, generated by Fern -->
|
|
10
|
+
# Installation
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
pip install --upgrade polytomic
|
|
14
|
+
```
|
|
15
|
+
<!-- End Installation -->
|
|
16
|
+
|
|
17
|
+
<!-- Begin Usage, generated by Fern -->
|
|
18
|
+
# Usage
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from polytomic.client import Polytomic
|
|
22
|
+
|
|
23
|
+
client = Polytomic(
|
|
24
|
+
polytomic_version="YOUR_POLYTOMIC_VERSION",
|
|
25
|
+
token="YOUR_TOKEN",
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
<!-- End Usage -->
|
|
29
|
+
|
|
30
|
+
<!-- Begin Async Usage, generated by Fern -->
|
|
31
|
+
# Async Client
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from polytomic.client import AsyncPolytomic
|
|
35
|
+
|
|
36
|
+
client = AsyncPolytomic(
|
|
37
|
+
polytomic_version="YOUR_POLYTOMIC_VERSION",
|
|
38
|
+
token="YOUR_TOKEN",
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
<!-- End Async Usage -->
|
|
42
|
+
|
|
43
|
+
<!-- Begin Status, generated by Fern -->
|
|
44
|
+
# Beta Status
|
|
45
|
+
|
|
46
|
+
This SDK is in beta, and there may be breaking changes between versions without a major
|
|
47
|
+
version update. Therefore, we recommend pinning the package version to a specific version.
|
|
48
|
+
This way, you can install the same version each time without breaking changes.
|
|
49
|
+
<!-- End Status -->
|
|
50
|
+
|
|
51
|
+
<!-- Begin Contributing, generated by Fern -->
|
|
52
|
+
# Contributing
|
|
53
|
+
|
|
54
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
55
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
56
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
57
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
58
|
+
an issue first to discuss with us!
|
|
59
|
+
|
|
60
|
+
On the other hand, contributions to the README are always very welcome!
|
|
61
|
+
<!-- End Contributing -->
|
|
62
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "polytomic"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = ""
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = []
|
|
7
|
+
packages = [
|
|
8
|
+
{ include = "polytomic", from = "src"}
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[tool.poetry.dependencies]
|
|
12
|
+
python = "^3.7"
|
|
13
|
+
httpx = ">=0.21.2"
|
|
14
|
+
pydantic = ">= 1.9.2, < 2.5.0"
|
|
15
|
+
|
|
16
|
+
[tool.poetry.dev-dependencies]
|
|
17
|
+
mypy = "0.971"
|
|
18
|
+
pytest = "^7.4.0"
|
|
19
|
+
|
|
20
|
+
[build-system]
|
|
21
|
+
requires = ["poetry-core"]
|
|
22
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .types import (
|
|
4
|
+
BulkSchedule,
|
|
5
|
+
LabelLabel,
|
|
6
|
+
RestErrResponse,
|
|
7
|
+
SchemaAssociation,
|
|
8
|
+
SyncDestinationProperties,
|
|
9
|
+
V2ActivateSyncEnvelope,
|
|
10
|
+
V2ActivateSyncInput,
|
|
11
|
+
V2ActivateSyncOutput,
|
|
12
|
+
V2ApiKeyResponse,
|
|
13
|
+
V2ApiKeyResponseEnvelope,
|
|
14
|
+
V2BulkSyncDest,
|
|
15
|
+
V2BulkSyncDestEnvelope,
|
|
16
|
+
V2BulkSyncListEnvelope,
|
|
17
|
+
V2BulkSyncResponse,
|
|
18
|
+
V2BulkSyncResponseEnvelope,
|
|
19
|
+
V2ConfigurationValue,
|
|
20
|
+
V2ConnectionListResponseEnvelope,
|
|
21
|
+
V2ConnectionMeta,
|
|
22
|
+
V2ConnectionMetaResponse,
|
|
23
|
+
V2ConnectionResponseEnvelope,
|
|
24
|
+
V2ConnectionResponseSchema,
|
|
25
|
+
V2ConnectionType,
|
|
26
|
+
V2ConnectionTypeResponseEnvelope,
|
|
27
|
+
V2ConnectionTypeSchema,
|
|
28
|
+
V2CreateConnectionResponseEnvelope,
|
|
29
|
+
V2CreateConnectionResponseSchema,
|
|
30
|
+
V2Event,
|
|
31
|
+
V2EventTypesEnvelope,
|
|
32
|
+
V2EventsEnvelope,
|
|
33
|
+
V2ExecutionCounts,
|
|
34
|
+
V2Filter,
|
|
35
|
+
V2GetConnectionMetaEnvelope,
|
|
36
|
+
V2GetExecutionResponseEnvelope,
|
|
37
|
+
V2GetExecutionResponseSchema,
|
|
38
|
+
V2GetIdentityResponseEnvelope,
|
|
39
|
+
V2GetIdentityResponseSchema,
|
|
40
|
+
V2Identity,
|
|
41
|
+
V2IdentityFunction,
|
|
42
|
+
V2ListExecutionResponseEnvelope,
|
|
43
|
+
V2ListPoliciesResponseEnvelope,
|
|
44
|
+
V2ListSyncResponseEnvelope,
|
|
45
|
+
V2ListUsersEnvelope,
|
|
46
|
+
V2Mode,
|
|
47
|
+
V2ModelField,
|
|
48
|
+
V2ModelFieldRequest,
|
|
49
|
+
V2ModelFieldResponse,
|
|
50
|
+
V2ModelListResponseEnvelope,
|
|
51
|
+
V2ModelResponse,
|
|
52
|
+
V2ModelResponseEnvelope,
|
|
53
|
+
V2Organization,
|
|
54
|
+
V2OrganizationEnvelope,
|
|
55
|
+
V2OrganizationsEnvelope,
|
|
56
|
+
V2Override,
|
|
57
|
+
V2PolicyAction,
|
|
58
|
+
V2PolicyResponse,
|
|
59
|
+
V2PolicyResponseEnvelope,
|
|
60
|
+
V2Relation,
|
|
61
|
+
V2RelationTo,
|
|
62
|
+
V2RoleListResponseEnvelope,
|
|
63
|
+
V2RoleResponse,
|
|
64
|
+
V2RoleResponseEnvelope,
|
|
65
|
+
V2RunAfter,
|
|
66
|
+
V2Schedule,
|
|
67
|
+
V2Source,
|
|
68
|
+
V2StartSyncResponseEnvelope,
|
|
69
|
+
V2StartSyncResponseSchema,
|
|
70
|
+
V2SupportedMode,
|
|
71
|
+
V2SyncField,
|
|
72
|
+
V2SyncResponse,
|
|
73
|
+
V2SyncResponseEnvelope,
|
|
74
|
+
V2SyncStatusEnvelope,
|
|
75
|
+
V2SyncStatusResponse,
|
|
76
|
+
V2Target,
|
|
77
|
+
V2TargetField,
|
|
78
|
+
V2TargetResponse,
|
|
79
|
+
V2TargetResponseEnvelope,
|
|
80
|
+
V2User,
|
|
81
|
+
V2UserEnvelope,
|
|
82
|
+
V2Webhook,
|
|
83
|
+
V2WebhookEnvelope,
|
|
84
|
+
V2WebhookListEnvelope,
|
|
85
|
+
V3BulkField,
|
|
86
|
+
V3BulkSchema,
|
|
87
|
+
V3BulkSchemaEnvelope,
|
|
88
|
+
V3BulkSyncExecution,
|
|
89
|
+
V3BulkSyncExecutionEnvelope,
|
|
90
|
+
V3BulkSyncSchemaExecution,
|
|
91
|
+
V3BulkSyncSource,
|
|
92
|
+
V3BulkSyncSourceEnvelope,
|
|
93
|
+
V3BulkSyncSourceSchemaEnvelope,
|
|
94
|
+
V3BulkSyncSourceStatus,
|
|
95
|
+
V3BulkSyncSourceStatusEnvelope,
|
|
96
|
+
V3BulkSyncStatusEnvelope,
|
|
97
|
+
V3BulkSyncStatusResponse,
|
|
98
|
+
V3ConnectCardResponse,
|
|
99
|
+
V3ConnectCardResponseEnvelope,
|
|
100
|
+
V3ListBulkSchemaEnvelope,
|
|
101
|
+
V3ListBulkSyncExecutionsEnvelope,
|
|
102
|
+
V3PickValue,
|
|
103
|
+
V3Schema,
|
|
104
|
+
V3SchemaField,
|
|
105
|
+
V3SchemaRecordsResponseEnvelope,
|
|
106
|
+
)
|
|
107
|
+
from .errors import UnauthorizedError
|
|
108
|
+
from .resources import (
|
|
109
|
+
V2CreateSyncRequestMode,
|
|
110
|
+
V2UpdateSyncRequestMode,
|
|
111
|
+
bulk_sync,
|
|
112
|
+
connections,
|
|
113
|
+
events,
|
|
114
|
+
model_sync,
|
|
115
|
+
models,
|
|
116
|
+
organization,
|
|
117
|
+
permissions,
|
|
118
|
+
schemas,
|
|
119
|
+
users,
|
|
120
|
+
webhooks,
|
|
121
|
+
)
|
|
122
|
+
from .environment import PolytomicEnvironment
|
|
123
|
+
|
|
124
|
+
__all__ = [
|
|
125
|
+
"BulkSchedule",
|
|
126
|
+
"LabelLabel",
|
|
127
|
+
"PolytomicEnvironment",
|
|
128
|
+
"RestErrResponse",
|
|
129
|
+
"SchemaAssociation",
|
|
130
|
+
"SyncDestinationProperties",
|
|
131
|
+
"UnauthorizedError",
|
|
132
|
+
"V2ActivateSyncEnvelope",
|
|
133
|
+
"V2ActivateSyncInput",
|
|
134
|
+
"V2ActivateSyncOutput",
|
|
135
|
+
"V2ApiKeyResponse",
|
|
136
|
+
"V2ApiKeyResponseEnvelope",
|
|
137
|
+
"V2BulkSyncDest",
|
|
138
|
+
"V2BulkSyncDestEnvelope",
|
|
139
|
+
"V2BulkSyncListEnvelope",
|
|
140
|
+
"V2BulkSyncResponse",
|
|
141
|
+
"V2BulkSyncResponseEnvelope",
|
|
142
|
+
"V2ConfigurationValue",
|
|
143
|
+
"V2ConnectionListResponseEnvelope",
|
|
144
|
+
"V2ConnectionMeta",
|
|
145
|
+
"V2ConnectionMetaResponse",
|
|
146
|
+
"V2ConnectionResponseEnvelope",
|
|
147
|
+
"V2ConnectionResponseSchema",
|
|
148
|
+
"V2ConnectionType",
|
|
149
|
+
"V2ConnectionTypeResponseEnvelope",
|
|
150
|
+
"V2ConnectionTypeSchema",
|
|
151
|
+
"V2CreateConnectionResponseEnvelope",
|
|
152
|
+
"V2CreateConnectionResponseSchema",
|
|
153
|
+
"V2CreateSyncRequestMode",
|
|
154
|
+
"V2Event",
|
|
155
|
+
"V2EventTypesEnvelope",
|
|
156
|
+
"V2EventsEnvelope",
|
|
157
|
+
"V2ExecutionCounts",
|
|
158
|
+
"V2Filter",
|
|
159
|
+
"V2GetConnectionMetaEnvelope",
|
|
160
|
+
"V2GetExecutionResponseEnvelope",
|
|
161
|
+
"V2GetExecutionResponseSchema",
|
|
162
|
+
"V2GetIdentityResponseEnvelope",
|
|
163
|
+
"V2GetIdentityResponseSchema",
|
|
164
|
+
"V2Identity",
|
|
165
|
+
"V2IdentityFunction",
|
|
166
|
+
"V2ListExecutionResponseEnvelope",
|
|
167
|
+
"V2ListPoliciesResponseEnvelope",
|
|
168
|
+
"V2ListSyncResponseEnvelope",
|
|
169
|
+
"V2ListUsersEnvelope",
|
|
170
|
+
"V2Mode",
|
|
171
|
+
"V2ModelField",
|
|
172
|
+
"V2ModelFieldRequest",
|
|
173
|
+
"V2ModelFieldResponse",
|
|
174
|
+
"V2ModelListResponseEnvelope",
|
|
175
|
+
"V2ModelResponse",
|
|
176
|
+
"V2ModelResponseEnvelope",
|
|
177
|
+
"V2Organization",
|
|
178
|
+
"V2OrganizationEnvelope",
|
|
179
|
+
"V2OrganizationsEnvelope",
|
|
180
|
+
"V2Override",
|
|
181
|
+
"V2PolicyAction",
|
|
182
|
+
"V2PolicyResponse",
|
|
183
|
+
"V2PolicyResponseEnvelope",
|
|
184
|
+
"V2Relation",
|
|
185
|
+
"V2RelationTo",
|
|
186
|
+
"V2RoleListResponseEnvelope",
|
|
187
|
+
"V2RoleResponse",
|
|
188
|
+
"V2RoleResponseEnvelope",
|
|
189
|
+
"V2RunAfter",
|
|
190
|
+
"V2Schedule",
|
|
191
|
+
"V2Source",
|
|
192
|
+
"V2StartSyncResponseEnvelope",
|
|
193
|
+
"V2StartSyncResponseSchema",
|
|
194
|
+
"V2SupportedMode",
|
|
195
|
+
"V2SyncField",
|
|
196
|
+
"V2SyncResponse",
|
|
197
|
+
"V2SyncResponseEnvelope",
|
|
198
|
+
"V2SyncStatusEnvelope",
|
|
199
|
+
"V2SyncStatusResponse",
|
|
200
|
+
"V2Target",
|
|
201
|
+
"V2TargetField",
|
|
202
|
+
"V2TargetResponse",
|
|
203
|
+
"V2TargetResponseEnvelope",
|
|
204
|
+
"V2UpdateSyncRequestMode",
|
|
205
|
+
"V2User",
|
|
206
|
+
"V2UserEnvelope",
|
|
207
|
+
"V2Webhook",
|
|
208
|
+
"V2WebhookEnvelope",
|
|
209
|
+
"V2WebhookListEnvelope",
|
|
210
|
+
"V3BulkField",
|
|
211
|
+
"V3BulkSchema",
|
|
212
|
+
"V3BulkSchemaEnvelope",
|
|
213
|
+
"V3BulkSyncExecution",
|
|
214
|
+
"V3BulkSyncExecutionEnvelope",
|
|
215
|
+
"V3BulkSyncSchemaExecution",
|
|
216
|
+
"V3BulkSyncSource",
|
|
217
|
+
"V3BulkSyncSourceEnvelope",
|
|
218
|
+
"V3BulkSyncSourceSchemaEnvelope",
|
|
219
|
+
"V3BulkSyncSourceStatus",
|
|
220
|
+
"V3BulkSyncSourceStatusEnvelope",
|
|
221
|
+
"V3BulkSyncStatusEnvelope",
|
|
222
|
+
"V3BulkSyncStatusResponse",
|
|
223
|
+
"V3ConnectCardResponse",
|
|
224
|
+
"V3ConnectCardResponseEnvelope",
|
|
225
|
+
"V3ListBulkSchemaEnvelope",
|
|
226
|
+
"V3ListBulkSyncExecutionsEnvelope",
|
|
227
|
+
"V3PickValue",
|
|
228
|
+
"V3Schema",
|
|
229
|
+
"V3SchemaField",
|
|
230
|
+
"V3SchemaRecordsResponseEnvelope",
|
|
231
|
+
"bulk_sync",
|
|
232
|
+
"connections",
|
|
233
|
+
"events",
|
|
234
|
+
"model_sync",
|
|
235
|
+
"models",
|
|
236
|
+
"organization",
|
|
237
|
+
"permissions",
|
|
238
|
+
"schemas",
|
|
239
|
+
"users",
|
|
240
|
+
"webhooks",
|
|
241
|
+
]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
import typing_extensions
|
|
7
|
+
|
|
8
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .environment import PolytomicEnvironment
|
|
10
|
+
from .resources.bulk_sync.client import AsyncBulkSyncClient, BulkSyncClient
|
|
11
|
+
from .resources.connections.client import AsyncConnectionsClient, ConnectionsClient
|
|
12
|
+
from .resources.events.client import AsyncEventsClient, EventsClient
|
|
13
|
+
from .resources.model_sync.client import AsyncModelSyncClient, ModelSyncClient
|
|
14
|
+
from .resources.models.client import AsyncModelsClient, ModelsClient
|
|
15
|
+
from .resources.organization.client import AsyncOrganizationClient, OrganizationClient
|
|
16
|
+
from .resources.permissions.client import AsyncPermissionsClient, PermissionsClient
|
|
17
|
+
from .resources.schemas.client import AsyncSchemasClient, SchemasClient
|
|
18
|
+
from .resources.users.client import AsyncUsersClient, UsersClient
|
|
19
|
+
from .resources.webhooks.client import AsyncWebhooksClient, WebhooksClient
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Polytomic:
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
*,
|
|
26
|
+
base_url: typing.Optional[str] = None,
|
|
27
|
+
environment: PolytomicEnvironment = PolytomicEnvironment.DEFAULT,
|
|
28
|
+
polytomic_version: typing.Optional[typing_extensions.Literal["2022-12-12"]] = None,
|
|
29
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
30
|
+
timeout: typing.Optional[float] = 60,
|
|
31
|
+
httpx_client: typing.Optional[httpx.Client] = None
|
|
32
|
+
):
|
|
33
|
+
self._client_wrapper = SyncClientWrapper(
|
|
34
|
+
base_url=_get_base_url(base_url=base_url, environment=environment),
|
|
35
|
+
polytomic_version=polytomic_version,
|
|
36
|
+
token=token,
|
|
37
|
+
httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
|
|
38
|
+
)
|
|
39
|
+
self.bulk_sync = BulkSyncClient(client_wrapper=self._client_wrapper)
|
|
40
|
+
self.connections = ConnectionsClient(client_wrapper=self._client_wrapper)
|
|
41
|
+
self.schemas = SchemasClient(client_wrapper=self._client_wrapper)
|
|
42
|
+
self.events = EventsClient(client_wrapper=self._client_wrapper)
|
|
43
|
+
self.models = ModelsClient(client_wrapper=self._client_wrapper)
|
|
44
|
+
self.organization = OrganizationClient(client_wrapper=self._client_wrapper)
|
|
45
|
+
self.users = UsersClient(client_wrapper=self._client_wrapper)
|
|
46
|
+
self.permissions = PermissionsClient(client_wrapper=self._client_wrapper)
|
|
47
|
+
self.model_sync = ModelSyncClient(client_wrapper=self._client_wrapper)
|
|
48
|
+
self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class AsyncPolytomic:
|
|
52
|
+
def __init__(
|
|
53
|
+
self,
|
|
54
|
+
*,
|
|
55
|
+
base_url: typing.Optional[str] = None,
|
|
56
|
+
environment: PolytomicEnvironment = PolytomicEnvironment.DEFAULT,
|
|
57
|
+
polytomic_version: typing.Optional[typing_extensions.Literal["2022-12-12"]] = None,
|
|
58
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
59
|
+
timeout: typing.Optional[float] = 60,
|
|
60
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None
|
|
61
|
+
):
|
|
62
|
+
self._client_wrapper = AsyncClientWrapper(
|
|
63
|
+
base_url=_get_base_url(base_url=base_url, environment=environment),
|
|
64
|
+
polytomic_version=polytomic_version,
|
|
65
|
+
token=token,
|
|
66
|
+
httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
|
|
67
|
+
)
|
|
68
|
+
self.bulk_sync = AsyncBulkSyncClient(client_wrapper=self._client_wrapper)
|
|
69
|
+
self.connections = AsyncConnectionsClient(client_wrapper=self._client_wrapper)
|
|
70
|
+
self.schemas = AsyncSchemasClient(client_wrapper=self._client_wrapper)
|
|
71
|
+
self.events = AsyncEventsClient(client_wrapper=self._client_wrapper)
|
|
72
|
+
self.models = AsyncModelsClient(client_wrapper=self._client_wrapper)
|
|
73
|
+
self.organization = AsyncOrganizationClient(client_wrapper=self._client_wrapper)
|
|
74
|
+
self.users = AsyncUsersClient(client_wrapper=self._client_wrapper)
|
|
75
|
+
self.permissions = AsyncPermissionsClient(client_wrapper=self._client_wrapper)
|
|
76
|
+
self.model_sync = AsyncModelSyncClient(client_wrapper=self._client_wrapper)
|
|
77
|
+
self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: PolytomicEnvironment) -> str:
|
|
81
|
+
if base_url is not None:
|
|
82
|
+
return base_url
|
|
83
|
+
elif environment is not None:
|
|
84
|
+
return environment.value
|
|
85
|
+
else:
|
|
86
|
+
raise Exception("Please pass in either base_url or environment to construct the client")
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .api_error import ApiError
|
|
4
|
+
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
|
5
|
+
from .datetime_utils import serialize_datetime
|
|
6
|
+
from .jsonable_encoder import jsonable_encoder
|
|
7
|
+
from .remove_none_from_dict import remove_none_from_dict
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"ApiError",
|
|
11
|
+
"AsyncClientWrapper",
|
|
12
|
+
"BaseClientWrapper",
|
|
13
|
+
"SyncClientWrapper",
|
|
14
|
+
"jsonable_encoder",
|
|
15
|
+
"remove_none_from_dict",
|
|
16
|
+
"serialize_datetime",
|
|
17
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApiError(Exception):
|
|
7
|
+
status_code: typing.Optional[int]
|
|
8
|
+
body: typing.Any
|
|
9
|
+
|
|
10
|
+
def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
|
|
11
|
+
self.status_code = status_code
|
|
12
|
+
self.body = body
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return f"status_code: {self.status_code}, body: {self.body}"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
import typing_extensions
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BaseClientWrapper:
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
*,
|
|
13
|
+
polytomic_version: typing.Optional[typing_extensions.Literal["2022-12-12"]] = None,
|
|
14
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
15
|
+
base_url: str,
|
|
16
|
+
):
|
|
17
|
+
self._polytomic_version = polytomic_version
|
|
18
|
+
self._token = token
|
|
19
|
+
self._base_url = base_url
|
|
20
|
+
|
|
21
|
+
def get_headers(self) -> typing.Dict[str, str]:
|
|
22
|
+
headers: typing.Dict[str, str] = {
|
|
23
|
+
"X-Fern-Language": "Python",
|
|
24
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
25
|
+
"X-Fern-SDK-Version": "0.1.0",
|
|
26
|
+
}
|
|
27
|
+
if self._polytomic_version is not None:
|
|
28
|
+
headers["X-Polytomic-Version"] = self._polytomic_version
|
|
29
|
+
token = self._get_token()
|
|
30
|
+
if token is not None:
|
|
31
|
+
headers["Authorization"] = f"Bearer {token}"
|
|
32
|
+
return headers
|
|
33
|
+
|
|
34
|
+
def _get_token(self) -> typing.Optional[str]:
|
|
35
|
+
if isinstance(self._token, str) or self._token is None:
|
|
36
|
+
return self._token
|
|
37
|
+
else:
|
|
38
|
+
return self._token()
|
|
39
|
+
|
|
40
|
+
def get_base_url(self) -> str:
|
|
41
|
+
return self._base_url
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SyncClientWrapper(BaseClientWrapper):
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
*,
|
|
48
|
+
polytomic_version: typing.Optional[typing_extensions.Literal["2022-12-12"]] = None,
|
|
49
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
50
|
+
base_url: str,
|
|
51
|
+
httpx_client: httpx.Client,
|
|
52
|
+
):
|
|
53
|
+
super().__init__(polytomic_version=polytomic_version, token=token, base_url=base_url)
|
|
54
|
+
self.httpx_client = httpx_client
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AsyncClientWrapper(BaseClientWrapper):
|
|
58
|
+
def __init__(
|
|
59
|
+
self,
|
|
60
|
+
*,
|
|
61
|
+
polytomic_version: typing.Optional[typing_extensions.Literal["2022-12-12"]] = None,
|
|
62
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
63
|
+
base_url: str,
|
|
64
|
+
httpx_client: httpx.AsyncClient,
|
|
65
|
+
):
|
|
66
|
+
super().__init__(polytomic_version=polytomic_version, token=token, base_url=base_url)
|
|
67
|
+
self.httpx_client = httpx_client
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def serialize_datetime(v: dt.datetime) -> str:
|
|
7
|
+
"""
|
|
8
|
+
Serialize a datetime including timezone info.
|
|
9
|
+
|
|
10
|
+
Uses the timezone info provided if present, otherwise uses the current runtime's timezone info.
|
|
11
|
+
|
|
12
|
+
UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def _serialize_zoned_datetime(v: dt.datetime) -> str:
|
|
16
|
+
if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None):
|
|
17
|
+
# UTC is a special case where we use "Z" at the end instead of "+00:00"
|
|
18
|
+
return v.isoformat().replace("+00:00", "Z")
|
|
19
|
+
else:
|
|
20
|
+
# Delegate to the typical +/- offset format
|
|
21
|
+
return v.isoformat()
|
|
22
|
+
|
|
23
|
+
if v.tzinfo is not None:
|
|
24
|
+
return _serialize_zoned_datetime(v)
|
|
25
|
+
else:
|
|
26
|
+
local_tz = dt.datetime.now().astimezone().tzinfo
|
|
27
|
+
localized_dt = v.replace(tzinfo=local_tz)
|
|
28
|
+
return _serialize_zoned_datetime(localized_dt)
|