payi 0.1.0a13__tar.gz → 0.1.0a14__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.0a14/.release-please-manifest.json +3 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/CHANGELOG.md +22 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/PKG-INFO +8 -2
- {payi-0.1.0a13 → payi-0.1.0a14}/README.md +7 -1
- {payi-0.1.0a13 → payi-0.1.0a14}/api.md +37 -0
- payi-0.1.0a14/bin/check-release-environment +21 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/pyproject.toml +1 -1
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_base_client.py +6 -6
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_client.py +8 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_compat.py +3 -3
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_models.py +9 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_version.py +1 -1
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/resources/__init__.py +14 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/resources/budgets/budgets.py +12 -4
- payi-0.1.0a14/src/payi/resources/categories/__init__.py +33 -0
- payi-0.1.0a14/src/payi/resources/categories/categories.py +388 -0
- payi-0.1.0a14/src/payi/resources/categories/resources.py +450 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/resources/ingest.py +52 -15
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/__init__.py +6 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budget_create_params.py +4 -0
- payi-0.1.0a14/src/payi/types/budget_history_response.py +61 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budget_response.py +2 -2
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budget_update_params.py +4 -3
- payi-0.1.0a14/src/payi/types/categories/__init__.py +6 -0
- payi-0.1.0a14/src/payi/types/categories/resource_create_params.py +25 -0
- payi-0.1.0a14/src/payi/types/categories/resource_list_response.py +9 -0
- payi-0.1.0a14/src/payi/types/category_delete_resource_response.py +9 -0
- payi-0.1.0a14/src/payi/types/category_delete_response.py +9 -0
- payi-0.1.0a14/src/payi/types/category_list_resources_response.py +9 -0
- payi-0.1.0a14/src/payi/types/category_list_response.py +9 -0
- payi-0.1.0a14/src/payi/types/category_resource_response.py +24 -0
- payi-0.1.0a14/src/payi/types/category_response.py +15 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/ingest_units_params.py +6 -2
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/paged_budget_list.py +2 -2
- payi-0.1.0a14/tests/api_resources/categories/__init__.py +1 -0
- payi-0.1.0a14/tests/api_resources/categories/test_resources.py +492 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/api_resources/test_budgets.py +6 -10
- payi-0.1.0a14/tests/api_resources/test_categories.py +325 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/api_resources/test_ingest.py +3 -0
- payi-0.1.0a13/.release-please-manifest.json +0 -3
- payi-0.1.0a13/bin/check-release-environment +0 -32
- payi-0.1.0a13/src/payi/types/budget_history_response.py +0 -110
- {payi-0.1.0a13 → payi-0.1.0a14}/.gitignore +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/LICENSE +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/SECURITY.md +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/bin/publish-pypi +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/examples/.keep +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/mypy.ini +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/noxfile.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/release-please-config.json +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/requirements-dev.lock +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/requirements.lock +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_constants.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_files.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_qs.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_resource.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_types.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_reflection.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/lib/helpers.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/py.typed +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/resources/budgets/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/resources/budgets/tags.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budget_list_params.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/budget_tags.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_create_params.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_create_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_delete_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_list_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_remove_params.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_remove_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_update_params.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/budgets/tag_update_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/cost_data.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/proxy_result.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/src/payi/types/requests_data.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/api_resources/budgets/__init__.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/api_resources/budgets/test_tags.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/conftest.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/sample_file.txt +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_client.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_files.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_models.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_qs.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_required_args.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_response.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_streaming.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_transform.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a13 → payi-0.1.0a14}/tests/utils.py +0 -0
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.14 (2024-07-30)
|
|
4
|
+
|
|
5
|
+
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)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update via SDK Studio ([#48](https://github.com/Pay-i/pay-i-python/issues/48)) ([5b67542](https://github.com/Pay-i/pay-i-python/commit/5b6754279d6b6dcb3b65bda1bf59b0d0092b4bec))
|
|
10
|
+
* **api:** update via SDK Studio ([#50](https://github.com/Pay-i/pay-i-python/issues/50)) ([91c7d2c](https://github.com/Pay-i/pay-i-python/commit/91c7d2c29430835dfee501520d8b247755e1679d))
|
|
11
|
+
* **api:** update via SDK Studio ([#57](https://github.com/Pay-i/pay-i-python/issues/57)) ([8d6ce22](https://github.com/Pay-i/pay-i-python/commit/8d6ce2229764aeaac2b0229cb70266545759cc7d))
|
|
12
|
+
* **api:** update via SDK Studio ([#58](https://github.com/Pay-i/pay-i-python/issues/58)) ([013389a](https://github.com/Pay-i/pay-i-python/commit/013389a52fc87312e7173c34c3f27256e52b7ed5))
|
|
13
|
+
* **api:** update via SDK Studio ([#59](https://github.com/Pay-i/pay-i-python/issues/59)) ([9f895e6](https://github.com/Pay-i/pay-i-python/commit/9f895e649a06a9000b1da8ab4a0b2fb779b09db9))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Chores
|
|
17
|
+
|
|
18
|
+
* **ci:** limit release doctor target branches ([#54](https://github.com/Pay-i/pay-i-python/issues/54)) ([926140e](https://github.com/Pay-i/pay-i-python/commit/926140e37dacca0b1e4ae481ed6fb839a154ad88))
|
|
19
|
+
* **docs:** document how to do per-request http client customization ([#53](https://github.com/Pay-i/pay-i-python/issues/53)) ([ea27182](https://github.com/Pay-i/pay-i-python/commit/ea271822df7ba59dc1cafc88e610b800a162c991))
|
|
20
|
+
* **internal:** add type construction helper ([#60](https://github.com/Pay-i/pay-i-python/issues/60)) ([65303cf](https://github.com/Pay-i/pay-i-python/commit/65303cf704602ece488a31e8a608be100279a1bc))
|
|
21
|
+
* **internal:** codegen related update ([#52](https://github.com/Pay-i/pay-i-python/issues/52)) ([4a469a0](https://github.com/Pay-i/pay-i-python/commit/4a469a0691431fe21ca111803ca6e256978cd21b))
|
|
22
|
+
* **internal:** refactor release doctor script ([#55](https://github.com/Pay-i/pay-i-python/issues/55)) ([b0a2707](https://github.com/Pay-i/pay-i-python/commit/b0a2707b711baa23ee4af9152b7a3f8558ac8d09))
|
|
23
|
+
* **tests:** update prism version ([#56](https://github.com/Pay-i/pay-i-python/issues/56)) ([df7370f](https://github.com/Pay-i/pay-i-python/commit/df7370f0aa1c8aa77e3091cb0b7c60238fb35ba0))
|
|
24
|
+
|
|
3
25
|
## 0.1.0-alpha.13 (2024-07-11)
|
|
4
26
|
|
|
5
27
|
Full Changelog: [v0.1.0-alpha.12...v0.1.0-alpha.13](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.12...v0.1.0-alpha.13)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a14
|
|
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
|
|
@@ -44,7 +44,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
|
|
|
44
44
|
|
|
45
45
|
## Documentation
|
|
46
46
|
|
|
47
|
-
The REST API documentation can be found
|
|
47
|
+
The REST API documentation can be found on [docs.payi.com](https://docs.payi.com). The full API of this library can be found in [api.md](https://github.com/Pay-i/pay-i-python/tree/main/api.md).
|
|
48
48
|
|
|
49
49
|
## Installation
|
|
50
50
|
|
|
@@ -334,6 +334,12 @@ client = Payi(
|
|
|
334
334
|
)
|
|
335
335
|
```
|
|
336
336
|
|
|
337
|
+
You can also customize the client on a per-request basis by using `with_options()`:
|
|
338
|
+
|
|
339
|
+
```python
|
|
340
|
+
client.with_options(http_client=DefaultHttpxClient(...))
|
|
341
|
+
```
|
|
342
|
+
|
|
337
343
|
### Managing HTTP resources
|
|
338
344
|
|
|
339
345
|
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
|
@@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
|
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
12
|
|
|
13
|
-
The REST API documentation can be found
|
|
13
|
+
The REST API documentation can be found on [docs.payi.com](https://docs.payi.com). The full API of this library can be found in [api.md](api.md).
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -300,6 +300,12 @@ client = Payi(
|
|
|
300
300
|
)
|
|
301
301
|
```
|
|
302
302
|
|
|
303
|
+
You can also customize the client on a per-request basis by using `with_options()`:
|
|
304
|
+
|
|
305
|
+
```python
|
|
306
|
+
client.with_options(http_client=DefaultHttpxClient(...))
|
|
307
|
+
```
|
|
308
|
+
|
|
303
309
|
### Managing HTTP resources
|
|
304
310
|
|
|
305
311
|
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
|
@@ -57,3 +57,40 @@ from payi.types import ProxyResult
|
|
|
57
57
|
Methods:
|
|
58
58
|
|
|
59
59
|
- <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/proxy_result.py">ProxyResult</a></code>
|
|
60
|
+
|
|
61
|
+
# Categories
|
|
62
|
+
|
|
63
|
+
Types:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from payi.types import (
|
|
67
|
+
CategoryResourceResponse,
|
|
68
|
+
CategoryResponse,
|
|
69
|
+
CategoryListResponse,
|
|
70
|
+
CategoryDeleteResponse,
|
|
71
|
+
CategoryDeleteResourceResponse,
|
|
72
|
+
CategoryListResourcesResponse,
|
|
73
|
+
)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Methods:
|
|
77
|
+
|
|
78
|
+
- <code title="get /api/v1/categories">client.categories.<a href="./src/payi/resources/categories/categories.py">list</a>() -> <a href="./src/payi/types/category_list_response.py">CategoryListResponse</a></code>
|
|
79
|
+
- <code title="delete /api/v1/categories/{category}">client.categories.<a href="./src/payi/resources/categories/categories.py">delete</a>(category) -> <a href="./src/payi/types/category_delete_response.py">CategoryDeleteResponse</a></code>
|
|
80
|
+
- <code title="delete /api/v1/categories/{category}/resources/{resource}">client.categories.<a href="./src/payi/resources/categories/categories.py">delete_resource</a>(resource, \*, category) -> <a href="./src/payi/types/category_delete_resource_response.py">CategoryDeleteResourceResponse</a></code>
|
|
81
|
+
- <code title="get /api/v1/categories/{category}/resources">client.categories.<a href="./src/payi/resources/categories/categories.py">list_resources</a>(category) -> <a href="./src/payi/types/category_list_resources_response.py">CategoryListResourcesResponse</a></code>
|
|
82
|
+
|
|
83
|
+
## Resources
|
|
84
|
+
|
|
85
|
+
Types:
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from payi.types.categories import ResourceListResponse
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Methods:
|
|
92
|
+
|
|
93
|
+
- <code title="post /api/v1/categories/{category}/resources/{resource}">client.categories.resources.<a href="./src/payi/resources/categories/resources.py">create</a>(resource, \*, category, \*\*<a href="src/payi/types/categories/resource_create_params.py">params</a>) -> <a href="./src/payi/types/category_resource_response.py">CategoryResourceResponse</a></code>
|
|
94
|
+
- <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
|
+
- <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
|
+
- <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>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
errors=()
|
|
4
|
+
|
|
5
|
+
if [ -z "${PYPI_TOKEN}" ]; then
|
|
6
|
+
errors+=("The PAYI_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
lenErrors=${#errors[@]}
|
|
10
|
+
|
|
11
|
+
if [[ lenErrors -gt 0 ]]; then
|
|
12
|
+
echo -e "Found the following errors in the release environment:\n"
|
|
13
|
+
|
|
14
|
+
for error in "${errors[@]}"; do
|
|
15
|
+
echo -e "- $error\n"
|
|
16
|
+
done
|
|
17
|
+
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
echo "The environment is ready to push releases!"
|
|
@@ -879,9 +879,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
879
879
|
def _prepare_options(
|
|
880
880
|
self,
|
|
881
881
|
options: FinalRequestOptions, # noqa: ARG002
|
|
882
|
-
) ->
|
|
882
|
+
) -> FinalRequestOptions:
|
|
883
883
|
"""Hook for mutating the given options"""
|
|
884
|
-
return
|
|
884
|
+
return options
|
|
885
885
|
|
|
886
886
|
def _prepare_request(
|
|
887
887
|
self,
|
|
@@ -961,7 +961,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
961
961
|
input_options = model_copy(options)
|
|
962
962
|
|
|
963
963
|
cast_to = self._maybe_override_cast_to(cast_to, options)
|
|
964
|
-
self._prepare_options(options)
|
|
964
|
+
options = self._prepare_options(options)
|
|
965
965
|
|
|
966
966
|
retries = self._remaining_retries(remaining_retries, options)
|
|
967
967
|
request = self._build_request(options)
|
|
@@ -1442,9 +1442,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1442
1442
|
async def _prepare_options(
|
|
1443
1443
|
self,
|
|
1444
1444
|
options: FinalRequestOptions, # noqa: ARG002
|
|
1445
|
-
) ->
|
|
1445
|
+
) -> FinalRequestOptions:
|
|
1446
1446
|
"""Hook for mutating the given options"""
|
|
1447
|
-
return
|
|
1447
|
+
return options
|
|
1448
1448
|
|
|
1449
1449
|
async def _prepare_request(
|
|
1450
1450
|
self,
|
|
@@ -1529,7 +1529,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1529
1529
|
input_options = model_copy(options)
|
|
1530
1530
|
|
|
1531
1531
|
cast_to = self._maybe_override_cast_to(cast_to, options)
|
|
1532
|
-
await self._prepare_options(options)
|
|
1532
|
+
options = await self._prepare_options(options)
|
|
1533
1533
|
|
|
1534
1534
|
retries = self._remaining_retries(remaining_retries, options)
|
|
1535
1535
|
request = self._build_request(options)
|
|
@@ -48,6 +48,7 @@ __all__ = [
|
|
|
48
48
|
class Payi(SyncAPIClient):
|
|
49
49
|
budgets: resources.BudgetsResource
|
|
50
50
|
ingest: resources.IngestResource
|
|
51
|
+
categories: resources.CategoriesResource
|
|
51
52
|
with_raw_response: PayiWithRawResponse
|
|
52
53
|
with_streaming_response: PayiWithStreamedResponse
|
|
53
54
|
|
|
@@ -107,6 +108,7 @@ class Payi(SyncAPIClient):
|
|
|
107
108
|
|
|
108
109
|
self.budgets = resources.BudgetsResource(self)
|
|
109
110
|
self.ingest = resources.IngestResource(self)
|
|
111
|
+
self.categories = resources.CategoriesResource(self)
|
|
110
112
|
self.with_raw_response = PayiWithRawResponse(self)
|
|
111
113
|
self.with_streaming_response = PayiWithStreamedResponse(self)
|
|
112
114
|
|
|
@@ -218,6 +220,7 @@ class Payi(SyncAPIClient):
|
|
|
218
220
|
class AsyncPayi(AsyncAPIClient):
|
|
219
221
|
budgets: resources.AsyncBudgetsResource
|
|
220
222
|
ingest: resources.AsyncIngestResource
|
|
223
|
+
categories: resources.AsyncCategoriesResource
|
|
221
224
|
with_raw_response: AsyncPayiWithRawResponse
|
|
222
225
|
with_streaming_response: AsyncPayiWithStreamedResponse
|
|
223
226
|
|
|
@@ -277,6 +280,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
277
280
|
|
|
278
281
|
self.budgets = resources.AsyncBudgetsResource(self)
|
|
279
282
|
self.ingest = resources.AsyncIngestResource(self)
|
|
283
|
+
self.categories = resources.AsyncCategoriesResource(self)
|
|
280
284
|
self.with_raw_response = AsyncPayiWithRawResponse(self)
|
|
281
285
|
self.with_streaming_response = AsyncPayiWithStreamedResponse(self)
|
|
282
286
|
|
|
@@ -389,24 +393,28 @@ class PayiWithRawResponse:
|
|
|
389
393
|
def __init__(self, client: Payi) -> None:
|
|
390
394
|
self.budgets = resources.BudgetsResourceWithRawResponse(client.budgets)
|
|
391
395
|
self.ingest = resources.IngestResourceWithRawResponse(client.ingest)
|
|
396
|
+
self.categories = resources.CategoriesResourceWithRawResponse(client.categories)
|
|
392
397
|
|
|
393
398
|
|
|
394
399
|
class AsyncPayiWithRawResponse:
|
|
395
400
|
def __init__(self, client: AsyncPayi) -> None:
|
|
396
401
|
self.budgets = resources.AsyncBudgetsResourceWithRawResponse(client.budgets)
|
|
397
402
|
self.ingest = resources.AsyncIngestResourceWithRawResponse(client.ingest)
|
|
403
|
+
self.categories = resources.AsyncCategoriesResourceWithRawResponse(client.categories)
|
|
398
404
|
|
|
399
405
|
|
|
400
406
|
class PayiWithStreamedResponse:
|
|
401
407
|
def __init__(self, client: Payi) -> None:
|
|
402
408
|
self.budgets = resources.BudgetsResourceWithStreamingResponse(client.budgets)
|
|
403
409
|
self.ingest = resources.IngestResourceWithStreamingResponse(client.ingest)
|
|
410
|
+
self.categories = resources.CategoriesResourceWithStreamingResponse(client.categories)
|
|
404
411
|
|
|
405
412
|
|
|
406
413
|
class AsyncPayiWithStreamedResponse:
|
|
407
414
|
def __init__(self, client: AsyncPayi) -> None:
|
|
408
415
|
self.budgets = resources.AsyncBudgetsResourceWithStreamingResponse(client.budgets)
|
|
409
416
|
self.ingest = resources.AsyncIngestResourceWithStreamingResponse(client.ingest)
|
|
417
|
+
self.categories = resources.AsyncCategoriesResourceWithStreamingResponse(client.categories)
|
|
410
418
|
|
|
411
419
|
|
|
412
420
|
Client = Payi
|
|
@@ -118,10 +118,10 @@ def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
|
|
|
118
118
|
return model.__fields__ # type: ignore
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
def model_copy(model: _ModelT) -> _ModelT:
|
|
121
|
+
def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
|
|
122
122
|
if PYDANTIC_V2:
|
|
123
|
-
return model.model_copy()
|
|
124
|
-
return model.copy() # type: ignore
|
|
123
|
+
return model.model_copy(deep=deep)
|
|
124
|
+
return model.copy(deep=deep) # type: ignore
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
|
@@ -406,6 +406,15 @@ def build(
|
|
|
406
406
|
return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs))
|
|
407
407
|
|
|
408
408
|
|
|
409
|
+
def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
|
|
410
|
+
"""Loose coercion to the expected type with construction of nested values.
|
|
411
|
+
|
|
412
|
+
Note: the returned value from this function is not guaranteed to match the
|
|
413
|
+
given type.
|
|
414
|
+
"""
|
|
415
|
+
return cast(_T, construct_type(value=value, type_=type_))
|
|
416
|
+
|
|
417
|
+
|
|
409
418
|
def construct_type(*, value: object, type_: object) -> object:
|
|
410
419
|
"""Loose coercion to the expected type with construction of nested values.
|
|
411
420
|
|
|
@@ -16,6 +16,14 @@ from .budgets import (
|
|
|
16
16
|
BudgetsResourceWithStreamingResponse,
|
|
17
17
|
AsyncBudgetsResourceWithStreamingResponse,
|
|
18
18
|
)
|
|
19
|
+
from .categories import (
|
|
20
|
+
CategoriesResource,
|
|
21
|
+
AsyncCategoriesResource,
|
|
22
|
+
CategoriesResourceWithRawResponse,
|
|
23
|
+
AsyncCategoriesResourceWithRawResponse,
|
|
24
|
+
CategoriesResourceWithStreamingResponse,
|
|
25
|
+
AsyncCategoriesResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
19
27
|
|
|
20
28
|
__all__ = [
|
|
21
29
|
"BudgetsResource",
|
|
@@ -30,4 +38,10 @@ __all__ = [
|
|
|
30
38
|
"AsyncIngestResourceWithRawResponse",
|
|
31
39
|
"IngestResourceWithStreamingResponse",
|
|
32
40
|
"AsyncIngestResourceWithStreamingResponse",
|
|
41
|
+
"CategoriesResource",
|
|
42
|
+
"AsyncCategoriesResource",
|
|
43
|
+
"CategoriesResourceWithRawResponse",
|
|
44
|
+
"AsyncCategoriesResourceWithRawResponse",
|
|
45
|
+
"CategoriesResourceWithStreamingResponse",
|
|
46
|
+
"AsyncCategoriesResourceWithStreamingResponse",
|
|
33
47
|
]
|
|
@@ -57,9 +57,11 @@ class BudgetsResource(SyncAPIResource):
|
|
|
57
57
|
budget_name: str,
|
|
58
58
|
max: float,
|
|
59
59
|
base_cost_estimate: Literal["max"] | NotGiven = NOT_GIVEN,
|
|
60
|
+
billing_model_id: Optional[int] | NotGiven = NOT_GIVEN,
|
|
60
61
|
budget_response_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
61
62
|
budget_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
62
63
|
budget_type: Literal["conservative", "liberal"] | NotGiven = NOT_GIVEN,
|
|
64
|
+
cost_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
|
|
63
65
|
currency: Literal["usd"] | NotGiven = NOT_GIVEN,
|
|
64
66
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
65
67
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -90,9 +92,11 @@ class BudgetsResource(SyncAPIResource):
|
|
|
90
92
|
"budget_name": budget_name,
|
|
91
93
|
"max": max,
|
|
92
94
|
"base_cost_estimate": base_cost_estimate,
|
|
95
|
+
"billing_model_id": billing_model_id,
|
|
93
96
|
"budget_response_type": budget_response_type,
|
|
94
97
|
"budget_tags": budget_tags,
|
|
95
98
|
"budget_type": budget_type,
|
|
99
|
+
"cost_basis": cost_basis,
|
|
96
100
|
"currency": currency,
|
|
97
101
|
},
|
|
98
102
|
budget_create_params.BudgetCreateParams,
|
|
@@ -138,8 +142,8 @@ class BudgetsResource(SyncAPIResource):
|
|
|
138
142
|
self,
|
|
139
143
|
budget_id: str,
|
|
140
144
|
*,
|
|
141
|
-
budget_name: str,
|
|
142
|
-
max: float | NotGiven = NOT_GIVEN,
|
|
145
|
+
budget_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
146
|
+
max: Optional[float] | NotGiven = NOT_GIVEN,
|
|
143
147
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
144
148
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
145
149
|
extra_headers: Headers | None = None,
|
|
@@ -305,9 +309,11 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
305
309
|
budget_name: str,
|
|
306
310
|
max: float,
|
|
307
311
|
base_cost_estimate: Literal["max"] | NotGiven = NOT_GIVEN,
|
|
312
|
+
billing_model_id: Optional[int] | NotGiven = NOT_GIVEN,
|
|
308
313
|
budget_response_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
309
314
|
budget_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
310
315
|
budget_type: Literal["conservative", "liberal"] | NotGiven = NOT_GIVEN,
|
|
316
|
+
cost_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
|
|
311
317
|
currency: Literal["usd"] | NotGiven = NOT_GIVEN,
|
|
312
318
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
313
319
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -335,9 +341,11 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
335
341
|
"budget_name": budget_name,
|
|
336
342
|
"max": max,
|
|
337
343
|
"base_cost_estimate": base_cost_estimate,
|
|
344
|
+
"billing_model_id": billing_model_id,
|
|
338
345
|
"budget_response_type": budget_response_type,
|
|
339
346
|
"budget_tags": budget_tags,
|
|
340
347
|
"budget_type": budget_type,
|
|
348
|
+
"cost_basis": cost_basis,
|
|
341
349
|
"currency": currency,
|
|
342
350
|
},
|
|
343
351
|
budget_create_params.BudgetCreateParams,
|
|
@@ -385,8 +393,8 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
385
393
|
self,
|
|
386
394
|
budget_id: str,
|
|
387
395
|
*,
|
|
388
|
-
budget_name: str,
|
|
389
|
-
max: float | NotGiven = NOT_GIVEN,
|
|
396
|
+
budget_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
397
|
+
max: Optional[float] | NotGiven = NOT_GIVEN,
|
|
390
398
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
391
399
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
392
400
|
extra_headers: Headers | None = None,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .resources import (
|
|
4
|
+
ResourcesResource,
|
|
5
|
+
AsyncResourcesResource,
|
|
6
|
+
ResourcesResourceWithRawResponse,
|
|
7
|
+
AsyncResourcesResourceWithRawResponse,
|
|
8
|
+
ResourcesResourceWithStreamingResponse,
|
|
9
|
+
AsyncResourcesResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .categories import (
|
|
12
|
+
CategoriesResource,
|
|
13
|
+
AsyncCategoriesResource,
|
|
14
|
+
CategoriesResourceWithRawResponse,
|
|
15
|
+
AsyncCategoriesResourceWithRawResponse,
|
|
16
|
+
CategoriesResourceWithStreamingResponse,
|
|
17
|
+
AsyncCategoriesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"ResourcesResource",
|
|
22
|
+
"AsyncResourcesResource",
|
|
23
|
+
"ResourcesResourceWithRawResponse",
|
|
24
|
+
"AsyncResourcesResourceWithRawResponse",
|
|
25
|
+
"ResourcesResourceWithStreamingResponse",
|
|
26
|
+
"AsyncResourcesResourceWithStreamingResponse",
|
|
27
|
+
"CategoriesResource",
|
|
28
|
+
"AsyncCategoriesResource",
|
|
29
|
+
"CategoriesResourceWithRawResponse",
|
|
30
|
+
"AsyncCategoriesResourceWithRawResponse",
|
|
31
|
+
"CategoriesResourceWithStreamingResponse",
|
|
32
|
+
"AsyncCategoriesResourceWithStreamingResponse",
|
|
33
|
+
]
|