payi 0.1.0a14__tar.gz → 0.1.0a16__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.0a16/.release-please-manifest.json +3 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/CHANGELOG.md +28 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/PKG-INFO +1 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/api.md +34 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/pyproject.toml +8 -6
- {payi-0.1.0a14 → payi-0.1.0a16}/requirements-dev.lock +2 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_base_client.py +29 -42
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_client.py +8 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_compat.py +12 -17
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_files.py +4 -8
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_response.py +9 -8
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_types.py +3 -6
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_proxy.py +1 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_reflection.py +1 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_utils.py +6 -12
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_version.py +1 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/__init__.py +14 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/budgets/budgets.py +2 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/categories/resources.py +4 -4
- payi-0.1.0a16/src/payi/resources/experiences/__init__.py +33 -0
- payi-0.1.0a16/src/payi/resources/experiences/experiences.py +325 -0
- payi-0.1.0a16/src/payi/resources/experiences/types.py +459 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/ingest.py +101 -8
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/__init__.py +5 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budget_create_params.py +1 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budget_history_response.py +3 -26
- payi-0.1.0a16/src/payi/types/budget_list_params.py +21 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budget_response.py +3 -26
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_create_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_delete_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_list_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_remove_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_update_response.py +2 -1
- payi-0.1.0a16/src/payi/types/bulk_ingest_response.py +44 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/categories/resource_create_params.py +2 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/categories/resource_list_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/category_delete_resource_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/category_delete_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/category_list_resources_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/category_list_response.py +2 -1
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/category_resource_response.py +2 -2
- payi-0.1.0a16/src/payi/types/experience_instance.py +13 -0
- payi-0.1.0a16/src/payi/types/experiences/__init__.py +8 -0
- payi-0.1.0a16/src/payi/types/experiences/experience_type.py +17 -0
- payi-0.1.0a16/src/payi/types/experiences/type_create_params.py +14 -0
- payi-0.1.0a16/src/payi/types/experiences/type_list_response.py +10 -0
- payi-0.1.0a16/src/payi/types/experiences/type_update_params.py +14 -0
- payi-0.1.0a16/src/payi/types/ingest_bulk_params.py +34 -0
- payi-0.1.0a14/src/payi/types/proxy_result.py → payi-0.1.0a16/src/payi/types/ingest_response.py +17 -6
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/paged_budget_list.py +3 -26
- payi-0.1.0a16/src/payi/types/total_cost_data.py +31 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/categories/test_resources.py +2 -12
- payi-0.1.0a16/tests/api_resources/experiences/__init__.py +1 -0
- payi-0.1.0a16/tests/api_resources/experiences/test_types.py +342 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/test_budgets.py +8 -8
- payi-0.1.0a16/tests/api_resources/test_experiences.py +208 -0
- payi-0.1.0a16/tests/api_resources/test_ingest.py +305 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_client.py +50 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_deepcopy.py +1 -2
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_response.py +4 -8
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_utils/test_typing.py +5 -10
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/utils.py +7 -3
- payi-0.1.0a14/.release-please-manifest.json +0 -3
- payi-0.1.0a14/src/payi/types/budget_list_params.py +0 -23
- payi-0.1.0a14/tests/api_resources/test_ingest.py +0 -129
- {payi-0.1.0a14 → payi-0.1.0a16}/.gitignore +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/LICENSE +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/README.md +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/SECURITY.md +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/bin/check-release-environment +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/bin/publish-pypi +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/examples/.keep +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/mypy.ini +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/noxfile.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/release-please-config.json +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/requirements.lock +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_constants.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_models.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_qs.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_resource.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/lib/helpers.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/py.typed +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/budgets/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/budgets/tags.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/categories/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/resources/categories/categories.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budget_update_params.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/budget_tags.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_create_params.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_remove_params.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/budgets/tag_update_params.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/categories/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/category_response.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/cost_data.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/ingest_units_params.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/src/payi/types/requests_data.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/budgets/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/budgets/test_tags.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/categories/__init__.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/api_resources/test_categories.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/conftest.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/sample_file.txt +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_files.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_models.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_qs.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_required_args.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_streaming.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_transform.py +0 -0
- {payi-0.1.0a14 → payi-0.1.0a16}/tests/test_utils/test_proxy.py +0 -0
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.16 (2024-08-07)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.15...v0.1.0-alpha.16](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.15...v0.1.0-alpha.16)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update via SDK Studio ([#67](https://github.com/Pay-i/pay-i-python/issues/67)) ([b720656](https://github.com/Pay-i/pay-i-python/commit/b72065621d50902959a484a5fe4c05051a5e2caa))
|
|
10
|
+
* **client:** add `retry_count` to raw response class ([#71](https://github.com/Pay-i/pay-i-python/issues/71)) ([88fdd1d](https://github.com/Pay-i/pay-i-python/commit/88fdd1df022c74e173db8697659dfba937f73be7))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Chores
|
|
14
|
+
|
|
15
|
+
* **internal:** bump pyright ([#70](https://github.com/Pay-i/pay-i-python/issues/70)) ([28a35f0](https://github.com/Pay-i/pay-i-python/commit/28a35f0d6412c3fd2d0b0f696b5b723069ce7b98))
|
|
16
|
+
* **internal:** bump ruff version ([#73](https://github.com/Pay-i/pay-i-python/issues/73)) ([f487b64](https://github.com/Pay-i/pay-i-python/commit/f487b6409b3d6ac4eb3378e0eace4f68fbd3342f))
|
|
17
|
+
* **internal:** test updates ([#72](https://github.com/Pay-i/pay-i-python/issues/72)) ([1ded1fe](https://github.com/Pay-i/pay-i-python/commit/1ded1feade7fb2ad98e2e9eb3d2a4c957146cfb8))
|
|
18
|
+
* **internal:** update pydantic compat helper function ([#74](https://github.com/Pay-i/pay-i-python/issues/74)) ([16f34b3](https://github.com/Pay-i/pay-i-python/commit/16f34b307bd097cbd0ed81328972727c3ccec581))
|
|
19
|
+
* **internal:** use `TypeAlias` marker for type assignments ([#69](https://github.com/Pay-i/pay-i-python/issues/69)) ([eebb6e9](https://github.com/Pay-i/pay-i-python/commit/eebb6e95c4e8ad497dc178099923e036644bfd4a))
|
|
20
|
+
|
|
21
|
+
## 0.1.0-alpha.15 (2024-08-06)
|
|
22
|
+
|
|
23
|
+
Full Changelog: [v0.1.0-alpha.14...v0.1.0-alpha.15](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.14...v0.1.0-alpha.15)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **api:** update via SDK Studio ([#63](https://github.com/Pay-i/pay-i-python/issues/63)) ([a38f132](https://github.com/Pay-i/pay-i-python/commit/a38f132cdbbbcac2c235c71cd758c38631b12a57))
|
|
28
|
+
* **api:** update via SDK Studio ([#65](https://github.com/Pay-i/pay-i-python/issues/65)) ([d32f303](https://github.com/Pay-i/pay-i-python/commit/d32f3032d3cb5854617e65e9766447d8ea08f41c))
|
|
29
|
+
* **api:** update via SDK Studio ([#66](https://github.com/Pay-i/pay-i-python/issues/66)) ([990a0cb](https://github.com/Pay-i/pay-i-python/commit/990a0cbcfb381f6f72530d869a7beaae6f9fed2d))
|
|
30
|
+
|
|
3
31
|
## 0.1.0-alpha.14 (2024-07-30)
|
|
4
32
|
|
|
5
33
|
Full Changelog: [v0.1.0-alpha.13...v0.1.0-alpha.14](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.13...v0.1.0-alpha.14)
|
|
@@ -11,6 +11,7 @@ from payi.types import (
|
|
|
11
11
|
DefaultResponse,
|
|
12
12
|
PagedBudgetList,
|
|
13
13
|
RequestsData,
|
|
14
|
+
TotalCostData,
|
|
14
15
|
)
|
|
15
16
|
```
|
|
16
17
|
|
|
@@ -51,12 +52,13 @@ Methods:
|
|
|
51
52
|
Types:
|
|
52
53
|
|
|
53
54
|
```python
|
|
54
|
-
from payi.types import
|
|
55
|
+
from payi.types import BulkIngestResponse, IngestEvent, IngestResponse
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
Methods:
|
|
58
59
|
|
|
59
|
-
- <code title="post /api/v1/ingest">client.ingest.<a href="./src/payi/resources/ingest.py">
|
|
60
|
+
- <code title="post /api/v1/ingest/bulk">client.ingest.<a href="./src/payi/resources/ingest.py">bulk</a>(\*\*<a href="src/payi/types/ingest_bulk_params.py">params</a>) -> <a href="./src/payi/types/bulk_ingest_response.py">BulkIngestResponse</a></code>
|
|
61
|
+
- <code title="post /api/v1/ingest">client.ingest.<a href="./src/payi/resources/ingest.py">units</a>(\*\*<a href="src/payi/types/ingest_units_params.py">params</a>) -> <a href="./src/payi/types/ingest_response.py">IngestResponse</a></code>
|
|
60
62
|
|
|
61
63
|
# Categories
|
|
62
64
|
|
|
@@ -94,3 +96,33 @@ Methods:
|
|
|
94
96
|
- <code title="get /api/v1/categories/{category}/resources/{resource}/{start_timestamp}">client.categories.resources.<a href="./src/payi/resources/categories/resources.py">retrieve</a>(start_timestamp, \*, category, resource) -> <a href="./src/payi/types/category_resource_response.py">CategoryResourceResponse</a></code>
|
|
95
97
|
- <code title="get /api/v1/categories/{category}/resources/{resource}">client.categories.resources.<a href="./src/payi/resources/categories/resources.py">list</a>(resource, \*, category) -> <a href="./src/payi/types/categories/resource_list_response.py">ResourceListResponse</a></code>
|
|
96
98
|
- <code title="delete /api/v1/categories/{category}/resources/{resource}/{start_timestamp}">client.categories.resources.<a href="./src/payi/resources/categories/resources.py">delete</a>(start_timestamp, \*, category, resource) -> <a href="./src/payi/types/category_resource_response.py">CategoryResourceResponse</a></code>
|
|
99
|
+
|
|
100
|
+
# Experiences
|
|
101
|
+
|
|
102
|
+
Types:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from payi.types import ExperienceInstance
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Methods:
|
|
109
|
+
|
|
110
|
+
- <code title="post /api/v1/experiences/instances/{experience_type_id}">client.experiences.<a href="./src/payi/resources/experiences/experiences.py">create</a>(experience_type_id) -> <a href="./src/payi/types/experience_instance.py">ExperienceInstance</a></code>
|
|
111
|
+
- <code title="get /api/v1/experiences/instances/{experience_instance_id}">client.experiences.<a href="./src/payi/resources/experiences/experiences.py">retrieve</a>(experience_instance_id) -> <a href="./src/payi/types/experience_instance.py">ExperienceInstance</a></code>
|
|
112
|
+
- <code title="delete /api/v1/experiences/instances/{experience_instance_id}">client.experiences.<a href="./src/payi/resources/experiences/experiences.py">delete</a>(experience_instance_id) -> <a href="./src/payi/types/experience_instance.py">ExperienceInstance</a></code>
|
|
113
|
+
|
|
114
|
+
## Types
|
|
115
|
+
|
|
116
|
+
Types:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from payi.types.experiences import ExperienceType, TypeListResponse
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Methods:
|
|
123
|
+
|
|
124
|
+
- <code title="post /api/v1/experiences/types">client.experiences.types.<a href="./src/payi/resources/experiences/types.py">create</a>(\*\*<a href="src/payi/types/experiences/type_create_params.py">params</a>) -> <a href="./src/payi/types/experiences/experience_type.py">ExperienceType</a></code>
|
|
125
|
+
- <code title="get /api/v1/experiences/types/{experience_type_id}">client.experiences.types.<a href="./src/payi/resources/experiences/types.py">retrieve</a>(experience_type_id) -> <a href="./src/payi/types/experiences/experience_type.py">ExperienceType</a></code>
|
|
126
|
+
- <code title="patch /api/v1/experiences/types/{experience_type_id}">client.experiences.types.<a href="./src/payi/resources/experiences/types.py">update</a>(experience_type_id, \*\*<a href="src/payi/types/experiences/type_update_params.py">params</a>) -> <a href="./src/payi/types/experiences/experience_type.py">ExperienceType</a></code>
|
|
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_response.py">TypeListResponse</a></code>
|
|
128
|
+
- <code title="delete /api/v1/experiences/types/{experience_type_id}">client.experiences.types.<a href="./src/payi/resources/experiences/types.py">delete</a>(experience_type_id) -> <a href="./src/payi/types/experiences/experience_type.py">ExperienceType</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.16"
|
|
4
4
|
description = "The official Python library for the payi API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -77,8 +77,8 @@ format = { chain = [
|
|
|
77
77
|
"check:ruff",
|
|
78
78
|
"typecheck",
|
|
79
79
|
]}
|
|
80
|
-
"check:ruff" = "ruff ."
|
|
81
|
-
"fix:ruff" = "ruff --fix ."
|
|
80
|
+
"check:ruff" = "ruff check ."
|
|
81
|
+
"fix:ruff" = "ruff check --fix ."
|
|
82
82
|
|
|
83
83
|
typecheck = { chain = [
|
|
84
84
|
"typecheck:pyright",
|
|
@@ -162,6 +162,11 @@ reportPrivateUsage = false
|
|
|
162
162
|
line-length = 120
|
|
163
163
|
output-format = "grouped"
|
|
164
164
|
target-version = "py37"
|
|
165
|
+
|
|
166
|
+
[tool.ruff.format]
|
|
167
|
+
docstring-code-format = true
|
|
168
|
+
|
|
169
|
+
[tool.ruff.lint]
|
|
165
170
|
select = [
|
|
166
171
|
# isort
|
|
167
172
|
"I",
|
|
@@ -192,9 +197,6 @@ unfixable = [
|
|
|
192
197
|
]
|
|
193
198
|
ignore-init-module-imports = true
|
|
194
199
|
|
|
195
|
-
[tool.ruff.format]
|
|
196
|
-
docstring-code-format = true
|
|
197
|
-
|
|
198
200
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
199
201
|
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
|
|
200
202
|
|
|
@@ -70,7 +70,7 @@ pydantic-core==2.18.2
|
|
|
70
70
|
# via pydantic
|
|
71
71
|
pygments==2.18.0
|
|
72
72
|
# via rich
|
|
73
|
-
pyright==1.1.
|
|
73
|
+
pyright==1.1.374
|
|
74
74
|
pytest==7.1.1
|
|
75
75
|
# via pytest-asyncio
|
|
76
76
|
pytest-asyncio==0.21.1
|
|
@@ -80,7 +80,7 @@ pytz==2023.3.post1
|
|
|
80
80
|
# via dirty-equals
|
|
81
81
|
respx==0.20.2
|
|
82
82
|
rich==13.7.1
|
|
83
|
-
ruff==0.
|
|
83
|
+
ruff==0.5.6
|
|
84
84
|
setuptools==68.2.2
|
|
85
85
|
# via nodeenv
|
|
86
86
|
six==1.16.0
|
|
@@ -124,16 +124,14 @@ class PageInfo:
|
|
|
124
124
|
self,
|
|
125
125
|
*,
|
|
126
126
|
url: URL,
|
|
127
|
-
) -> None:
|
|
128
|
-
...
|
|
127
|
+
) -> None: ...
|
|
129
128
|
|
|
130
129
|
@overload
|
|
131
130
|
def __init__(
|
|
132
131
|
self,
|
|
133
132
|
*,
|
|
134
133
|
params: Query,
|
|
135
|
-
) -> None:
|
|
136
|
-
...
|
|
134
|
+
) -> None: ...
|
|
137
135
|
|
|
138
136
|
def __init__(
|
|
139
137
|
self,
|
|
@@ -166,8 +164,7 @@ class BasePage(GenericModel, Generic[_T]):
|
|
|
166
164
|
return False
|
|
167
165
|
return self.next_page_info() is not None
|
|
168
166
|
|
|
169
|
-
def next_page_info(self) -> Optional[PageInfo]:
|
|
170
|
-
...
|
|
167
|
+
def next_page_info(self) -> Optional[PageInfo]: ...
|
|
171
168
|
|
|
172
169
|
def _get_page_items(self) -> Iterable[_T]: # type: ignore[empty-body]
|
|
173
170
|
...
|
|
@@ -903,8 +900,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
903
900
|
*,
|
|
904
901
|
stream: Literal[True],
|
|
905
902
|
stream_cls: Type[_StreamT],
|
|
906
|
-
) -> _StreamT:
|
|
907
|
-
...
|
|
903
|
+
) -> _StreamT: ...
|
|
908
904
|
|
|
909
905
|
@overload
|
|
910
906
|
def request(
|
|
@@ -914,8 +910,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
914
910
|
remaining_retries: Optional[int] = None,
|
|
915
911
|
*,
|
|
916
912
|
stream: Literal[False] = False,
|
|
917
|
-
) -> ResponseT:
|
|
918
|
-
...
|
|
913
|
+
) -> ResponseT: ...
|
|
919
914
|
|
|
920
915
|
@overload
|
|
921
916
|
def request(
|
|
@@ -926,8 +921,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
926
921
|
*,
|
|
927
922
|
stream: bool = False,
|
|
928
923
|
stream_cls: Type[_StreamT] | None = None,
|
|
929
|
-
) -> ResponseT | _StreamT:
|
|
930
|
-
...
|
|
924
|
+
) -> ResponseT | _StreamT: ...
|
|
931
925
|
|
|
932
926
|
def request(
|
|
933
927
|
self,
|
|
@@ -1049,6 +1043,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1049
1043
|
response=response,
|
|
1050
1044
|
stream=stream,
|
|
1051
1045
|
stream_cls=stream_cls,
|
|
1046
|
+
retries_taken=options.get_max_retries(self.max_retries) - retries,
|
|
1052
1047
|
)
|
|
1053
1048
|
|
|
1054
1049
|
def _retry_request(
|
|
@@ -1090,6 +1085,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1090
1085
|
response: httpx.Response,
|
|
1091
1086
|
stream: bool,
|
|
1092
1087
|
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
|
|
1088
|
+
retries_taken: int = 0,
|
|
1093
1089
|
) -> ResponseT:
|
|
1094
1090
|
origin = get_origin(cast_to) or cast_to
|
|
1095
1091
|
|
|
@@ -1107,6 +1103,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1107
1103
|
stream=stream,
|
|
1108
1104
|
stream_cls=stream_cls,
|
|
1109
1105
|
options=options,
|
|
1106
|
+
retries_taken=retries_taken,
|
|
1110
1107
|
),
|
|
1111
1108
|
)
|
|
1112
1109
|
|
|
@@ -1120,6 +1117,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1120
1117
|
stream=stream,
|
|
1121
1118
|
stream_cls=stream_cls,
|
|
1122
1119
|
options=options,
|
|
1120
|
+
retries_taken=retries_taken,
|
|
1123
1121
|
)
|
|
1124
1122
|
if bool(response.request.headers.get(RAW_RESPONSE_HEADER)):
|
|
1125
1123
|
return cast(ResponseT, api_response)
|
|
@@ -1152,8 +1150,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1152
1150
|
cast_to: Type[ResponseT],
|
|
1153
1151
|
options: RequestOptions = {},
|
|
1154
1152
|
stream: Literal[False] = False,
|
|
1155
|
-
) -> ResponseT:
|
|
1156
|
-
...
|
|
1153
|
+
) -> ResponseT: ...
|
|
1157
1154
|
|
|
1158
1155
|
@overload
|
|
1159
1156
|
def get(
|
|
@@ -1164,8 +1161,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1164
1161
|
options: RequestOptions = {},
|
|
1165
1162
|
stream: Literal[True],
|
|
1166
1163
|
stream_cls: type[_StreamT],
|
|
1167
|
-
) -> _StreamT:
|
|
1168
|
-
...
|
|
1164
|
+
) -> _StreamT: ...
|
|
1169
1165
|
|
|
1170
1166
|
@overload
|
|
1171
1167
|
def get(
|
|
@@ -1176,8 +1172,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1176
1172
|
options: RequestOptions = {},
|
|
1177
1173
|
stream: bool,
|
|
1178
1174
|
stream_cls: type[_StreamT] | None = None,
|
|
1179
|
-
) -> ResponseT | _StreamT:
|
|
1180
|
-
...
|
|
1175
|
+
) -> ResponseT | _StreamT: ...
|
|
1181
1176
|
|
|
1182
1177
|
def get(
|
|
1183
1178
|
self,
|
|
@@ -1203,8 +1198,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1203
1198
|
options: RequestOptions = {},
|
|
1204
1199
|
files: RequestFiles | None = None,
|
|
1205
1200
|
stream: Literal[False] = False,
|
|
1206
|
-
) -> ResponseT:
|
|
1207
|
-
...
|
|
1201
|
+
) -> ResponseT: ...
|
|
1208
1202
|
|
|
1209
1203
|
@overload
|
|
1210
1204
|
def post(
|
|
@@ -1217,8 +1211,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1217
1211
|
files: RequestFiles | None = None,
|
|
1218
1212
|
stream: Literal[True],
|
|
1219
1213
|
stream_cls: type[_StreamT],
|
|
1220
|
-
) -> _StreamT:
|
|
1221
|
-
...
|
|
1214
|
+
) -> _StreamT: ...
|
|
1222
1215
|
|
|
1223
1216
|
@overload
|
|
1224
1217
|
def post(
|
|
@@ -1231,8 +1224,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1231
1224
|
files: RequestFiles | None = None,
|
|
1232
1225
|
stream: bool,
|
|
1233
1226
|
stream_cls: type[_StreamT] | None = None,
|
|
1234
|
-
) -> ResponseT | _StreamT:
|
|
1235
|
-
...
|
|
1227
|
+
) -> ResponseT | _StreamT: ...
|
|
1236
1228
|
|
|
1237
1229
|
def post(
|
|
1238
1230
|
self,
|
|
@@ -1465,8 +1457,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1465
1457
|
*,
|
|
1466
1458
|
stream: Literal[False] = False,
|
|
1467
1459
|
remaining_retries: Optional[int] = None,
|
|
1468
|
-
) -> ResponseT:
|
|
1469
|
-
...
|
|
1460
|
+
) -> ResponseT: ...
|
|
1470
1461
|
|
|
1471
1462
|
@overload
|
|
1472
1463
|
async def request(
|
|
@@ -1477,8 +1468,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1477
1468
|
stream: Literal[True],
|
|
1478
1469
|
stream_cls: type[_AsyncStreamT],
|
|
1479
1470
|
remaining_retries: Optional[int] = None,
|
|
1480
|
-
) -> _AsyncStreamT:
|
|
1481
|
-
...
|
|
1471
|
+
) -> _AsyncStreamT: ...
|
|
1482
1472
|
|
|
1483
1473
|
@overload
|
|
1484
1474
|
async def request(
|
|
@@ -1489,8 +1479,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1489
1479
|
stream: bool,
|
|
1490
1480
|
stream_cls: type[_AsyncStreamT] | None = None,
|
|
1491
1481
|
remaining_retries: Optional[int] = None,
|
|
1492
|
-
) -> ResponseT | _AsyncStreamT:
|
|
1493
|
-
...
|
|
1482
|
+
) -> ResponseT | _AsyncStreamT: ...
|
|
1494
1483
|
|
|
1495
1484
|
async def request(
|
|
1496
1485
|
self,
|
|
@@ -1610,6 +1599,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1610
1599
|
response=response,
|
|
1611
1600
|
stream=stream,
|
|
1612
1601
|
stream_cls=stream_cls,
|
|
1602
|
+
retries_taken=options.get_max_retries(self.max_retries) - retries,
|
|
1613
1603
|
)
|
|
1614
1604
|
|
|
1615
1605
|
async def _retry_request(
|
|
@@ -1649,6 +1639,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1649
1639
|
response: httpx.Response,
|
|
1650
1640
|
stream: bool,
|
|
1651
1641
|
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
|
|
1642
|
+
retries_taken: int = 0,
|
|
1652
1643
|
) -> ResponseT:
|
|
1653
1644
|
origin = get_origin(cast_to) or cast_to
|
|
1654
1645
|
|
|
@@ -1666,6 +1657,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1666
1657
|
stream=stream,
|
|
1667
1658
|
stream_cls=stream_cls,
|
|
1668
1659
|
options=options,
|
|
1660
|
+
retries_taken=retries_taken,
|
|
1669
1661
|
),
|
|
1670
1662
|
)
|
|
1671
1663
|
|
|
@@ -1679,6 +1671,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1679
1671
|
stream=stream,
|
|
1680
1672
|
stream_cls=stream_cls,
|
|
1681
1673
|
options=options,
|
|
1674
|
+
retries_taken=retries_taken,
|
|
1682
1675
|
)
|
|
1683
1676
|
if bool(response.request.headers.get(RAW_RESPONSE_HEADER)):
|
|
1684
1677
|
return cast(ResponseT, api_response)
|
|
@@ -1701,8 +1694,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1701
1694
|
cast_to: Type[ResponseT],
|
|
1702
1695
|
options: RequestOptions = {},
|
|
1703
1696
|
stream: Literal[False] = False,
|
|
1704
|
-
) -> ResponseT:
|
|
1705
|
-
...
|
|
1697
|
+
) -> ResponseT: ...
|
|
1706
1698
|
|
|
1707
1699
|
@overload
|
|
1708
1700
|
async def get(
|
|
@@ -1713,8 +1705,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1713
1705
|
options: RequestOptions = {},
|
|
1714
1706
|
stream: Literal[True],
|
|
1715
1707
|
stream_cls: type[_AsyncStreamT],
|
|
1716
|
-
) -> _AsyncStreamT:
|
|
1717
|
-
...
|
|
1708
|
+
) -> _AsyncStreamT: ...
|
|
1718
1709
|
|
|
1719
1710
|
@overload
|
|
1720
1711
|
async def get(
|
|
@@ -1725,8 +1716,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1725
1716
|
options: RequestOptions = {},
|
|
1726
1717
|
stream: bool,
|
|
1727
1718
|
stream_cls: type[_AsyncStreamT] | None = None,
|
|
1728
|
-
) -> ResponseT | _AsyncStreamT:
|
|
1729
|
-
...
|
|
1719
|
+
) -> ResponseT | _AsyncStreamT: ...
|
|
1730
1720
|
|
|
1731
1721
|
async def get(
|
|
1732
1722
|
self,
|
|
@@ -1750,8 +1740,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1750
1740
|
files: RequestFiles | None = None,
|
|
1751
1741
|
options: RequestOptions = {},
|
|
1752
1742
|
stream: Literal[False] = False,
|
|
1753
|
-
) -> ResponseT:
|
|
1754
|
-
...
|
|
1743
|
+
) -> ResponseT: ...
|
|
1755
1744
|
|
|
1756
1745
|
@overload
|
|
1757
1746
|
async def post(
|
|
@@ -1764,8 +1753,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1764
1753
|
options: RequestOptions = {},
|
|
1765
1754
|
stream: Literal[True],
|
|
1766
1755
|
stream_cls: type[_AsyncStreamT],
|
|
1767
|
-
) -> _AsyncStreamT:
|
|
1768
|
-
...
|
|
1756
|
+
) -> _AsyncStreamT: ...
|
|
1769
1757
|
|
|
1770
1758
|
@overload
|
|
1771
1759
|
async def post(
|
|
@@ -1778,8 +1766,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1778
1766
|
options: RequestOptions = {},
|
|
1779
1767
|
stream: bool,
|
|
1780
1768
|
stream_cls: type[_AsyncStreamT] | None = None,
|
|
1781
|
-
) -> ResponseT | _AsyncStreamT:
|
|
1782
|
-
...
|
|
1769
|
+
) -> ResponseT | _AsyncStreamT: ...
|
|
1783
1770
|
|
|
1784
1771
|
async def post(
|
|
1785
1772
|
self,
|
|
@@ -49,6 +49,7 @@ class Payi(SyncAPIClient):
|
|
|
49
49
|
budgets: resources.BudgetsResource
|
|
50
50
|
ingest: resources.IngestResource
|
|
51
51
|
categories: resources.CategoriesResource
|
|
52
|
+
experiences: resources.ExperiencesResource
|
|
52
53
|
with_raw_response: PayiWithRawResponse
|
|
53
54
|
with_streaming_response: PayiWithStreamedResponse
|
|
54
55
|
|
|
@@ -109,6 +110,7 @@ class Payi(SyncAPIClient):
|
|
|
109
110
|
self.budgets = resources.BudgetsResource(self)
|
|
110
111
|
self.ingest = resources.IngestResource(self)
|
|
111
112
|
self.categories = resources.CategoriesResource(self)
|
|
113
|
+
self.experiences = resources.ExperiencesResource(self)
|
|
112
114
|
self.with_raw_response = PayiWithRawResponse(self)
|
|
113
115
|
self.with_streaming_response = PayiWithStreamedResponse(self)
|
|
114
116
|
|
|
@@ -221,6 +223,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
221
223
|
budgets: resources.AsyncBudgetsResource
|
|
222
224
|
ingest: resources.AsyncIngestResource
|
|
223
225
|
categories: resources.AsyncCategoriesResource
|
|
226
|
+
experiences: resources.AsyncExperiencesResource
|
|
224
227
|
with_raw_response: AsyncPayiWithRawResponse
|
|
225
228
|
with_streaming_response: AsyncPayiWithStreamedResponse
|
|
226
229
|
|
|
@@ -281,6 +284,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
281
284
|
self.budgets = resources.AsyncBudgetsResource(self)
|
|
282
285
|
self.ingest = resources.AsyncIngestResource(self)
|
|
283
286
|
self.categories = resources.AsyncCategoriesResource(self)
|
|
287
|
+
self.experiences = resources.AsyncExperiencesResource(self)
|
|
284
288
|
self.with_raw_response = AsyncPayiWithRawResponse(self)
|
|
285
289
|
self.with_streaming_response = AsyncPayiWithStreamedResponse(self)
|
|
286
290
|
|
|
@@ -394,6 +398,7 @@ class PayiWithRawResponse:
|
|
|
394
398
|
self.budgets = resources.BudgetsResourceWithRawResponse(client.budgets)
|
|
395
399
|
self.ingest = resources.IngestResourceWithRawResponse(client.ingest)
|
|
396
400
|
self.categories = resources.CategoriesResourceWithRawResponse(client.categories)
|
|
401
|
+
self.experiences = resources.ExperiencesResourceWithRawResponse(client.experiences)
|
|
397
402
|
|
|
398
403
|
|
|
399
404
|
class AsyncPayiWithRawResponse:
|
|
@@ -401,6 +406,7 @@ class AsyncPayiWithRawResponse:
|
|
|
401
406
|
self.budgets = resources.AsyncBudgetsResourceWithRawResponse(client.budgets)
|
|
402
407
|
self.ingest = resources.AsyncIngestResourceWithRawResponse(client.ingest)
|
|
403
408
|
self.categories = resources.AsyncCategoriesResourceWithRawResponse(client.categories)
|
|
409
|
+
self.experiences = resources.AsyncExperiencesResourceWithRawResponse(client.experiences)
|
|
404
410
|
|
|
405
411
|
|
|
406
412
|
class PayiWithStreamedResponse:
|
|
@@ -408,6 +414,7 @@ class PayiWithStreamedResponse:
|
|
|
408
414
|
self.budgets = resources.BudgetsResourceWithStreamingResponse(client.budgets)
|
|
409
415
|
self.ingest = resources.IngestResourceWithStreamingResponse(client.ingest)
|
|
410
416
|
self.categories = resources.CategoriesResourceWithStreamingResponse(client.categories)
|
|
417
|
+
self.experiences = resources.ExperiencesResourceWithStreamingResponse(client.experiences)
|
|
411
418
|
|
|
412
419
|
|
|
413
420
|
class AsyncPayiWithStreamedResponse:
|
|
@@ -415,6 +422,7 @@ class AsyncPayiWithStreamedResponse:
|
|
|
415
422
|
self.budgets = resources.AsyncBudgetsResourceWithStreamingResponse(client.budgets)
|
|
416
423
|
self.ingest = resources.AsyncIngestResourceWithStreamingResponse(client.ingest)
|
|
417
424
|
self.categories = resources.AsyncCategoriesResourceWithStreamingResponse(client.categories)
|
|
425
|
+
self.experiences = resources.AsyncExperiencesResourceWithStreamingResponse(client.experiences)
|
|
418
426
|
|
|
419
427
|
|
|
420
428
|
Client = Payi
|
|
@@ -7,7 +7,7 @@ from typing_extensions import Self
|
|
|
7
7
|
import pydantic
|
|
8
8
|
from pydantic.fields import FieldInfo
|
|
9
9
|
|
|
10
|
-
from ._types import StrBytesIntFloat
|
|
10
|
+
from ._types import IncEx, StrBytesIntFloat
|
|
11
11
|
|
|
12
12
|
_T = TypeVar("_T")
|
|
13
13
|
_ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel)
|
|
@@ -133,17 +133,20 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
|
|
133
133
|
def model_dump(
|
|
134
134
|
model: pydantic.BaseModel,
|
|
135
135
|
*,
|
|
136
|
+
exclude: IncEx = None,
|
|
136
137
|
exclude_unset: bool = False,
|
|
137
138
|
exclude_defaults: bool = False,
|
|
138
139
|
) -> dict[str, Any]:
|
|
139
140
|
if PYDANTIC_V2:
|
|
140
141
|
return model.model_dump(
|
|
142
|
+
exclude=exclude,
|
|
141
143
|
exclude_unset=exclude_unset,
|
|
142
144
|
exclude_defaults=exclude_defaults,
|
|
143
145
|
)
|
|
144
146
|
return cast(
|
|
145
147
|
"dict[str, Any]",
|
|
146
148
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
149
|
+
exclude=exclude,
|
|
147
150
|
exclude_unset=exclude_unset,
|
|
148
151
|
exclude_defaults=exclude_defaults,
|
|
149
152
|
),
|
|
@@ -159,22 +162,19 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
|
|
|
159
162
|
# generic models
|
|
160
163
|
if TYPE_CHECKING:
|
|
161
164
|
|
|
162
|
-
class GenericModel(pydantic.BaseModel):
|
|
163
|
-
...
|
|
165
|
+
class GenericModel(pydantic.BaseModel): ...
|
|
164
166
|
|
|
165
167
|
else:
|
|
166
168
|
if PYDANTIC_V2:
|
|
167
169
|
# there no longer needs to be a distinction in v2 but
|
|
168
170
|
# we still have to create our own subclass to avoid
|
|
169
171
|
# inconsistent MRO ordering errors
|
|
170
|
-
class GenericModel(pydantic.BaseModel):
|
|
171
|
-
...
|
|
172
|
+
class GenericModel(pydantic.BaseModel): ...
|
|
172
173
|
|
|
173
174
|
else:
|
|
174
175
|
import pydantic.generics
|
|
175
176
|
|
|
176
|
-
class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel):
|
|
177
|
-
...
|
|
177
|
+
class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
|
|
178
178
|
|
|
179
179
|
|
|
180
180
|
# cached properties
|
|
@@ -193,26 +193,21 @@ if TYPE_CHECKING:
|
|
|
193
193
|
func: Callable[[Any], _T]
|
|
194
194
|
attrname: str | None
|
|
195
195
|
|
|
196
|
-
def __init__(self, func: Callable[[Any], _T]) -> None:
|
|
197
|
-
...
|
|
196
|
+
def __init__(self, func: Callable[[Any], _T]) -> None: ...
|
|
198
197
|
|
|
199
198
|
@overload
|
|
200
|
-
def __get__(self, instance: None, owner: type[Any] | None = None) -> Self:
|
|
201
|
-
...
|
|
199
|
+
def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ...
|
|
202
200
|
|
|
203
201
|
@overload
|
|
204
|
-
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T:
|
|
205
|
-
...
|
|
202
|
+
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ...
|
|
206
203
|
|
|
207
204
|
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T | Self:
|
|
208
205
|
raise NotImplementedError()
|
|
209
206
|
|
|
210
|
-
def __set_name__(self, owner: type[Any], name: str) -> None:
|
|
211
|
-
...
|
|
207
|
+
def __set_name__(self, owner: type[Any], name: str) -> None: ...
|
|
212
208
|
|
|
213
209
|
# __set__ is not defined at runtime, but @cached_property is designed to be settable
|
|
214
|
-
def __set__(self, instance: object, value: _T) -> None:
|
|
215
|
-
...
|
|
210
|
+
def __set__(self, instance: object, value: _T) -> None: ...
|
|
216
211
|
else:
|
|
217
212
|
try:
|
|
218
213
|
from functools import cached_property as cached_property
|
|
@@ -39,13 +39,11 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
@overload
|
|
42
|
-
def to_httpx_files(files: None) -> None:
|
|
43
|
-
...
|
|
42
|
+
def to_httpx_files(files: None) -> None: ...
|
|
44
43
|
|
|
45
44
|
|
|
46
45
|
@overload
|
|
47
|
-
def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles:
|
|
48
|
-
...
|
|
46
|
+
def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ...
|
|
49
47
|
|
|
50
48
|
|
|
51
49
|
def to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None:
|
|
@@ -83,13 +81,11 @@ def _read_file_content(file: FileContent) -> HttpxFileContent:
|
|
|
83
81
|
|
|
84
82
|
|
|
85
83
|
@overload
|
|
86
|
-
async def async_to_httpx_files(files: None) -> None:
|
|
87
|
-
...
|
|
84
|
+
async def async_to_httpx_files(files: None) -> None: ...
|
|
88
85
|
|
|
89
86
|
|
|
90
87
|
@overload
|
|
91
|
-
async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles:
|
|
92
|
-
...
|
|
88
|
+
async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ...
|
|
93
89
|
|
|
94
90
|
|
|
95
91
|
async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None:
|
|
@@ -55,6 +55,9 @@ class BaseAPIResponse(Generic[R]):
|
|
|
55
55
|
|
|
56
56
|
http_response: httpx.Response
|
|
57
57
|
|
|
58
|
+
retries_taken: int
|
|
59
|
+
"""The number of retries made. If no retries happened this will be `0`"""
|
|
60
|
+
|
|
58
61
|
def __init__(
|
|
59
62
|
self,
|
|
60
63
|
*,
|
|
@@ -64,6 +67,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
64
67
|
stream: bool,
|
|
65
68
|
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
|
|
66
69
|
options: FinalRequestOptions,
|
|
70
|
+
retries_taken: int = 0,
|
|
67
71
|
) -> None:
|
|
68
72
|
self._cast_to = cast_to
|
|
69
73
|
self._client = client
|
|
@@ -72,6 +76,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
72
76
|
self._stream_cls = stream_cls
|
|
73
77
|
self._options = options
|
|
74
78
|
self.http_response = raw
|
|
79
|
+
self.retries_taken = retries_taken
|
|
75
80
|
|
|
76
81
|
@property
|
|
77
82
|
def headers(self) -> httpx.Headers:
|
|
@@ -255,12 +260,10 @@ class BaseAPIResponse(Generic[R]):
|
|
|
255
260
|
|
|
256
261
|
class APIResponse(BaseAPIResponse[R]):
|
|
257
262
|
@overload
|
|
258
|
-
def parse(self, *, to: type[_T]) -> _T:
|
|
259
|
-
...
|
|
263
|
+
def parse(self, *, to: type[_T]) -> _T: ...
|
|
260
264
|
|
|
261
265
|
@overload
|
|
262
|
-
def parse(self) -> R:
|
|
263
|
-
...
|
|
266
|
+
def parse(self) -> R: ...
|
|
264
267
|
|
|
265
268
|
def parse(self, *, to: type[_T] | None = None) -> R | _T:
|
|
266
269
|
"""Returns the rich python representation of this response's data.
|
|
@@ -359,12 +362,10 @@ class APIResponse(BaseAPIResponse[R]):
|
|
|
359
362
|
|
|
360
363
|
class AsyncAPIResponse(BaseAPIResponse[R]):
|
|
361
364
|
@overload
|
|
362
|
-
async def parse(self, *, to: type[_T]) -> _T:
|
|
363
|
-
...
|
|
365
|
+
async def parse(self, *, to: type[_T]) -> _T: ...
|
|
364
366
|
|
|
365
367
|
@overload
|
|
366
|
-
async def parse(self) -> R:
|
|
367
|
-
...
|
|
368
|
+
async def parse(self) -> R: ...
|
|
368
369
|
|
|
369
370
|
async def parse(self, *, to: type[_T] | None = None) -> R | _T:
|
|
370
371
|
"""Returns the rich python representation of this response's data.
|