payi 0.1.0a26__tar.gz → 0.1.0a27__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.0a27/.release-please-manifest.json +3 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/CHANGELOG.md +9 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/CONTRIBUTING.md +24 -20
- {payi-0.1.0a26 → payi-0.1.0a27}/PKG-INFO +5 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/README.md +4 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/api.md +30 -6
- {payi-0.1.0a26 → payi-0.1.0a27}/pyproject.toml +3 -7
- {payi-0.1.0a26 → payi-0.1.0a27}/requirements-dev.lock +1 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_base_client.py +9 -2
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_client.py +16 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_response.py +3 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_version.py +1 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/__init__.py +28 -0
- payi-0.1.0a27/src/payi/resources/billing_models.py +492 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/budgets/budgets.py +4 -4
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/categories/resources.py +5 -9
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/ingest.py +19 -10
- payi-0.1.0a27/src/payi/resources/price_modifiers.py +353 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/__init__.py +8 -0
- payi-0.1.0a27/src/payi/types/billing_model.py +29 -0
- payi-0.1.0a27/src/payi/types/billing_model_create_params.py +20 -0
- payi-0.1.0a27/src/payi/types/billing_model_list_response.py +10 -0
- payi-0.1.0a27/src/payi/types/billing_model_update_params.py +20 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budget_create_params.py +2 -2
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budget_response.py +2 -2
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/categories/resource_create_params.py +9 -5
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/category_resource_response.py +9 -5
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/cost_data.py +0 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/csat.py +0 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experience_instance.py +0 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experiences/experience_type.py +0 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/ingest_event_param.py +12 -6
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/ingest_response.py +7 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/ingest_units_params.py +11 -6
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/paged_budget_list.py +2 -2
- payi-0.1.0a27/src/payi/types/price_modifier.py +26 -0
- payi-0.1.0a27/src/payi/types/price_modifier_create_params.py +17 -0
- payi-0.1.0a27/src/payi/types/price_modifier_retrieve_response.py +10 -0
- payi-0.1.0a27/src/payi/types/price_modifier_update_params.py +17 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/requests_data.py +2 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/total_cost_data.py +0 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/categories/test_resources.py +72 -4
- payi-0.1.0a27/tests/api_resources/test_billing_models.py +422 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/test_budgets.py +2 -2
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/test_ingest.py +38 -52
- payi-0.1.0a27/tests/api_resources/test_price_modifiers.py +261 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_client.py +21 -2
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_models.py +1 -1
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_response.py +50 -0
- payi-0.1.0a26/.release-please-manifest.json +0 -3
- {payi-0.1.0a26 → payi-0.1.0a27}/.gitignore +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/LICENSE +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/SECURITY.md +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/bin/check-release-environment +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/bin/publish-pypi +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/examples/.keep +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/mypy.ini +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/noxfile.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/release-please-config.json +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/requirements.lock +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_compat.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_constants.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_files.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_models.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_qs.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_resource.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_types.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_reflection.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/lib/helpers.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/py.typed +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/budgets/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/budgets/tags.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/categories/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/categories/categories.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/csat.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/experiences/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/experiences/experiences.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/resources/experiences/types.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budget_history_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budget_list_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budget_update_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/budget_tags.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_create_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_create_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_delete_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_list_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_remove_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_remove_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_update_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/budgets/tag_update_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/bulk_ingest_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/categories/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/categories/resource_list_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/category_delete_resource_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/category_delete_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/category_list_resources_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/category_list_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/category_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/cost_details.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/csat_create_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/evaluations/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/evaluations/experience_create_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/evaluations/request_create_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experiences/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experiences/type_create_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experiences/type_list_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experiences/type_list_response.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/experiences/type_update_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/ingest_bulk_params.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/src/payi/types/shared/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/budgets/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/budgets/test_tags.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/categories/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/evaluations/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/experiences/__init__.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/experiences/test_types.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/test_categories.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/test_csat.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/api_resources/test_experiences.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/conftest.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/sample_file.txt +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_files.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_qs.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_required_args.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_streaming.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_transform.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a26 → payi-0.1.0a27}/tests/utils.py +0 -0
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.27 (2024-10-22)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.26...v0.1.0-alpha.27](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.26...v0.1.0-alpha.27)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#121](https://github.com/Pay-i/pay-i-python/issues/121)) ([5d4aa28](https://github.com/Pay-i/pay-i-python/commit/5d4aa28bde2fa653fb5c99081758d8c06de572ea))
|
|
10
|
+
* **api:** api update ([#125](https://github.com/Pay-i/pay-i-python/issues/125)) ([64e1ac8](https://github.com/Pay-i/pay-i-python/commit/64e1ac8e641917f23998c95fc9ce717484dc826f))
|
|
11
|
+
|
|
3
12
|
## 0.1.0-alpha.26 (2024-10-01)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.1.0-alpha.25...v0.1.0-alpha.26](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.25...v0.1.0-alpha.26)
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
### With Rye
|
|
4
4
|
|
|
5
|
-
We use [Rye](https://rye.astral.sh/) to manage dependencies
|
|
5
|
+
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```sh
|
|
8
|
+
$ ./scripts/bootstrap
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
|
|
8
12
|
|
|
9
13
|
```sh
|
|
10
14
|
$ rye sync --all-features
|
|
@@ -39,17 +43,17 @@ modify the contents of the `src/payi/lib/` and `examples/` directories.
|
|
|
39
43
|
|
|
40
44
|
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
|
|
41
45
|
|
|
42
|
-
```
|
|
46
|
+
```py
|
|
43
47
|
# add an example to examples/<your-example>.py
|
|
44
48
|
|
|
45
49
|
#!/usr/bin/env -S rye run python
|
|
46
50
|
…
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
```
|
|
50
|
-
chmod +x examples/<your-example>.py
|
|
53
|
+
```sh
|
|
54
|
+
$ chmod +x examples/<your-example>.py
|
|
51
55
|
# run the example against your api
|
|
52
|
-
./examples/<your-example>.py
|
|
56
|
+
$ ./examples/<your-example>.py
|
|
53
57
|
```
|
|
54
58
|
|
|
55
59
|
## Using the repository from source
|
|
@@ -58,8 +62,8 @@ If you’d like to use the repository from source, you can either install from g
|
|
|
58
62
|
|
|
59
63
|
To install via git:
|
|
60
64
|
|
|
61
|
-
```
|
|
62
|
-
pip install git+ssh://git@github.com/Pay-i/pay-i-python.git
|
|
65
|
+
```sh
|
|
66
|
+
$ pip install git+ssh://git@github.com/Pay-i/pay-i-python.git
|
|
63
67
|
```
|
|
64
68
|
|
|
65
69
|
Alternatively, you can build from source and install the wheel file:
|
|
@@ -68,29 +72,29 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
|
|
|
68
72
|
|
|
69
73
|
To create a distributable version of the library, all you have to do is run this command:
|
|
70
74
|
|
|
71
|
-
```
|
|
72
|
-
rye build
|
|
75
|
+
```sh
|
|
76
|
+
$ rye build
|
|
73
77
|
# or
|
|
74
|
-
python -m build
|
|
78
|
+
$ python -m build
|
|
75
79
|
```
|
|
76
80
|
|
|
77
81
|
Then to install:
|
|
78
82
|
|
|
79
83
|
```sh
|
|
80
|
-
pip install ./path-to-wheel-file.whl
|
|
84
|
+
$ pip install ./path-to-wheel-file.whl
|
|
81
85
|
```
|
|
82
86
|
|
|
83
87
|
## Running tests
|
|
84
88
|
|
|
85
89
|
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
86
90
|
|
|
87
|
-
```
|
|
91
|
+
```sh
|
|
88
92
|
# you will need npm installed
|
|
89
|
-
npx prism mock path/to/your/openapi.yml
|
|
93
|
+
$ npx prism mock path/to/your/openapi.yml
|
|
90
94
|
```
|
|
91
95
|
|
|
92
|
-
```
|
|
93
|
-
|
|
96
|
+
```sh
|
|
97
|
+
$ ./scripts/test
|
|
94
98
|
```
|
|
95
99
|
|
|
96
100
|
## Linting and formatting
|
|
@@ -100,14 +104,14 @@ This repository uses [ruff](https://github.com/astral-sh/ruff) and
|
|
|
100
104
|
|
|
101
105
|
To lint:
|
|
102
106
|
|
|
103
|
-
```
|
|
104
|
-
|
|
107
|
+
```sh
|
|
108
|
+
$ ./scripts/lint
|
|
105
109
|
```
|
|
106
110
|
|
|
107
111
|
To format and fix all ruff issues automatically:
|
|
108
112
|
|
|
109
|
-
```
|
|
110
|
-
|
|
113
|
+
```sh
|
|
114
|
+
$ ./scripts/format
|
|
111
115
|
```
|
|
112
116
|
|
|
113
117
|
## Publishing and releases
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a27
|
|
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
|
|
@@ -370,3 +370,7 @@ print(payi.__version__)
|
|
|
370
370
|
## Requirements
|
|
371
371
|
|
|
372
372
|
Python 3.7 or higher.
|
|
373
|
+
|
|
374
|
+
## Contributing
|
|
375
|
+
|
|
376
|
+
See [the contributing documentation](https://github.com/Pay-i/pay-i-python/tree/main/./CONTRIBUTING.md).
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
# Shared Types
|
|
2
|
-
|
|
3
|
-
```python
|
|
4
|
-
from payi.types import EvaluationResponse
|
|
5
|
-
```
|
|
6
|
-
|
|
7
1
|
# Budgets
|
|
8
2
|
|
|
9
3
|
Types:
|
|
@@ -144,3 +138,33 @@ from payi.types import Csat
|
|
|
144
138
|
Methods:
|
|
145
139
|
|
|
146
140
|
- <code title="post /api/v1/csat/experiences/{experience_id}">client.csat.<a href="./src/payi/resources/csat.py">create</a>(experience_id, \*\*<a href="src/payi/types/csat_create_params.py">params</a>) -> <a href="./src/payi/types/csat.py">Csat</a></code>
|
|
141
|
+
|
|
142
|
+
# BillingModels
|
|
143
|
+
|
|
144
|
+
Types:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from payi.types import BillingModel, BillingModelListResponse
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Methods:
|
|
151
|
+
|
|
152
|
+
- <code title="post /api/v1/billing-model">client.billing_models.<a href="./src/payi/resources/billing_models.py">create</a>(\*\*<a href="src/payi/types/billing_model_create_params.py">params</a>) -> <a href="./src/payi/types/billing_model.py">BillingModel</a></code>
|
|
153
|
+
- <code title="get /api/v1/billing-model/{billing_model_id}">client.billing_models.<a href="./src/payi/resources/billing_models.py">retrieve</a>(billing_model_id) -> <a href="./src/payi/types/billing_model.py">BillingModel</a></code>
|
|
154
|
+
- <code title="put /api/v1/billing-model/{billing_model_id}">client.billing_models.<a href="./src/payi/resources/billing_models.py">update</a>(billing_model_id, \*\*<a href="src/payi/types/billing_model_update_params.py">params</a>) -> <a href="./src/payi/types/billing_model.py">BillingModel</a></code>
|
|
155
|
+
- <code title="get /api/v1/billing-model">client.billing_models.<a href="./src/payi/resources/billing_models.py">list</a>() -> <a href="./src/payi/types/billing_model_list_response.py">BillingModelListResponse</a></code>
|
|
156
|
+
- <code title="put /api/v1/billing-model/{billing_model_id}/default">client.billing_models.<a href="./src/payi/resources/billing_models.py">set_default</a>(billing_model_id) -> <a href="./src/payi/types/billing_model.py">BillingModel</a></code>
|
|
157
|
+
|
|
158
|
+
# PriceModifiers
|
|
159
|
+
|
|
160
|
+
Types:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
from payi.types import PriceModifier, PriceModifierRetrieveResponse
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Methods:
|
|
167
|
+
|
|
168
|
+
- <code title="post /api/v1/price-modifier">client.price_modifiers.<a href="./src/payi/resources/price_modifiers.py">create</a>(\*\*<a href="src/payi/types/price_modifier_create_params.py">params</a>) -> <a href="./src/payi/types/price_modifier.py">PriceModifier</a></code>
|
|
169
|
+
- <code title="get /api/v1/price-modifier/{billing_model_id}">client.price_modifiers.<a href="./src/payi/resources/price_modifiers.py">retrieve</a>(billing_model_id) -> <a href="./src/payi/types/price_modifier_retrieve_response.py">PriceModifierRetrieveResponse</a></code>
|
|
170
|
+
- <code title="put /api/v1/price-modifier">client.price_modifiers.<a href="./src/payi/resources/price_modifiers.py">update</a>(\*\*<a href="src/payi/types/price_modifier_update_params.py">params</a>) -> <a href="./src/payi/types/price_modifier.py">PriceModifier</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.27"
|
|
4
4
|
description = "The official Python library for the payi API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -63,11 +63,11 @@ format = { chain = [
|
|
|
63
63
|
"format:ruff",
|
|
64
64
|
"format:docs",
|
|
65
65
|
"fix:ruff",
|
|
66
|
+
# run formatting again to fix any inconsistencies when imports are stripped
|
|
67
|
+
"format:ruff",
|
|
66
68
|
]}
|
|
67
|
-
"format:black" = "black ."
|
|
68
69
|
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
|
|
69
70
|
"format:ruff" = "ruff format"
|
|
70
|
-
"format:isort" = "isort ."
|
|
71
71
|
|
|
72
72
|
"lint" = { chain = [
|
|
73
73
|
"check:ruff",
|
|
@@ -125,10 +125,6 @@ path = "README.md"
|
|
|
125
125
|
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
|
|
126
126
|
replacement = '[\1](https://github.com/Pay-i/pay-i-python/tree/main/\g<2>)'
|
|
127
127
|
|
|
128
|
-
[tool.black]
|
|
129
|
-
line-length = 120
|
|
130
|
-
target-version = ["py37"]
|
|
131
|
-
|
|
132
128
|
[tool.pytest.ini_options]
|
|
133
129
|
testpaths = ["tests"]
|
|
134
130
|
addopts = "--tb=short"
|
|
@@ -143,6 +143,12 @@ class PageInfo:
|
|
|
143
143
|
self.url = url
|
|
144
144
|
self.params = params
|
|
145
145
|
|
|
146
|
+
@override
|
|
147
|
+
def __repr__(self) -> str:
|
|
148
|
+
if self.url:
|
|
149
|
+
return f"{self.__class__.__name__}(url={self.url})"
|
|
150
|
+
return f"{self.__class__.__name__}(params={self.params})"
|
|
151
|
+
|
|
146
152
|
|
|
147
153
|
class BasePage(GenericModel, Generic[_T]):
|
|
148
154
|
"""
|
|
@@ -689,7 +695,8 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
689
695
|
if retry_after is not None and 0 < retry_after <= 60:
|
|
690
696
|
return retry_after
|
|
691
697
|
|
|
692
|
-
|
|
698
|
+
# Also cap retry count to 1000 to avoid any potential overflows with `pow`
|
|
699
|
+
nb_retries = min(max_retries - remaining_retries, 1000)
|
|
693
700
|
|
|
694
701
|
# Apply exponential backoff, but not more than the max.
|
|
695
702
|
sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY)
|
|
@@ -1568,7 +1575,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1568
1575
|
except Exception as err:
|
|
1569
1576
|
log.debug("Encountered Exception", exc_info=True)
|
|
1570
1577
|
|
|
1571
|
-
if
|
|
1578
|
+
if remaining_retries > 0:
|
|
1572
1579
|
return await self._retry_request(
|
|
1573
1580
|
input_options,
|
|
1574
1581
|
cast_to,
|
|
@@ -51,6 +51,8 @@ class Payi(SyncAPIClient):
|
|
|
51
51
|
categories: resources.CategoriesResource
|
|
52
52
|
experiences: resources.ExperiencesResource
|
|
53
53
|
csat: resources.CsatResource
|
|
54
|
+
billing_models: resources.BillingModelsResource
|
|
55
|
+
price_modifiers: resources.PriceModifiersResource
|
|
54
56
|
with_raw_response: PayiWithRawResponse
|
|
55
57
|
with_streaming_response: PayiWithStreamedResponse
|
|
56
58
|
|
|
@@ -113,6 +115,8 @@ class Payi(SyncAPIClient):
|
|
|
113
115
|
self.categories = resources.CategoriesResource(self)
|
|
114
116
|
self.experiences = resources.ExperiencesResource(self)
|
|
115
117
|
self.csat = resources.CsatResource(self)
|
|
118
|
+
self.billing_models = resources.BillingModelsResource(self)
|
|
119
|
+
self.price_modifiers = resources.PriceModifiersResource(self)
|
|
116
120
|
self.with_raw_response = PayiWithRawResponse(self)
|
|
117
121
|
self.with_streaming_response = PayiWithStreamedResponse(self)
|
|
118
122
|
|
|
@@ -227,6 +231,8 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
227
231
|
categories: resources.AsyncCategoriesResource
|
|
228
232
|
experiences: resources.AsyncExperiencesResource
|
|
229
233
|
csat: resources.AsyncCsatResource
|
|
234
|
+
billing_models: resources.AsyncBillingModelsResource
|
|
235
|
+
price_modifiers: resources.AsyncPriceModifiersResource
|
|
230
236
|
with_raw_response: AsyncPayiWithRawResponse
|
|
231
237
|
with_streaming_response: AsyncPayiWithStreamedResponse
|
|
232
238
|
|
|
@@ -289,6 +295,8 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
289
295
|
self.categories = resources.AsyncCategoriesResource(self)
|
|
290
296
|
self.experiences = resources.AsyncExperiencesResource(self)
|
|
291
297
|
self.csat = resources.AsyncCsatResource(self)
|
|
298
|
+
self.billing_models = resources.AsyncBillingModelsResource(self)
|
|
299
|
+
self.price_modifiers = resources.AsyncPriceModifiersResource(self)
|
|
292
300
|
self.with_raw_response = AsyncPayiWithRawResponse(self)
|
|
293
301
|
self.with_streaming_response = AsyncPayiWithStreamedResponse(self)
|
|
294
302
|
|
|
@@ -404,6 +412,8 @@ class PayiWithRawResponse:
|
|
|
404
412
|
self.categories = resources.CategoriesResourceWithRawResponse(client.categories)
|
|
405
413
|
self.experiences = resources.ExperiencesResourceWithRawResponse(client.experiences)
|
|
406
414
|
self.csat = resources.CsatResourceWithRawResponse(client.csat)
|
|
415
|
+
self.billing_models = resources.BillingModelsResourceWithRawResponse(client.billing_models)
|
|
416
|
+
self.price_modifiers = resources.PriceModifiersResourceWithRawResponse(client.price_modifiers)
|
|
407
417
|
|
|
408
418
|
|
|
409
419
|
class AsyncPayiWithRawResponse:
|
|
@@ -413,6 +423,8 @@ class AsyncPayiWithRawResponse:
|
|
|
413
423
|
self.categories = resources.AsyncCategoriesResourceWithRawResponse(client.categories)
|
|
414
424
|
self.experiences = resources.AsyncExperiencesResourceWithRawResponse(client.experiences)
|
|
415
425
|
self.csat = resources.AsyncCsatResourceWithRawResponse(client.csat)
|
|
426
|
+
self.billing_models = resources.AsyncBillingModelsResourceWithRawResponse(client.billing_models)
|
|
427
|
+
self.price_modifiers = resources.AsyncPriceModifiersResourceWithRawResponse(client.price_modifiers)
|
|
416
428
|
|
|
417
429
|
|
|
418
430
|
class PayiWithStreamedResponse:
|
|
@@ -422,6 +434,8 @@ class PayiWithStreamedResponse:
|
|
|
422
434
|
self.categories = resources.CategoriesResourceWithStreamingResponse(client.categories)
|
|
423
435
|
self.experiences = resources.ExperiencesResourceWithStreamingResponse(client.experiences)
|
|
424
436
|
self.csat = resources.CsatResourceWithStreamingResponse(client.csat)
|
|
437
|
+
self.billing_models = resources.BillingModelsResourceWithStreamingResponse(client.billing_models)
|
|
438
|
+
self.price_modifiers = resources.PriceModifiersResourceWithStreamingResponse(client.price_modifiers)
|
|
425
439
|
|
|
426
440
|
|
|
427
441
|
class AsyncPayiWithStreamedResponse:
|
|
@@ -431,6 +445,8 @@ class AsyncPayiWithStreamedResponse:
|
|
|
431
445
|
self.categories = resources.AsyncCategoriesResourceWithStreamingResponse(client.categories)
|
|
432
446
|
self.experiences = resources.AsyncExperiencesResourceWithStreamingResponse(client.experiences)
|
|
433
447
|
self.csat = resources.AsyncCsatResourceWithStreamingResponse(client.csat)
|
|
448
|
+
self.billing_models = resources.AsyncBillingModelsResourceWithStreamingResponse(client.billing_models)
|
|
449
|
+
self.price_modifiers = resources.AsyncPriceModifiersResourceWithStreamingResponse(client.price_modifiers)
|
|
434
450
|
|
|
435
451
|
|
|
436
452
|
Client = Payi
|
|
@@ -192,6 +192,9 @@ class BaseAPIResponse(Generic[R]):
|
|
|
192
192
|
if cast_to == float:
|
|
193
193
|
return cast(R, float(response.text))
|
|
194
194
|
|
|
195
|
+
if cast_to == bool:
|
|
196
|
+
return cast(R, response.text.lower() == "true")
|
|
197
|
+
|
|
195
198
|
origin = get_origin(cast_to) or cast_to
|
|
196
199
|
|
|
197
200
|
if origin == APIResponse:
|
|
@@ -40,6 +40,22 @@ from .experiences import (
|
|
|
40
40
|
ExperiencesResourceWithStreamingResponse,
|
|
41
41
|
AsyncExperiencesResourceWithStreamingResponse,
|
|
42
42
|
)
|
|
43
|
+
from .billing_models import (
|
|
44
|
+
BillingModelsResource,
|
|
45
|
+
AsyncBillingModelsResource,
|
|
46
|
+
BillingModelsResourceWithRawResponse,
|
|
47
|
+
AsyncBillingModelsResourceWithRawResponse,
|
|
48
|
+
BillingModelsResourceWithStreamingResponse,
|
|
49
|
+
AsyncBillingModelsResourceWithStreamingResponse,
|
|
50
|
+
)
|
|
51
|
+
from .price_modifiers import (
|
|
52
|
+
PriceModifiersResource,
|
|
53
|
+
AsyncPriceModifiersResource,
|
|
54
|
+
PriceModifiersResourceWithRawResponse,
|
|
55
|
+
AsyncPriceModifiersResourceWithRawResponse,
|
|
56
|
+
PriceModifiersResourceWithStreamingResponse,
|
|
57
|
+
AsyncPriceModifiersResourceWithStreamingResponse,
|
|
58
|
+
)
|
|
43
59
|
|
|
44
60
|
__all__ = [
|
|
45
61
|
"BudgetsResource",
|
|
@@ -72,4 +88,16 @@ __all__ = [
|
|
|
72
88
|
"AsyncCsatResourceWithRawResponse",
|
|
73
89
|
"CsatResourceWithStreamingResponse",
|
|
74
90
|
"AsyncCsatResourceWithStreamingResponse",
|
|
91
|
+
"BillingModelsResource",
|
|
92
|
+
"AsyncBillingModelsResource",
|
|
93
|
+
"BillingModelsResourceWithRawResponse",
|
|
94
|
+
"AsyncBillingModelsResourceWithRawResponse",
|
|
95
|
+
"BillingModelsResourceWithStreamingResponse",
|
|
96
|
+
"AsyncBillingModelsResourceWithStreamingResponse",
|
|
97
|
+
"PriceModifiersResource",
|
|
98
|
+
"AsyncPriceModifiersResource",
|
|
99
|
+
"PriceModifiersResourceWithRawResponse",
|
|
100
|
+
"AsyncPriceModifiersResourceWithRawResponse",
|
|
101
|
+
"PriceModifiersResourceWithStreamingResponse",
|
|
102
|
+
"AsyncPriceModifiersResourceWithStreamingResponse",
|
|
75
103
|
]
|