payi 0.1.0a53__tar.gz → 0.1.0a55__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.0a55/.release-please-manifest.json +3 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/CHANGELOG.md +29 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/PKG-INFO +25 -4
- {payi-0.1.0a53 → payi-0.1.0a55}/README.md +22 -0
- payi-0.1.0a55/bin/publish-pypi +6 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/pyproject.toml +2 -4
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_base_client.py +1 -96
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_models.py +5 -2
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_version.py +1 -1
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/helpers.py +12 -1
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/ingest.py +48 -6
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_models.py +32 -0
- payi-0.1.0a53/.release-please-manifest.json +0 -3
- payi-0.1.0a53/bin/publish-pypi +0 -9
- {payi-0.1.0a53 → payi-0.1.0a55}/.gitignore +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/LICENSE +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/SECURITY.md +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/api.md +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/bin/check-release-environment +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/examples/.keep +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/mypy.ini +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/noxfile.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/release-please-config.json +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/requirements-dev.lock +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/requirements.lock +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_client.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_compat.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_constants.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_files.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_qs.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_resource.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_types.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_reflection.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/AnthropicInstrumentor.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/BedrockInstrumentor.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/OpenAIInstrumentor.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/Stopwatch.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/lib/instrument.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/py.typed +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/billing_models.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/categories/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/categories/categories.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/categories/resources.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/experiences/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/experiences/experiences.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/experiences/properties.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/experiences/types/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/experiences/types/limit_config.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/experiences/types/types.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/limits/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/limits/limits.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/limits/tags.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/price_modifiers.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/requests/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/requests/properties.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/requests/requests.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/resources/requests/result.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/billing_model.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/billing_model_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/billing_model_list_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/billing_model_update_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/bulk_ingest_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/categories/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/categories/resource_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/categories/resource_list_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/category_delete_resource_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/category_delete_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/category_list_resources_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/category_list_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/category_resource_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/category_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/cost_data.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experience_instance_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/experience_type.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/properties_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/property_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/type_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/type_list_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/type_list_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/type_update_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/types/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/types/limit_config_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/ingest_bulk_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/ingest_event_param.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/ingest_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/ingest_units_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limit_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limit_history_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limit_list_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limit_reset_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limit_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limit_update_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/limit_tags.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_create_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_delete_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_list_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_remove_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_remove_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_update_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/limits/tag_update_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/paged_limit_list.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/pay_i_common_models_api_router_header_info_param.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/price_modifier.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/price_modifier_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/price_modifier_retrieve_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/price_modifier_update_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/requests/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/requests/property_create_params.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/requests/request_result.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/requests_data.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/shared/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/shared/evaluation_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/total_cost_data.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/categories/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/categories/test_resources.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/experiences/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/experiences/test_properties.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/experiences/test_types.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/experiences/types/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/experiences/types/test_limit_config.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/limits/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/limits/test_tags.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/requests/__init__.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/requests/test_properties.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/requests/test_result.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/test_billing_models.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/test_categories.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/test_experiences.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/test_ingest.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/test_limits.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/api_resources/test_price_modifiers.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/conftest.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/sample_file.txt +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_client.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_files.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_qs.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_required_args.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_response.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_streaming.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_transform.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a53 → payi-0.1.0a55}/tests/utils.py +0 -0
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.55 (2025-03-19)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.54...v0.1.0-alpha.55](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.54...v0.1.0-alpha.55)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **ci:** remove publishing patch ([#257](https://github.com/Pay-i/pay-i-python/issues/257)) ([0c5bfb4](https://github.com/Pay-i/pay-i-python/commit/0c5bfb4725777b366fb50199209f4e8a50711ad9))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.54 (2025-03-17)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.1.0-alpha.53...v0.1.0-alpha.54](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.53...v0.1.0-alpha.54)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **ci:** ensure pip is always available ([#256](https://github.com/Pay-i/pay-i-python/issues/256)) ([13c3e2c](https://github.com/Pay-i/pay-i-python/commit/13c3e2c3c83f97bc0add1a7e670113e609e3c5d1))
|
|
18
|
+
* **types:** handle more discriminated union shapes ([#255](https://github.com/Pay-i/pay-i-python/issues/255)) ([be986f1](https://github.com/Pay-i/pay-i-python/commit/be986f12ea82af0a7a51e7b08803758381050086))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Chores
|
|
22
|
+
|
|
23
|
+
* **internal:** bump rye to 0.44.0 ([#254](https://github.com/Pay-i/pay-i-python/issues/254)) ([789c413](https://github.com/Pay-i/pay-i-python/commit/789c413b306c96905507c1b4de8c835cc484b2b8))
|
|
24
|
+
* **internal:** remove extra empty newlines ([#252](https://github.com/Pay-i/pay-i-python/issues/252)) ([8b33100](https://github.com/Pay-i/pay-i-python/commit/8b33100d0fee1693e3adc9fc6c652bd4150a2642))
|
|
25
|
+
* **internal:** remove unused http client options forwarding ([#248](https://github.com/Pay-i/pay-i-python/issues/248)) ([5f7bf7b](https://github.com/Pay-i/pay-i-python/commit/5f7bf7b9d3745fd3d63c49502bbc9b63ff8cd333))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Documentation
|
|
29
|
+
|
|
30
|
+
* revise readme docs about nested params ([#250](https://github.com/Pay-i/pay-i-python/issues/250)) ([19c655d](https://github.com/Pay-i/pay-i-python/commit/19c655d13bbe82916c599a5b9f8292057f7b4b0e))
|
|
31
|
+
|
|
3
32
|
## 0.1.0-alpha.53 (2025-03-01)
|
|
4
33
|
|
|
5
34
|
Full Changelog: [v0.1.0-alpha.52...v0.1.0-alpha.53](https://github.com/pay-i/pay-i-python/compare/v0.1.0-alpha.52...v0.1.0-alpha.53)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a55
|
|
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
|
|
7
7
|
Author-email: Payi <support@payi.com>
|
|
8
|
-
License
|
|
9
|
-
License-File: LICENSE
|
|
8
|
+
License: Apache-2.0
|
|
10
9
|
Classifier: Intended Audience :: Developers
|
|
11
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
11
|
Classifier: Operating System :: MacOS
|
|
@@ -114,6 +113,28 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
|
|
|
114
113
|
|
|
115
114
|
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
|
116
115
|
|
|
116
|
+
## Nested params
|
|
117
|
+
|
|
118
|
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from payi import Payi
|
|
122
|
+
|
|
123
|
+
client = Payi()
|
|
124
|
+
|
|
125
|
+
experience_type = client.experiences.types.create(
|
|
126
|
+
description="x",
|
|
127
|
+
name="x",
|
|
128
|
+
limit_config={
|
|
129
|
+
"max": 0,
|
|
130
|
+
"limit_tags": ["tag1", "tag2"],
|
|
131
|
+
"limit_type": "block",
|
|
132
|
+
"threshold": 0,
|
|
133
|
+
},
|
|
134
|
+
)
|
|
135
|
+
print(experience_type.limit_config)
|
|
136
|
+
```
|
|
137
|
+
|
|
117
138
|
## Handling errors
|
|
118
139
|
|
|
119
140
|
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `payi.APIConnectionError` is raised.
|
|
@@ -79,6 +79,28 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
|
|
|
79
79
|
|
|
80
80
|
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
|
81
81
|
|
|
82
|
+
## Nested params
|
|
83
|
+
|
|
84
|
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from payi import Payi
|
|
88
|
+
|
|
89
|
+
client = Payi()
|
|
90
|
+
|
|
91
|
+
experience_type = client.experiences.types.create(
|
|
92
|
+
description="x",
|
|
93
|
+
name="x",
|
|
94
|
+
limit_config={
|
|
95
|
+
"max": 0,
|
|
96
|
+
"limit_tags": ["tag1", "tag2"],
|
|
97
|
+
"limit_type": "block",
|
|
98
|
+
"threshold": 0,
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
print(experience_type.limit_config)
|
|
102
|
+
```
|
|
103
|
+
|
|
82
104
|
## Handling errors
|
|
83
105
|
|
|
84
106
|
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `payi.APIConnectionError` is raised.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "payi"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.55"
|
|
4
4
|
description = "The official Python library for the payi API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -41,7 +41,6 @@ Homepage = "https://github.com/Pay-i/pay-i-python"
|
|
|
41
41
|
Repository = "https://github.com/Pay-i/pay-i-python"
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
[tool.rye]
|
|
46
45
|
managed = true
|
|
47
46
|
# version pins are in requirements-dev.lock
|
|
@@ -91,7 +90,7 @@ typecheck = { chain = [
|
|
|
91
90
|
"typecheck:mypy" = "mypy ."
|
|
92
91
|
|
|
93
92
|
[build-system]
|
|
94
|
-
requires = ["hatchling", "hatch-fancy-pypi-readme"]
|
|
93
|
+
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
|
|
95
94
|
build-backend = "hatchling.build"
|
|
96
95
|
|
|
97
96
|
[tool.hatch.build]
|
|
@@ -156,7 +155,6 @@ reportImplicitOverride = true
|
|
|
156
155
|
reportImportCycles = false
|
|
157
156
|
reportPrivateUsage = false
|
|
158
157
|
|
|
159
|
-
|
|
160
158
|
[tool.ruff]
|
|
161
159
|
line-length = 120
|
|
162
160
|
output-format = "grouped"
|
|
@@ -9,7 +9,6 @@ import asyncio
|
|
|
9
9
|
import inspect
|
|
10
10
|
import logging
|
|
11
11
|
import platform
|
|
12
|
-
import warnings
|
|
13
12
|
import email.utils
|
|
14
13
|
from types import TracebackType
|
|
15
14
|
from random import random
|
|
@@ -36,7 +35,7 @@ import anyio
|
|
|
36
35
|
import httpx
|
|
37
36
|
import distro
|
|
38
37
|
import pydantic
|
|
39
|
-
from httpx import URL
|
|
38
|
+
from httpx import URL
|
|
40
39
|
from pydantic import PrivateAttr
|
|
41
40
|
|
|
42
41
|
from . import _exceptions
|
|
@@ -51,13 +50,10 @@ from ._types import (
|
|
|
51
50
|
Timeout,
|
|
52
51
|
NotGiven,
|
|
53
52
|
ResponseT,
|
|
54
|
-
Transport,
|
|
55
53
|
AnyMapping,
|
|
56
54
|
PostParser,
|
|
57
|
-
ProxiesTypes,
|
|
58
55
|
RequestFiles,
|
|
59
56
|
HttpxSendArgs,
|
|
60
|
-
AsyncTransport,
|
|
61
57
|
RequestOptions,
|
|
62
58
|
HttpxRequestFiles,
|
|
63
59
|
ModelBuilderProtocol,
|
|
@@ -337,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
337
333
|
_base_url: URL
|
|
338
334
|
max_retries: int
|
|
339
335
|
timeout: Union[float, Timeout, None]
|
|
340
|
-
_limits: httpx.Limits
|
|
341
|
-
_proxies: ProxiesTypes | None
|
|
342
|
-
_transport: Transport | AsyncTransport | None
|
|
343
336
|
_strict_response_validation: bool
|
|
344
337
|
_idempotency_header: str | None
|
|
345
338
|
_default_stream_cls: type[_DefaultStreamT] | None = None
|
|
@@ -352,9 +345,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
352
345
|
_strict_response_validation: bool,
|
|
353
346
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
354
347
|
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
|
|
355
|
-
limits: httpx.Limits,
|
|
356
|
-
transport: Transport | AsyncTransport | None,
|
|
357
|
-
proxies: ProxiesTypes | None,
|
|
358
348
|
custom_headers: Mapping[str, str] | None = None,
|
|
359
349
|
custom_query: Mapping[str, object] | None = None,
|
|
360
350
|
) -> None:
|
|
@@ -362,9 +352,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
362
352
|
self._base_url = self._enforce_trailing_slash(URL(base_url))
|
|
363
353
|
self.max_retries = max_retries
|
|
364
354
|
self.timeout = timeout
|
|
365
|
-
self._limits = limits
|
|
366
|
-
self._proxies = proxies
|
|
367
|
-
self._transport = transport
|
|
368
355
|
self._custom_headers = custom_headers or {}
|
|
369
356
|
self._custom_query = custom_query or {}
|
|
370
357
|
self._strict_response_validation = _strict_response_validation
|
|
@@ -800,46 +787,11 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
800
787
|
base_url: str | URL,
|
|
801
788
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
802
789
|
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
|
803
|
-
transport: Transport | None = None,
|
|
804
|
-
proxies: ProxiesTypes | None = None,
|
|
805
|
-
limits: Limits | None = None,
|
|
806
790
|
http_client: httpx.Client | None = None,
|
|
807
791
|
custom_headers: Mapping[str, str] | None = None,
|
|
808
792
|
custom_query: Mapping[str, object] | None = None,
|
|
809
793
|
_strict_response_validation: bool,
|
|
810
794
|
) -> None:
|
|
811
|
-
kwargs: dict[str, Any] = {}
|
|
812
|
-
if limits is not None:
|
|
813
|
-
warnings.warn(
|
|
814
|
-
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
|
|
815
|
-
category=DeprecationWarning,
|
|
816
|
-
stacklevel=3,
|
|
817
|
-
)
|
|
818
|
-
if http_client is not None:
|
|
819
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
|
|
820
|
-
else:
|
|
821
|
-
limits = DEFAULT_CONNECTION_LIMITS
|
|
822
|
-
|
|
823
|
-
if transport is not None:
|
|
824
|
-
kwargs["transport"] = transport
|
|
825
|
-
warnings.warn(
|
|
826
|
-
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
|
|
827
|
-
category=DeprecationWarning,
|
|
828
|
-
stacklevel=3,
|
|
829
|
-
)
|
|
830
|
-
if http_client is not None:
|
|
831
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
|
|
832
|
-
|
|
833
|
-
if proxies is not None:
|
|
834
|
-
kwargs["proxies"] = proxies
|
|
835
|
-
warnings.warn(
|
|
836
|
-
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
|
|
837
|
-
category=DeprecationWarning,
|
|
838
|
-
stacklevel=3,
|
|
839
|
-
)
|
|
840
|
-
if http_client is not None:
|
|
841
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
|
|
842
|
-
|
|
843
795
|
if not is_given(timeout):
|
|
844
796
|
# if the user passed in a custom http client with a non-default
|
|
845
797
|
# timeout set then we use that timeout.
|
|
@@ -860,12 +812,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
860
812
|
|
|
861
813
|
super().__init__(
|
|
862
814
|
version=version,
|
|
863
|
-
limits=limits,
|
|
864
815
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
865
816
|
timeout=cast(Timeout, timeout),
|
|
866
|
-
proxies=proxies,
|
|
867
817
|
base_url=base_url,
|
|
868
|
-
transport=transport,
|
|
869
818
|
max_retries=max_retries,
|
|
870
819
|
custom_query=custom_query,
|
|
871
820
|
custom_headers=custom_headers,
|
|
@@ -875,9 +824,6 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
875
824
|
base_url=base_url,
|
|
876
825
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
877
826
|
timeout=cast(Timeout, timeout),
|
|
878
|
-
limits=limits,
|
|
879
|
-
follow_redirects=True,
|
|
880
|
-
**kwargs, # type: ignore
|
|
881
827
|
)
|
|
882
828
|
|
|
883
829
|
def is_closed(self) -> bool:
|
|
@@ -1372,45 +1318,10 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1372
1318
|
_strict_response_validation: bool,
|
|
1373
1319
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
1374
1320
|
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
|
1375
|
-
transport: AsyncTransport | None = None,
|
|
1376
|
-
proxies: ProxiesTypes | None = None,
|
|
1377
|
-
limits: Limits | None = None,
|
|
1378
1321
|
http_client: httpx.AsyncClient | None = None,
|
|
1379
1322
|
custom_headers: Mapping[str, str] | None = None,
|
|
1380
1323
|
custom_query: Mapping[str, object] | None = None,
|
|
1381
1324
|
) -> None:
|
|
1382
|
-
kwargs: dict[str, Any] = {}
|
|
1383
|
-
if limits is not None:
|
|
1384
|
-
warnings.warn(
|
|
1385
|
-
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1386
|
-
category=DeprecationWarning,
|
|
1387
|
-
stacklevel=3,
|
|
1388
|
-
)
|
|
1389
|
-
if http_client is not None:
|
|
1390
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
|
|
1391
|
-
else:
|
|
1392
|
-
limits = DEFAULT_CONNECTION_LIMITS
|
|
1393
|
-
|
|
1394
|
-
if transport is not None:
|
|
1395
|
-
kwargs["transport"] = transport
|
|
1396
|
-
warnings.warn(
|
|
1397
|
-
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1398
|
-
category=DeprecationWarning,
|
|
1399
|
-
stacklevel=3,
|
|
1400
|
-
)
|
|
1401
|
-
if http_client is not None:
|
|
1402
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
|
|
1403
|
-
|
|
1404
|
-
if proxies is not None:
|
|
1405
|
-
kwargs["proxies"] = proxies
|
|
1406
|
-
warnings.warn(
|
|
1407
|
-
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1408
|
-
category=DeprecationWarning,
|
|
1409
|
-
stacklevel=3,
|
|
1410
|
-
)
|
|
1411
|
-
if http_client is not None:
|
|
1412
|
-
raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
|
|
1413
|
-
|
|
1414
1325
|
if not is_given(timeout):
|
|
1415
1326
|
# if the user passed in a custom http client with a non-default
|
|
1416
1327
|
# timeout set then we use that timeout.
|
|
@@ -1432,11 +1343,8 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1432
1343
|
super().__init__(
|
|
1433
1344
|
version=version,
|
|
1434
1345
|
base_url=base_url,
|
|
1435
|
-
limits=limits,
|
|
1436
1346
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
1437
1347
|
timeout=cast(Timeout, timeout),
|
|
1438
|
-
proxies=proxies,
|
|
1439
|
-
transport=transport,
|
|
1440
1348
|
max_retries=max_retries,
|
|
1441
1349
|
custom_query=custom_query,
|
|
1442
1350
|
custom_headers=custom_headers,
|
|
@@ -1446,9 +1354,6 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1446
1354
|
base_url=base_url,
|
|
1447
1355
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
1448
1356
|
timeout=cast(Timeout, timeout),
|
|
1449
|
-
limits=limits,
|
|
1450
|
-
follow_redirects=True,
|
|
1451
|
-
**kwargs, # type: ignore
|
|
1452
1357
|
)
|
|
1453
1358
|
|
|
1454
1359
|
def is_closed(self) -> bool:
|
|
@@ -65,7 +65,7 @@ from ._compat import (
|
|
|
65
65
|
from ._constants import RAW_RESPONSE_HEADER
|
|
66
66
|
|
|
67
67
|
if TYPE_CHECKING:
|
|
68
|
-
from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema
|
|
68
|
+
from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
|
|
69
69
|
|
|
70
70
|
__all__ = ["BaseModel", "GenericModel"]
|
|
71
71
|
|
|
@@ -646,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|
|
646
646
|
|
|
647
647
|
def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None:
|
|
648
648
|
schema = model.__pydantic_core_schema__
|
|
649
|
+
if schema["type"] == "definitions":
|
|
650
|
+
schema = schema["schema"]
|
|
651
|
+
|
|
649
652
|
if schema["type"] != "model":
|
|
650
653
|
return None
|
|
651
654
|
|
|
655
|
+
schema = cast("ModelSchema", schema)
|
|
652
656
|
fields_schema = schema["schema"]
|
|
653
657
|
if fields_schema["type"] != "model-fields":
|
|
654
658
|
return None
|
|
655
659
|
|
|
656
660
|
fields_schema = cast("ModelFieldsSchema", fields_schema)
|
|
657
|
-
|
|
658
661
|
field = fields_schema["fields"].get(field_name)
|
|
659
662
|
if not field:
|
|
660
663
|
return None
|
|
@@ -7,6 +7,9 @@ class PayiHeaderNames:
|
|
|
7
7
|
request_tags:str = "xProxy-Request-Tags"
|
|
8
8
|
experience_id:str = "xProxy-Experience-ID"
|
|
9
9
|
experience_name:str = "xProxy-Experience-Name"
|
|
10
|
+
use_case_id:str = "xProxy-UseCase-ID"
|
|
11
|
+
use_case_name:str = "xProxy-UseCase-Name"
|
|
12
|
+
use_case_version:str = "xProxy-UseCase-Version"
|
|
10
13
|
user_id:str = "xProxy-User-ID"
|
|
11
14
|
route_as_resource:str = "xProxy-RouteAs-Resource"
|
|
12
15
|
provider_base_uri = "xProxy-Provider-BaseUri"
|
|
@@ -42,6 +45,9 @@ def create_headers(
|
|
|
42
45
|
user_id: Union[str, None] = None,
|
|
43
46
|
experience_id: Union[str, None] = None,
|
|
44
47
|
experience_name: Union[str, None] = None,
|
|
48
|
+
use_case_id: Union[str, None] = None,
|
|
49
|
+
use_case_name: Union[str, None] = None,
|
|
50
|
+
use_case_version: Union[str, None] = None,
|
|
45
51
|
) -> Dict[str, str]:
|
|
46
52
|
headers: Dict[str, str] = {}
|
|
47
53
|
|
|
@@ -55,7 +61,12 @@ def create_headers(
|
|
|
55
61
|
headers.update({ PayiHeaderNames.experience_id: experience_id})
|
|
56
62
|
if experience_name:
|
|
57
63
|
headers.update({ PayiHeaderNames.experience_name: experience_name})
|
|
58
|
-
|
|
64
|
+
if use_case_id:
|
|
65
|
+
headers.update({ PayiHeaderNames.use_case_id: use_case_id})
|
|
66
|
+
if use_case_name:
|
|
67
|
+
headers.update({ PayiHeaderNames.use_case_name: use_case_name})
|
|
68
|
+
if use_case_version:
|
|
69
|
+
headers.update({ PayiHeaderNames.use_case_version: use_case_version})
|
|
59
70
|
return headers
|
|
60
71
|
|
|
61
72
|
def payi_anthropic_url(payi_base_url: Union[str, None] = None) -> str:
|
|
@@ -105,6 +105,9 @@ class IngestResource(SyncAPIResource):
|
|
|
105
105
|
request_tags: Optional[list[str]] | NotGiven = NOT_GIVEN,
|
|
106
106
|
experience_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
107
107
|
experience_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
108
|
+
use_case__id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
109
|
+
use_case_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
110
|
+
use_case_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
108
111
|
user_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
109
112
|
resource_scope: Optional[str] | NotGiven = NOT_GIVEN,
|
|
110
113
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -132,9 +135,15 @@ class IngestResource(SyncAPIResource):
|
|
|
132
135
|
|
|
133
136
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
134
137
|
|
|
135
|
-
experience_name (str, optional):
|
|
138
|
+
experience_name (str, optional): DEPRECATED, replaced with use_case_name.
|
|
136
139
|
|
|
137
|
-
experience_id (str, optional):
|
|
140
|
+
experience_id (str, optional): DEPRECATED, replaced with use_case_id.
|
|
141
|
+
|
|
142
|
+
use_case_name (str, optional): The use case name
|
|
143
|
+
|
|
144
|
+
use_case_id (str, optional): The use case instance id
|
|
145
|
+
|
|
146
|
+
use_case_version (str, optional): The use case instance version
|
|
138
147
|
|
|
139
148
|
user_id (str, optional): The user id
|
|
140
149
|
|
|
@@ -175,6 +184,15 @@ class IngestResource(SyncAPIResource):
|
|
|
175
184
|
if experience_id is None or isinstance(experience_id, NotGiven):
|
|
176
185
|
experience_id = NOT_GIVEN
|
|
177
186
|
|
|
187
|
+
if use_case_name is None or isinstance(use_case_name, NotGiven):
|
|
188
|
+
use_case_name = NOT_GIVEN
|
|
189
|
+
|
|
190
|
+
if use_case__id is None or isinstance(use_case__id, NotGiven):
|
|
191
|
+
use_case__id = NOT_GIVEN
|
|
192
|
+
|
|
193
|
+
if use_case_version is None or isinstance(use_case_version, NotGiven):
|
|
194
|
+
use_case_version = NOT_GIVEN
|
|
195
|
+
|
|
178
196
|
if user_id is None or isinstance(user_id, NotGiven):
|
|
179
197
|
user_id = NOT_GIVEN
|
|
180
198
|
|
|
@@ -183,7 +201,10 @@ class IngestResource(SyncAPIResource):
|
|
|
183
201
|
"xProxy-Limit-IDs": valid_ids_str,
|
|
184
202
|
"xProxy-Request-Tags": valid_tags_str,
|
|
185
203
|
"xProxy-Experience-Name": experience_name,
|
|
186
|
-
"xProxy-Experience-
|
|
204
|
+
"xProxy-Experience-ID": experience_id,
|
|
205
|
+
"xProxy-UseCase-ID": use_case__id,
|
|
206
|
+
"xProxy-UseCase-Name": use_case_name,
|
|
207
|
+
"xProxy-UseCase-Version": use_case_version,
|
|
187
208
|
"xProxy-User-ID": user_id,
|
|
188
209
|
"xProxy-Resource-Scope": resource_scope,
|
|
189
210
|
}).items() if value is not None}, # Ensure no 'None' values are included
|
|
@@ -293,6 +314,9 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
293
314
|
request_tags: Optional[list[str]] | NotGiven = NOT_GIVEN,
|
|
294
315
|
experience_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
295
316
|
experience_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
317
|
+
use_case_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
318
|
+
use_case_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
319
|
+
use_case_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
296
320
|
user_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
297
321
|
resource_scope: Union[str, None] | NotGiven = NOT_GIVEN,
|
|
298
322
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -319,9 +343,15 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
319
343
|
|
|
320
344
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
321
345
|
|
|
322
|
-
experience_name (str, optional):
|
|
346
|
+
experience_name (str, optional): DEPRECATED, replaced with use_case_name.
|
|
347
|
+
|
|
348
|
+
experience_id (str, optional): DEPRECATED, replaced with use_case_id.
|
|
323
349
|
|
|
324
|
-
|
|
350
|
+
use_case_name (str, optional): The use case name
|
|
351
|
+
|
|
352
|
+
use_case_id (str, optional): The use case instance id
|
|
353
|
+
|
|
354
|
+
use_case_version (str, optional): The use case instance version
|
|
325
355
|
|
|
326
356
|
user_id (str, optional): The user id
|
|
327
357
|
|
|
@@ -362,6 +392,15 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
362
392
|
if experience_id is None or isinstance(experience_id, NotGiven):
|
|
363
393
|
experience_id = NOT_GIVEN
|
|
364
394
|
|
|
395
|
+
if use_case_name is None or isinstance(use_case_name, NotGiven):
|
|
396
|
+
use_case_name = NOT_GIVEN
|
|
397
|
+
|
|
398
|
+
if use_case_id is None or isinstance(use_case_id, NotGiven):
|
|
399
|
+
use_case_id = NOT_GIVEN
|
|
400
|
+
|
|
401
|
+
if use_case_version is None or isinstance(use_case_version, NotGiven):
|
|
402
|
+
use_case_version = NOT_GIVEN
|
|
403
|
+
|
|
365
404
|
if user_id is None or isinstance(user_id, NotGiven):
|
|
366
405
|
user_id = NOT_GIVEN
|
|
367
406
|
|
|
@@ -370,7 +409,10 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
370
409
|
"xProxy-Limit-IDs": valid_ids_str,
|
|
371
410
|
"xProxy-Request-Tags": valid_tags_str,
|
|
372
411
|
"xProxy-Experience-Name": experience_name,
|
|
373
|
-
"xProxy-Experience-
|
|
412
|
+
"xProxy-Experience-ID": experience_id,
|
|
413
|
+
"xProxy-UseCase-ID": use_case_id,
|
|
414
|
+
"xProxy-UseCase-Name": use_case_name,
|
|
415
|
+
"xProxy-UseCase-Version": use_case_version,
|
|
374
416
|
"xProxy-User-ID": user_id,
|
|
375
417
|
"xProxy-Resource-Scope": resource_scope,
|
|
376
418
|
}).items() if value is not None}, # Ensure no 'None' values are included
|
|
@@ -854,3 +854,35 @@ def test_field_named_cls() -> None:
|
|
|
854
854
|
m = construct_type(value={"cls": "foo"}, type_=Model)
|
|
855
855
|
assert isinstance(m, Model)
|
|
856
856
|
assert isinstance(m.cls, str)
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
def test_discriminated_union_case() -> None:
|
|
860
|
+
class A(BaseModel):
|
|
861
|
+
type: Literal["a"]
|
|
862
|
+
|
|
863
|
+
data: bool
|
|
864
|
+
|
|
865
|
+
class B(BaseModel):
|
|
866
|
+
type: Literal["b"]
|
|
867
|
+
|
|
868
|
+
data: List[Union[A, object]]
|
|
869
|
+
|
|
870
|
+
class ModelA(BaseModel):
|
|
871
|
+
type: Literal["modelA"]
|
|
872
|
+
|
|
873
|
+
data: int
|
|
874
|
+
|
|
875
|
+
class ModelB(BaseModel):
|
|
876
|
+
type: Literal["modelB"]
|
|
877
|
+
|
|
878
|
+
required: str
|
|
879
|
+
|
|
880
|
+
data: Union[A, B]
|
|
881
|
+
|
|
882
|
+
# when constructing ModelA | ModelB, value data doesn't match ModelB exactly - missing `required`
|
|
883
|
+
m = construct_type(
|
|
884
|
+
value={"type": "modelB", "data": {"type": "a", "data": True}},
|
|
885
|
+
type_=cast(Any, Annotated[Union[ModelA, ModelB], PropertyInfo(discriminator="type")]),
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
assert isinstance(m, ModelB)
|
payi-0.1.0a53/bin/publish-pypi
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -eux
|
|
4
|
-
mkdir -p dist
|
|
5
|
-
rye build --clean
|
|
6
|
-
# Patching importlib-metadata version until upstream library version is updated
|
|
7
|
-
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
|
|
8
|
-
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
|
|
9
|
-
rye publish --yes --token=$PYPI_TOKEN
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/experiences/types/limit_config_create_params.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
|
|
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
|
{payi-0.1.0a53 → payi-0.1.0a55}/src/payi/types/pay_i_common_models_api_router_header_info_param.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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|