payi 0.1.0a33__tar.gz → 0.1.0a35__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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- payi-0.1.0a35/.release-please-manifest.json +3 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/CHANGELOG.md +38 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/LICENSE +1 -1
- {payi-0.1.0a33 → payi-0.1.0a35}/PKG-INFO +22 -23
- {payi-0.1.0a33 → payi-0.1.0a35}/README.md +21 -22
- {payi-0.1.0a33 → payi-0.1.0a35}/api.md +18 -30
- {payi-0.1.0a33 → payi-0.1.0a35}/pyproject.toml +2 -2
- {payi-0.1.0a33 → payi-0.1.0a35}/requirements-dev.lock +2 -3
- {payi-0.1.0a33 → payi-0.1.0a35}/requirements.lock +1 -2
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_base_client.py +6 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_client.py +9 -9
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_models.py +5 -1
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_version.py +1 -1
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/lib/helpers.py +11 -8
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/__init__.py +13 -13
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/billing_models.py +4 -4
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/experiences/__init__.py +0 -14
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/experiences/experiences.py +0 -32
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/experiences/properties.py +5 -5
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/ingest.py +49 -23
- {payi-0.1.0a33/src/payi/resources/budgets → payi-0.1.0a35/src/payi/resources/limits}/__init__.py +13 -13
- payi-0.1.0a33/src/payi/resources/budgets/budgets.py → payi-0.1.0a35/src/payi/resources/limits/limits.py +213 -196
- {payi-0.1.0a33/src/payi/resources/budgets → payi-0.1.0a35/src/payi/resources/limits}/tags.py +68 -68
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/requests/properties.py +5 -5
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/__init__.py +8 -6
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/billing_model.py +1 -1
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/billing_model_create_params.py +1 -1
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/billing_model_update_params.py +1 -1
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/category_resource_response.py +4 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/__init__.py +0 -2
- {payi-0.1.0a33/src/payi/types/requests → payi-0.1.0a35/src/payi/types/experiences}/property_create_params.py +2 -2
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/ingest_event_param.py +29 -5
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/ingest_response.py +7 -7
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/ingest_units_params.py +28 -4
- payi-0.1.0a33/src/payi/types/budget_create_params.py → payi-0.1.0a35/src/payi/types/limit_create_params.py +7 -9
- payi-0.1.0a35/src/payi/types/limit_history_response.py +34 -0
- payi-0.1.0a33/src/payi/types/budget_list_params.py → payi-0.1.0a35/src/payi/types/limit_list_params.py +3 -3
- payi-0.1.0a35/src/payi/types/limit_reset_params.py +16 -0
- payi-0.1.0a33/src/payi/types/budget_response.py → payi-0.1.0a35/src/payi/types/limit_response.py +11 -13
- payi-0.1.0a33/src/payi/types/budget_update_params.py → payi-0.1.0a35/src/payi/types/limit_update_params.py +3 -3
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/__init__.py +1 -1
- payi-0.1.0a33/src/payi/types/budgets/budget_tags.py → payi-0.1.0a35/src/payi/types/limits/limit_tags.py +2 -2
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_create_params.py +1 -1
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_create_response.py +2 -2
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_delete_response.py +2 -2
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_list_response.py +2 -2
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_remove_params.py +1 -1
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_remove_response.py +2 -2
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_update_params.py +1 -1
- {payi-0.1.0a33/src/payi/types/budgets → payi-0.1.0a35/src/payi/types/limits}/tag_update_response.py +2 -2
- payi-0.1.0a33/src/payi/types/paged_budget_list.py → payi-0.1.0a35/src/payi/types/paged_limit_list.py +9 -11
- {payi-0.1.0a33/src/payi/types/experiences → payi-0.1.0a35/src/payi/types/requests}/property_create_params.py +2 -2
- payi-0.1.0a35/src/payi/types/shared/__init__.py +3 -0
- payi-0.1.0a33/src/payi/types/experiences/csat_response.py → payi-0.1.0a35/src/payi/types/shared/evaluation_response.py +3 -2
- {payi-0.1.0a33/tests/api_resources/budgets → payi-0.1.0a35/tests/api_resources/limits}/test_tags.py +111 -111
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/test_billing_models.py +18 -18
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/test_ingest.py +36 -4
- payi-0.1.0a33/tests/api_resources/test_budgets.py → payi-0.1.0a35/tests/api_resources/test_limits.py +192 -177
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_client.py +28 -28
- payi-0.1.0a33/.release-please-manifest.json +0 -3
- payi-0.1.0a33/src/payi/resources/experiences/csat.py +0 -188
- payi-0.1.0a33/src/payi/types/budget_history_response.py +0 -38
- payi-0.1.0a33/src/payi/types/experiences/csat_create_params.py +0 -14
- payi-0.1.0a33/tests/api_resources/experiences/test_csat.py +0 -124
- {payi-0.1.0a33 → payi-0.1.0a35}/.gitignore +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/SECURITY.md +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/bin/check-release-environment +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/bin/publish-pypi +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/examples/.keep +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/mypy.ini +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/noxfile.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/release-please-config.json +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_compat.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_constants.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_files.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_qs.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_resource.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_types.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_reflection.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/py.typed +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/categories/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/categories/categories.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/categories/resources.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/experiences/types.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/price_modifiers.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/requests/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/resources/requests/requests.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/billing_model_list_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/bulk_ingest_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/categories/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/categories/resource_create_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/categories/resource_list_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/category_delete_resource_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/category_delete_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/category_list_resources_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/category_list_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/category_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/cost_data.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experience_instance_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/experience_type.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/properties_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/type_create_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/type_list_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/type_list_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/experiences/type_update_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/ingest_bulk_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/price_modifier.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/price_modifier_create_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/price_modifier_retrieve_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/price_modifier_update_params.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/requests/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/requests_data.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/src/payi/types/total_cost_data.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a33/tests/api_resources/budgets → payi-0.1.0a35/tests/api_resources/categories}/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/categories/test_resources.py +0 -0
- {payi-0.1.0a33/tests/api_resources/categories → payi-0.1.0a35/tests/api_resources/experiences}/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/experiences/test_properties.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/experiences/test_types.py +0 -0
- {payi-0.1.0a33/tests/api_resources/experiences → payi-0.1.0a35/tests/api_resources/limits}/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/requests/__init__.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/requests/test_properties.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/test_categories.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/test_experiences.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/api_resources/test_price_modifiers.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/conftest.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/sample_file.txt +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_files.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_models.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_qs.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_required_args.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_response.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_streaming.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_transform.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a33 → payi-0.1.0a35}/tests/utils.py +0 -0
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.35 (2025-01-12)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.34...v0.1.0-alpha.35](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.34...v0.1.0-alpha.35)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([#175](https://github.com/Pay-i/pay-i-python/issues/175)) ([3dd351e](https://github.com/Pay-i/pay-i-python/commit/3dd351ecb7d7c34ce73d8a26590000fb4dc38dbc))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **client:** only call .close() when needed ([#172](https://github.com/Pay-i/pay-i-python/issues/172)) ([75baf12](https://github.com/Pay-i/pay-i-python/commit/75baf1247d05a1b8a02fcfc4aa1342a11ef882b2))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Chores
|
|
18
|
+
|
|
19
|
+
* **internal:** bump httpx dependency ([#171](https://github.com/Pay-i/pay-i-python/issues/171)) ([e7bf93a](https://github.com/Pay-i/pay-i-python/commit/e7bf93a87ae1bec99ee4f0fd049b2e4c8f6ef68d))
|
|
20
|
+
* **internal:** codegen related update ([#169](https://github.com/Pay-i/pay-i-python/issues/169)) ([03a0803](https://github.com/Pay-i/pay-i-python/commit/03a0803e49689e31d3d7b42d2da7ed9e886434a8))
|
|
21
|
+
* **internal:** codegen related update ([#174](https://github.com/Pay-i/pay-i-python/issues/174)) ([21d0af0](https://github.com/Pay-i/pay-i-python/commit/21d0af0f6b7a15efa62f9c514681f61fa1f9ddb8))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Documentation
|
|
25
|
+
|
|
26
|
+
* fix typos ([#173](https://github.com/Pay-i/pay-i-python/issues/173)) ([3d97187](https://github.com/Pay-i/pay-i-python/commit/3d971877582257b349fa59bc83535b6cc3374c43))
|
|
27
|
+
|
|
28
|
+
## 0.1.0-alpha.34 (2025-01-06)
|
|
29
|
+
|
|
30
|
+
Full Changelog: [v0.1.0-alpha.33...v0.1.0-alpha.34](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.33...v0.1.0-alpha.34)
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* **api:** rename budgets to limits ([#166](https://github.com/Pay-i/pay-i-python/issues/166)) ([7b7bdf3](https://github.com/Pay-i/pay-i-python/commit/7b7bdf3e9deade234ddd46ec1ad8bb9255f4ab64))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Chores
|
|
38
|
+
|
|
39
|
+
* **internal:** codegen related update ([#164](https://github.com/Pay-i/pay-i-python/issues/164)) ([c8be7a0](https://github.com/Pay-i/pay-i-python/commit/c8be7a00beab6874fbdae426c52b63c509eba450))
|
|
40
|
+
|
|
3
41
|
## 0.1.0-alpha.33 (2024-12-18)
|
|
4
42
|
|
|
5
43
|
Full Changelog: [v0.1.0-alpha.32...v0.1.0-alpha.33](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.32...v0.1.0-alpha.33)
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2025 Payi
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a35
|
|
4
4
|
Summary: The official Python library for the payi API
|
|
5
5
|
Project-URL: Homepage, https://github.com/Pay-i/pay-i-python
|
|
6
6
|
Project-URL: Repository, https://github.com/Pay-i/pay-i-python
|
|
@@ -63,11 +63,11 @@ client = Payi(
|
|
|
63
63
|
api_key=os.environ.get("PAYI_API_KEY"), # This is the default and can be omitted
|
|
64
64
|
)
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
limit_response = client.limits.create(
|
|
67
|
+
limit_name="x",
|
|
68
68
|
max=0,
|
|
69
69
|
)
|
|
70
|
-
print(
|
|
70
|
+
print(limit_response.request_id)
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
While you can provide an `api_key` keyword argument,
|
|
@@ -90,11 +90,11 @@ client = AsyncPayi(
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
async def main() -> None:
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
limit_response = await client.limits.create(
|
|
94
|
+
limit_name="x",
|
|
95
95
|
max=0,
|
|
96
96
|
)
|
|
97
|
-
print(
|
|
97
|
+
print(limit_response.request_id)
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
asyncio.run(main())
|
|
@@ -127,8 +127,8 @@ from payi import Payi
|
|
|
127
127
|
client = Payi()
|
|
128
128
|
|
|
129
129
|
try:
|
|
130
|
-
client.
|
|
131
|
-
|
|
130
|
+
client.limits.create(
|
|
131
|
+
limit_name="x",
|
|
132
132
|
max=0,
|
|
133
133
|
)
|
|
134
134
|
except payi.APIConnectionError as e:
|
|
@@ -142,7 +142,7 @@ except payi.APIStatusError as e:
|
|
|
142
142
|
print(e.response)
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
Error codes are as
|
|
145
|
+
Error codes are as follows:
|
|
146
146
|
|
|
147
147
|
| Status Code | Error Type |
|
|
148
148
|
| ----------- | -------------------------- |
|
|
@@ -173,8 +173,8 @@ client = Payi(
|
|
|
173
173
|
)
|
|
174
174
|
|
|
175
175
|
# Or, configure per-request:
|
|
176
|
-
client.with_options(max_retries=5).
|
|
177
|
-
|
|
176
|
+
client.with_options(max_retries=5).limits.create(
|
|
177
|
+
limit_name="x",
|
|
178
178
|
max=0,
|
|
179
179
|
)
|
|
180
180
|
```
|
|
@@ -199,8 +199,8 @@ client = Payi(
|
|
|
199
199
|
)
|
|
200
200
|
|
|
201
201
|
# Override per-request:
|
|
202
|
-
client.with_options(timeout=5.0).
|
|
203
|
-
|
|
202
|
+
client.with_options(timeout=5.0).limits.create(
|
|
203
|
+
limit_name="x",
|
|
204
204
|
max=0,
|
|
205
205
|
)
|
|
206
206
|
```
|
|
@@ -243,14 +243,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
243
243
|
from payi import Payi
|
|
244
244
|
|
|
245
245
|
client = Payi()
|
|
246
|
-
response = client.
|
|
247
|
-
|
|
246
|
+
response = client.limits.with_raw_response.create(
|
|
247
|
+
limit_name="x",
|
|
248
248
|
max=0,
|
|
249
249
|
)
|
|
250
250
|
print(response.headers.get('X-My-Header'))
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
print(
|
|
252
|
+
limit = response.parse() # get the object that `limits.create()` would have returned
|
|
253
|
+
print(limit.request_id)
|
|
254
254
|
```
|
|
255
255
|
|
|
256
256
|
These methods return an [`APIResponse`](https://github.com/Pay-i/pay-i-python/tree/main/src/payi/_response.py) object.
|
|
@@ -264,8 +264,8 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
264
264
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
265
265
|
|
|
266
266
|
```python
|
|
267
|
-
with client.
|
|
268
|
-
|
|
267
|
+
with client.limits.with_streaming_response.create(
|
|
268
|
+
limit_name="x",
|
|
269
269
|
max=0,
|
|
270
270
|
) as response:
|
|
271
271
|
print(response.headers.get("X-My-Header"))
|
|
@@ -285,8 +285,7 @@ If you need to access undocumented endpoints, params, or response properties, th
|
|
|
285
285
|
#### Undocumented endpoints
|
|
286
286
|
|
|
287
287
|
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
|
|
288
|
-
http verbs. Options on the client will be respected (such as retries)
|
|
289
|
-
request.
|
|
288
|
+
http verbs. Options on the client will be respected (such as retries) when making this request.
|
|
290
289
|
|
|
291
290
|
```py
|
|
292
291
|
import httpx
|
|
@@ -358,7 +357,7 @@ with Payi() as client:
|
|
|
358
357
|
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
359
358
|
|
|
360
359
|
1. Changes that only affect static types, without breaking runtime behavior.
|
|
361
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_
|
|
360
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
362
361
|
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
363
362
|
|
|
364
363
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
@@ -31,11 +31,11 @@ client = Payi(
|
|
|
31
31
|
api_key=os.environ.get("PAYI_API_KEY"), # This is the default and can be omitted
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
limit_response = client.limits.create(
|
|
35
|
+
limit_name="x",
|
|
36
36
|
max=0,
|
|
37
37
|
)
|
|
38
|
-
print(
|
|
38
|
+
print(limit_response.request_id)
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
While you can provide an `api_key` keyword argument,
|
|
@@ -58,11 +58,11 @@ client = AsyncPayi(
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
async def main() -> None:
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
limit_response = await client.limits.create(
|
|
62
|
+
limit_name="x",
|
|
63
63
|
max=0,
|
|
64
64
|
)
|
|
65
|
-
print(
|
|
65
|
+
print(limit_response.request_id)
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
asyncio.run(main())
|
|
@@ -95,8 +95,8 @@ from payi import Payi
|
|
|
95
95
|
client = Payi()
|
|
96
96
|
|
|
97
97
|
try:
|
|
98
|
-
client.
|
|
99
|
-
|
|
98
|
+
client.limits.create(
|
|
99
|
+
limit_name="x",
|
|
100
100
|
max=0,
|
|
101
101
|
)
|
|
102
102
|
except payi.APIConnectionError as e:
|
|
@@ -110,7 +110,7 @@ except payi.APIStatusError as e:
|
|
|
110
110
|
print(e.response)
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Error codes are as
|
|
113
|
+
Error codes are as follows:
|
|
114
114
|
|
|
115
115
|
| Status Code | Error Type |
|
|
116
116
|
| ----------- | -------------------------- |
|
|
@@ -141,8 +141,8 @@ client = Payi(
|
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
# Or, configure per-request:
|
|
144
|
-
client.with_options(max_retries=5).
|
|
145
|
-
|
|
144
|
+
client.with_options(max_retries=5).limits.create(
|
|
145
|
+
limit_name="x",
|
|
146
146
|
max=0,
|
|
147
147
|
)
|
|
148
148
|
```
|
|
@@ -167,8 +167,8 @@ client = Payi(
|
|
|
167
167
|
)
|
|
168
168
|
|
|
169
169
|
# Override per-request:
|
|
170
|
-
client.with_options(timeout=5.0).
|
|
171
|
-
|
|
170
|
+
client.with_options(timeout=5.0).limits.create(
|
|
171
|
+
limit_name="x",
|
|
172
172
|
max=0,
|
|
173
173
|
)
|
|
174
174
|
```
|
|
@@ -211,14 +211,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
211
211
|
from payi import Payi
|
|
212
212
|
|
|
213
213
|
client = Payi()
|
|
214
|
-
response = client.
|
|
215
|
-
|
|
214
|
+
response = client.limits.with_raw_response.create(
|
|
215
|
+
limit_name="x",
|
|
216
216
|
max=0,
|
|
217
217
|
)
|
|
218
218
|
print(response.headers.get('X-My-Header'))
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
print(
|
|
220
|
+
limit = response.parse() # get the object that `limits.create()` would have returned
|
|
221
|
+
print(limit.request_id)
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
These methods return an [`APIResponse`](https://github.com/Pay-i/pay-i-python/tree/main/src/payi/_response.py) object.
|
|
@@ -232,8 +232,8 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
232
232
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
233
233
|
|
|
234
234
|
```python
|
|
235
|
-
with client.
|
|
236
|
-
|
|
235
|
+
with client.limits.with_streaming_response.create(
|
|
236
|
+
limit_name="x",
|
|
237
237
|
max=0,
|
|
238
238
|
) as response:
|
|
239
239
|
print(response.headers.get("X-My-Header"))
|
|
@@ -253,8 +253,7 @@ If you need to access undocumented endpoints, params, or response properties, th
|
|
|
253
253
|
#### Undocumented endpoints
|
|
254
254
|
|
|
255
255
|
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
|
|
256
|
-
http verbs. Options on the client will be respected (such as retries)
|
|
257
|
-
request.
|
|
256
|
+
http verbs. Options on the client will be respected (such as retries) when making this request.
|
|
258
257
|
|
|
259
258
|
```py
|
|
260
259
|
import httpx
|
|
@@ -326,7 +325,7 @@ with Payi() as client:
|
|
|
326
325
|
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
327
326
|
|
|
328
327
|
1. Changes that only affect static types, without breaking runtime behavior.
|
|
329
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_
|
|
328
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
330
329
|
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
331
330
|
|
|
332
331
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Limits
|
|
2
2
|
|
|
3
3
|
Types:
|
|
4
4
|
|
|
5
5
|
```python
|
|
6
6
|
from payi.types import (
|
|
7
|
-
BudgetHistoryResponse,
|
|
8
|
-
BudgetResponse,
|
|
9
7
|
CostData,
|
|
10
8
|
CostDetails,
|
|
11
9
|
DefaultResponse,
|
|
12
|
-
|
|
10
|
+
LimitHistoryResponse,
|
|
11
|
+
LimitResponse,
|
|
12
|
+
PagedLimitList,
|
|
13
13
|
RequestsData,
|
|
14
14
|
TotalCostData,
|
|
15
15
|
)
|
|
@@ -17,20 +17,20 @@ from payi.types import (
|
|
|
17
17
|
|
|
18
18
|
Methods:
|
|
19
19
|
|
|
20
|
-
- <code title="post /api/v1/
|
|
21
|
-
- <code title="get /api/v1/
|
|
22
|
-
- <code title="put /api/v1/
|
|
23
|
-
- <code title="get /api/v1/
|
|
24
|
-
- <code title="delete /api/v1/
|
|
25
|
-
- <code title="post /api/v1/
|
|
20
|
+
- <code title="post /api/v1/limits">client.limits.<a href="./src/payi/resources/limits/limits.py">create</a>(\*\*<a href="src/payi/types/limit_create_params.py">params</a>) -> <a href="./src/payi/types/limit_response.py">LimitResponse</a></code>
|
|
21
|
+
- <code title="get /api/v1/limits/{limit_id}">client.limits.<a href="./src/payi/resources/limits/limits.py">retrieve</a>(limit_id) -> <a href="./src/payi/types/limit_response.py">LimitResponse</a></code>
|
|
22
|
+
- <code title="put /api/v1/limits/{limit_id}">client.limits.<a href="./src/payi/resources/limits/limits.py">update</a>(limit_id, \*\*<a href="src/payi/types/limit_update_params.py">params</a>) -> <a href="./src/payi/types/limit_response.py">LimitResponse</a></code>
|
|
23
|
+
- <code title="get /api/v1/limits">client.limits.<a href="./src/payi/resources/limits/limits.py">list</a>(\*\*<a href="src/payi/types/limit_list_params.py">params</a>) -> <a href="./src/payi/types/paged_limit_list.py">PagedLimitList</a></code>
|
|
24
|
+
- <code title="delete /api/v1/limits/{limit_id}">client.limits.<a href="./src/payi/resources/limits/limits.py">delete</a>(limit_id) -> <a href="./src/payi/types/default_response.py">DefaultResponse</a></code>
|
|
25
|
+
- <code title="post /api/v1/limits/{limit_id}/reset">client.limits.<a href="./src/payi/resources/limits/limits.py">reset</a>(limit_id, \*\*<a href="src/payi/types/limit_reset_params.py">params</a>) -> <a href="./src/payi/types/limit_history_response.py">LimitHistoryResponse</a></code>
|
|
26
26
|
|
|
27
27
|
## Tags
|
|
28
28
|
|
|
29
29
|
Types:
|
|
30
30
|
|
|
31
31
|
```python
|
|
32
|
-
from payi.types.
|
|
33
|
-
|
|
32
|
+
from payi.types.limits import (
|
|
33
|
+
LimitTags,
|
|
34
34
|
TagCreateResponse,
|
|
35
35
|
TagUpdateResponse,
|
|
36
36
|
TagListResponse,
|
|
@@ -41,11 +41,11 @@ from payi.types.budgets import (
|
|
|
41
41
|
|
|
42
42
|
Methods:
|
|
43
43
|
|
|
44
|
-
- <code title="post /api/v1/
|
|
45
|
-
- <code title="put /api/v1/
|
|
46
|
-
- <code title="get /api/v1/
|
|
47
|
-
- <code title="delete /api/v1/
|
|
48
|
-
- <code title="patch /api/v1/
|
|
44
|
+
- <code title="post /api/v1/limits/{limit_id}/tags">client.limits.tags.<a href="./src/payi/resources/limits/tags.py">create</a>(limit_id, \*\*<a href="src/payi/types/limits/tag_create_params.py">params</a>) -> <a href="./src/payi/types/limits/tag_create_response.py">TagCreateResponse</a></code>
|
|
45
|
+
- <code title="put /api/v1/limits/{limit_id}/tags">client.limits.tags.<a href="./src/payi/resources/limits/tags.py">update</a>(limit_id, \*\*<a href="src/payi/types/limits/tag_update_params.py">params</a>) -> <a href="./src/payi/types/limits/tag_update_response.py">TagUpdateResponse</a></code>
|
|
46
|
+
- <code title="get /api/v1/limits/{limit_id}/tags">client.limits.tags.<a href="./src/payi/resources/limits/tags.py">list</a>(limit_id) -> <a href="./src/payi/types/limits/tag_list_response.py">TagListResponse</a></code>
|
|
47
|
+
- <code title="delete /api/v1/limits/{limit_id}/tags">client.limits.tags.<a href="./src/payi/resources/limits/tags.py">delete</a>(limit_id) -> <a href="./src/payi/types/limits/tag_delete_response.py">TagDeleteResponse</a></code>
|
|
48
|
+
- <code title="patch /api/v1/limits/{limit_id}/tags/remove">client.limits.tags.<a href="./src/payi/resources/limits/tags.py">remove</a>(limit_id, \*\*<a href="src/payi/types/limits/tag_remove_params.py">params</a>) -> <a href="./src/payi/types/limits/tag_remove_response.py">TagRemoveResponse</a></code>
|
|
49
49
|
|
|
50
50
|
# Ingest
|
|
51
51
|
|
|
@@ -127,18 +127,6 @@ Methods:
|
|
|
127
127
|
- <code title="get /api/v1/experiences/types">client.experiences.types.<a href="./src/payi/resources/experiences/types.py">list</a>(\*\*<a href="src/payi/types/experiences/type_list_params.py">params</a>) -> <a href="./src/payi/types/experiences/type_list_response.py">TypeListResponse</a></code>
|
|
128
128
|
- <code title="delete /api/v1/experiences/types/{experience_name}">client.experiences.types.<a href="./src/payi/resources/experiences/types.py">delete</a>(experience_name) -> <a href="./src/payi/types/experiences/experience_type.py">ExperienceType</a></code>
|
|
129
129
|
|
|
130
|
-
## Csat
|
|
131
|
-
|
|
132
|
-
Types:
|
|
133
|
-
|
|
134
|
-
```python
|
|
135
|
-
from payi.types.experiences import CsatResponse
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Methods:
|
|
139
|
-
|
|
140
|
-
- <code title="post /api/v1/experiences/instances/{experience_id}/csat">client.experiences.csat.<a href="./src/payi/resources/experiences/csat.py">create</a>(experience_id, \*\*<a href="src/payi/types/experiences/csat_create_params.py">params</a>) -> <a href="./src/payi/types/experiences/csat_response.py">CsatResponse</a></code>
|
|
141
|
-
|
|
142
130
|
## Properties
|
|
143
131
|
|
|
144
132
|
Types:
|
|
@@ -187,4 +175,4 @@ Methods:
|
|
|
187
175
|
|
|
188
176
|
Methods:
|
|
189
177
|
|
|
190
|
-
- <code title="post /api/v1/requests/{request_id}/properties">client.requests.properties.<a href="./src/payi/resources/requests/properties.py">create</a>(request_id, \*\*<a href="src/payi/types/requests/property_create_params.py">params</a>) -> <a href="./src/payi/types/experiences/properties_response.py">PropertiesResponse</a></code>
|
|
178
|
+
- <code title="post /api/v1/requests/{request_id}/properties">client.requests.properties.<a href="./src/payi/resources/requests/properties.py">create</a>(request_id, \*\*<a href="src/payi/types/requests/property_create_params.py">params</a>) -> <a href="./src/payi/types/experiences/properties_response.py">PropertiesResponse</a></code>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "payi"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.35"
|
|
4
4
|
description = "The official Python library for the payi API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -54,7 +54,7 @@ dev-dependencies = [
|
|
|
54
54
|
"dirty-equals>=0.6.0",
|
|
55
55
|
"importlib-metadata>=6.7.0",
|
|
56
56
|
"rich>=13.7.1",
|
|
57
|
-
"nest_asyncio==1.6.0"
|
|
57
|
+
"nest_asyncio==1.6.0",
|
|
58
58
|
]
|
|
59
59
|
|
|
60
60
|
[tool.rye.scripts]
|
|
@@ -35,7 +35,7 @@ h11==0.14.0
|
|
|
35
35
|
# via httpcore
|
|
36
36
|
httpcore==1.0.2
|
|
37
37
|
# via httpx
|
|
38
|
-
httpx==0.
|
|
38
|
+
httpx==0.28.1
|
|
39
39
|
# via payi
|
|
40
40
|
# via respx
|
|
41
41
|
idna==3.4
|
|
@@ -76,7 +76,7 @@ python-dateutil==2.8.2
|
|
|
76
76
|
# via time-machine
|
|
77
77
|
pytz==2023.3.post1
|
|
78
78
|
# via dirty-equals
|
|
79
|
-
respx==0.
|
|
79
|
+
respx==0.22.0
|
|
80
80
|
rich==13.7.1
|
|
81
81
|
ruff==0.6.9
|
|
82
82
|
setuptools==68.2.2
|
|
@@ -85,7 +85,6 @@ six==1.16.0
|
|
|
85
85
|
# via python-dateutil
|
|
86
86
|
sniffio==1.3.0
|
|
87
87
|
# via anyio
|
|
88
|
-
# via httpx
|
|
89
88
|
# via payi
|
|
90
89
|
time-machine==2.9.0
|
|
91
90
|
tomli==2.0.2
|
|
@@ -25,7 +25,7 @@ h11==0.14.0
|
|
|
25
25
|
# via httpcore
|
|
26
26
|
httpcore==1.0.2
|
|
27
27
|
# via httpx
|
|
28
|
-
httpx==0.
|
|
28
|
+
httpx==0.28.1
|
|
29
29
|
# via payi
|
|
30
30
|
idna==3.4
|
|
31
31
|
# via anyio
|
|
@@ -36,7 +36,6 @@ pydantic-core==2.27.1
|
|
|
36
36
|
# via pydantic
|
|
37
37
|
sniffio==1.3.0
|
|
38
38
|
# via anyio
|
|
39
|
-
# via httpx
|
|
40
39
|
# via payi
|
|
41
40
|
typing-extensions==4.12.2
|
|
42
41
|
# via anyio
|
|
@@ -767,6 +767,9 @@ else:
|
|
|
767
767
|
|
|
768
768
|
class SyncHttpxClientWrapper(DefaultHttpxClient):
|
|
769
769
|
def __del__(self) -> None:
|
|
770
|
+
if self.is_closed:
|
|
771
|
+
return
|
|
772
|
+
|
|
770
773
|
try:
|
|
771
774
|
self.close()
|
|
772
775
|
except Exception:
|
|
@@ -1334,6 +1337,9 @@ else:
|
|
|
1334
1337
|
|
|
1335
1338
|
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
|
|
1336
1339
|
def __del__(self) -> None:
|
|
1340
|
+
if self.is_closed:
|
|
1341
|
+
return
|
|
1342
|
+
|
|
1337
1343
|
try:
|
|
1338
1344
|
# TODO(someday): support non asyncio runtimes here
|
|
1339
1345
|
asyncio.get_running_loop().create_task(self.aclose())
|
|
@@ -32,7 +32,7 @@ from ._base_client import (
|
|
|
32
32
|
SyncAPIClient,
|
|
33
33
|
AsyncAPIClient,
|
|
34
34
|
)
|
|
35
|
-
from .resources.
|
|
35
|
+
from .resources.limits import limits
|
|
36
36
|
from .resources.requests import requests
|
|
37
37
|
from .resources.categories import categories
|
|
38
38
|
from .resources.experiences import experiences
|
|
@@ -41,7 +41,7 @@ __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Payi", "As
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class Payi(SyncAPIClient):
|
|
44
|
-
|
|
44
|
+
limits: limits.LimitsResource
|
|
45
45
|
ingest: ingest.IngestResource
|
|
46
46
|
categories: categories.CategoriesResource
|
|
47
47
|
experiences: experiences.ExperiencesResource
|
|
@@ -105,7 +105,7 @@ class Payi(SyncAPIClient):
|
|
|
105
105
|
_strict_response_validation=_strict_response_validation,
|
|
106
106
|
)
|
|
107
107
|
|
|
108
|
-
self.
|
|
108
|
+
self.limits = limits.LimitsResource(self)
|
|
109
109
|
self.ingest = ingest.IngestResource(self)
|
|
110
110
|
self.categories = categories.CategoriesResource(self)
|
|
111
111
|
self.experiences = experiences.ExperiencesResource(self)
|
|
@@ -221,7 +221,7 @@ class Payi(SyncAPIClient):
|
|
|
221
221
|
|
|
222
222
|
|
|
223
223
|
class AsyncPayi(AsyncAPIClient):
|
|
224
|
-
|
|
224
|
+
limits: limits.AsyncLimitsResource
|
|
225
225
|
ingest: ingest.AsyncIngestResource
|
|
226
226
|
categories: categories.AsyncCategoriesResource
|
|
227
227
|
experiences: experiences.AsyncExperiencesResource
|
|
@@ -285,7 +285,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
285
285
|
_strict_response_validation=_strict_response_validation,
|
|
286
286
|
)
|
|
287
287
|
|
|
288
|
-
self.
|
|
288
|
+
self.limits = limits.AsyncLimitsResource(self)
|
|
289
289
|
self.ingest = ingest.AsyncIngestResource(self)
|
|
290
290
|
self.categories = categories.AsyncCategoriesResource(self)
|
|
291
291
|
self.experiences = experiences.AsyncExperiencesResource(self)
|
|
@@ -402,7 +402,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
402
402
|
|
|
403
403
|
class PayiWithRawResponse:
|
|
404
404
|
def __init__(self, client: Payi) -> None:
|
|
405
|
-
self.
|
|
405
|
+
self.limits = limits.LimitsResourceWithRawResponse(client.limits)
|
|
406
406
|
self.ingest = ingest.IngestResourceWithRawResponse(client.ingest)
|
|
407
407
|
self.categories = categories.CategoriesResourceWithRawResponse(client.categories)
|
|
408
408
|
self.experiences = experiences.ExperiencesResourceWithRawResponse(client.experiences)
|
|
@@ -413,7 +413,7 @@ class PayiWithRawResponse:
|
|
|
413
413
|
|
|
414
414
|
class AsyncPayiWithRawResponse:
|
|
415
415
|
def __init__(self, client: AsyncPayi) -> None:
|
|
416
|
-
self.
|
|
416
|
+
self.limits = limits.AsyncLimitsResourceWithRawResponse(client.limits)
|
|
417
417
|
self.ingest = ingest.AsyncIngestResourceWithRawResponse(client.ingest)
|
|
418
418
|
self.categories = categories.AsyncCategoriesResourceWithRawResponse(client.categories)
|
|
419
419
|
self.experiences = experiences.AsyncExperiencesResourceWithRawResponse(client.experiences)
|
|
@@ -424,7 +424,7 @@ class AsyncPayiWithRawResponse:
|
|
|
424
424
|
|
|
425
425
|
class PayiWithStreamedResponse:
|
|
426
426
|
def __init__(self, client: Payi) -> None:
|
|
427
|
-
self.
|
|
427
|
+
self.limits = limits.LimitsResourceWithStreamingResponse(client.limits)
|
|
428
428
|
self.ingest = ingest.IngestResourceWithStreamingResponse(client.ingest)
|
|
429
429
|
self.categories = categories.CategoriesResourceWithStreamingResponse(client.categories)
|
|
430
430
|
self.experiences = experiences.ExperiencesResourceWithStreamingResponse(client.experiences)
|
|
@@ -435,7 +435,7 @@ class PayiWithStreamedResponse:
|
|
|
435
435
|
|
|
436
436
|
class AsyncPayiWithStreamedResponse:
|
|
437
437
|
def __init__(self, client: AsyncPayi) -> None:
|
|
438
|
-
self.
|
|
438
|
+
self.limits = limits.AsyncLimitsResourceWithStreamingResponse(client.limits)
|
|
439
439
|
self.ingest = ingest.AsyncIngestResourceWithStreamingResponse(client.ingest)
|
|
440
440
|
self.categories = categories.AsyncCategoriesResourceWithStreamingResponse(client.categories)
|
|
441
441
|
self.experiences = experiences.AsyncExperiencesResourceWithStreamingResponse(client.experiences)
|
|
@@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object:
|
|
|
488
488
|
_, items_type = get_args(type_) # Dict[_, items_type]
|
|
489
489
|
return {key: construct_type(value=item, type_=items_type) for key, item in value.items()}
|
|
490
490
|
|
|
491
|
-
if
|
|
491
|
+
if (
|
|
492
|
+
not is_literal_type(type_)
|
|
493
|
+
and inspect.isclass(origin)
|
|
494
|
+
and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel))
|
|
495
|
+
):
|
|
492
496
|
if is_list(value):
|
|
493
497
|
return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value]
|
|
494
498
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
from typing import Dict, List, Union
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
def
|
|
6
|
-
if not isinstance(
|
|
7
|
-
raise TypeError("
|
|
5
|
+
def create_limit_header_from_ids(limit_ids: List[str]) -> Dict[str, str]:
|
|
6
|
+
if not isinstance(limit_ids, list): # type: ignore
|
|
7
|
+
raise TypeError("limit_ids must be a list")
|
|
8
8
|
|
|
9
|
-
valid_ids = [id.strip() for id in
|
|
9
|
+
valid_ids = [id.strip() for id in limit_ids if isinstance(id, str) and id.strip()] # type: ignore
|
|
10
10
|
|
|
11
|
-
return {"xProxy-
|
|
11
|
+
return {"xProxy-Limit-IDs": ",".join(valid_ids)} if valid_ids else {}
|
|
12
12
|
|
|
13
13
|
def create_request_header_from_tags(request_tags: List[str]) -> Dict[str, str]:
|
|
14
14
|
if not isinstance(request_tags, list): # type: ignore
|
|
@@ -19,20 +19,23 @@ def create_request_header_from_tags(request_tags: List[str]) -> Dict[str, str]:
|
|
|
19
19
|
return {"xProxy-Request-Tags": ",".join(valid_tags)} if valid_tags else {}
|
|
20
20
|
|
|
21
21
|
def create_headers(
|
|
22
|
-
|
|
22
|
+
limit_ids: Union[List[str], None] = None,
|
|
23
23
|
request_tags: Union[List[str], None] = None,
|
|
24
24
|
user_id: Union[str, None] = None,
|
|
25
25
|
experience_id: Union[str, None] = None,
|
|
26
|
+
experience_name: Union[str, None] = None,
|
|
26
27
|
) -> Dict[str, str]:
|
|
27
28
|
headers: Dict[str, str] = {}
|
|
28
29
|
|
|
29
|
-
if
|
|
30
|
-
headers.update(
|
|
30
|
+
if limit_ids:
|
|
31
|
+
headers.update(create_limit_header_from_ids(limit_ids))
|
|
31
32
|
if request_tags:
|
|
32
33
|
headers.update(create_request_header_from_tags(request_tags))
|
|
33
34
|
if user_id:
|
|
34
35
|
headers.update({"xProxy-User-ID": user_id})
|
|
35
36
|
if experience_id:
|
|
36
37
|
headers.update({"xProxy-Experience-Id": experience_id})
|
|
38
|
+
if experience_name:
|
|
39
|
+
headers.update({"xProxy-Experience-Name": experience_name})
|
|
37
40
|
|
|
38
41
|
return headers
|