voltaria-sdk 2.34.5__py3-none-any.whl
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.
- voltaria/__init__.py +14 -0
- voltaria/_generated/CONTRIBUTING.md +125 -0
- voltaria/_generated/README.md +190 -0
- voltaria/_generated/__init__.py +385 -0
- voltaria/_generated/_default_clients.py +30 -0
- voltaria/_generated/accounts/__init__.py +34 -0
- voltaria/_generated/accounts/client.py +513 -0
- voltaria/_generated/accounts/raw_client.py +729 -0
- voltaria/_generated/accounts/types/__init__.py +36 -0
- voltaria/_generated/accounts/types/partner_client_account_create_request_status.py +5 -0
- voltaria/_generated/client.py +407 -0
- voltaria/_generated/clients/__init__.py +34 -0
- voltaria/_generated/clients/client.py +1389 -0
- voltaria/_generated/clients/raw_client.py +2037 -0
- voltaria/_generated/clients/types/__init__.py +36 -0
- voltaria/_generated/clients/types/limit_request_create_payload_requested_limit.py +5 -0
- voltaria/_generated/core/__init__.py +127 -0
- voltaria/_generated/core/api_error.py +23 -0
- voltaria/_generated/core/client_wrapper.py +117 -0
- voltaria/_generated/core/datetime_utils.py +70 -0
- voltaria/_generated/core/file.py +67 -0
- voltaria/_generated/core/force_multipart.py +18 -0
- voltaria/_generated/core/http_client.py +839 -0
- voltaria/_generated/core/http_response.py +59 -0
- voltaria/_generated/core/http_sse/__init__.py +42 -0
- voltaria/_generated/core/http_sse/_api.py +148 -0
- voltaria/_generated/core/http_sse/_decoders.py +61 -0
- voltaria/_generated/core/http_sse/_exceptions.py +7 -0
- voltaria/_generated/core/http_sse/_models.py +17 -0
- voltaria/_generated/core/jsonable_encoder.py +120 -0
- voltaria/_generated/core/logging.py +107 -0
- voltaria/_generated/core/parse_error.py +36 -0
- voltaria/_generated/core/pydantic_utilities.py +634 -0
- voltaria/_generated/core/query_encoder.py +58 -0
- voltaria/_generated/core/remove_none_from_dict.py +11 -0
- voltaria/_generated/core/request_options.py +35 -0
- voltaria/_generated/core/serialization.py +276 -0
- voltaria/_generated/documents/__init__.py +4 -0
- voltaria/_generated/documents/client.py +530 -0
- voltaria/_generated/documents/raw_client.py +780 -0
- voltaria/_generated/drawdowns/__init__.py +34 -0
- voltaria/_generated/drawdowns/client.py +349 -0
- voltaria/_generated/drawdowns/raw_client.py +564 -0
- voltaria/_generated/drawdowns/types/__init__.py +34 -0
- voltaria/_generated/drawdowns/types/drawdown_create_payload_amount.py +5 -0
- voltaria/_generated/environment.py +8 -0
- voltaria/_generated/errors/__init__.py +53 -0
- voltaria/_generated/errors/bad_request_error.py +10 -0
- voltaria/_generated/errors/conflict_error.py +10 -0
- voltaria/_generated/errors/forbidden_error.py +10 -0
- voltaria/_generated/errors/internal_server_error.py +10 -0
- voltaria/_generated/errors/not_found_error.py +10 -0
- voltaria/_generated/errors/unprocessable_entity_error.py +10 -0
- voltaria/_generated/installments/__init__.py +37 -0
- voltaria/_generated/installments/client.py +803 -0
- voltaria/_generated/installments/raw_client.py +1249 -0
- voltaria/_generated/installments/types/__init__.py +38 -0
- voltaria/_generated/installments/types/installment_edit_payload_amount.py +5 -0
- voltaria/_generated/installments/types/payment_promise_create_payload_amount.py +5 -0
- voltaria/_generated/investors/__init__.py +4 -0
- voltaria/_generated/investors/client.py +720 -0
- voltaria/_generated/investors/raw_client.py +977 -0
- voltaria/_generated/loans/__init__.py +37 -0
- voltaria/_generated/loans/client.py +787 -0
- voltaria/_generated/loans/raw_client.py +1186 -0
- voltaria/_generated/loans/types/__init__.py +38 -0
- voltaria/_generated/loans/types/loan_create_payload_amount.py +5 -0
- voltaria/_generated/loans/types/loan_default_payload_sold_amount.py +5 -0
- voltaria/_generated/partners/__init__.py +4 -0
- voltaria/_generated/partners/client.py +281 -0
- voltaria/_generated/partners/raw_client.py +375 -0
- voltaria/_generated/reference.md +5828 -0
- voltaria/_generated/repayments/__init__.py +34 -0
- voltaria/_generated/repayments/client.py +528 -0
- voltaria/_generated/repayments/raw_client.py +641 -0
- voltaria/_generated/repayments/types/__init__.py +34 -0
- voltaria/_generated/repayments/types/repayment_create_payload_amount.py +5 -0
- voltaria/_generated/sandbox/__init__.py +34 -0
- voltaria/_generated/sandbox/client.py +324 -0
- voltaria/_generated/sandbox/raw_client.py +522 -0
- voltaria/_generated/sandbox/types/__init__.py +34 -0
- voltaria/_generated/sandbox/types/client_update_sandbox_limit.py +5 -0
- voltaria/_generated/tests/conftest.py +21 -0
- voltaria/_generated/tests/test_aiohttp_autodetect.py +113 -0
- voltaria/_generated/types/__init__.py +292 -0
- voltaria/_generated/types/account_address.py +46 -0
- voltaria/_generated/types/account_holder_type_enum.py +5 -0
- voltaria/_generated/types/account_status_enum.py +5 -0
- voltaria/_generated/types/available_document_categories_response.py +22 -0
- voltaria/_generated/types/available_funding.py +30 -0
- voltaria/_generated/types/bulk_loan_item_payload.py +56 -0
- voltaria/_generated/types/bulk_loan_item_payload_amount.py +5 -0
- voltaria/_generated/types/bulk_loan_item_result.py +52 -0
- voltaria/_generated/types/bulk_loan_result.py +43 -0
- voltaria/_generated/types/bulk_loan_task_response.py +32 -0
- voltaria/_generated/types/bulk_loan_task_status.py +48 -0
- voltaria/_generated/types/bulk_repayment_item_payload.py +54 -0
- voltaria/_generated/types/bulk_repayment_item_payload_amount.py +5 -0
- voltaria/_generated/types/bulk_repayment_item_result.py +52 -0
- voltaria/_generated/types/bulk_repayment_result.py +43 -0
- voltaria/_generated/types/bulk_repayment_task_response.py +32 -0
- voltaria/_generated/types/bulk_repayment_task_status.py +48 -0
- voltaria/_generated/types/checklist_summary_partner_response.py +49 -0
- voltaria/_generated/types/checklist_type_enum.py +5 -0
- voltaria/_generated/types/client_account_response.py +86 -0
- voltaria/_generated/types/client_base_info.py +45 -0
- voltaria/_generated/types/client_data_response.py +38 -0
- voltaria/_generated/types/client_investor_response.py +66 -0
- voltaria/_generated/types/client_limit_response.py +28 -0
- voltaria/_generated/types/client_response.py +77 -0
- voltaria/_generated/types/client_status_enum.py +10 -0
- voltaria/_generated/types/client_type_enum.py +5 -0
- voltaria/_generated/types/client_user_response.py +44 -0
- voltaria/_generated/types/client_user_status_enum.py +5 -0
- voltaria/_generated/types/currency_enum.py +5 -0
- voltaria/_generated/types/currency_field_spec.py +27 -0
- voltaria/_generated/types/document_response.py +78 -0
- voltaria/_generated/types/drawdown_checklist_response.py +58 -0
- voltaria/_generated/types/drawdown_response.py +55 -0
- voltaria/_generated/types/drawdown_status_enum.py +5 -0
- voltaria/_generated/types/http_validation_error.py +20 -0
- voltaria/_generated/types/installment_response.py +100 -0
- voltaria/_generated/types/installment_response_with_client_info.py +106 -0
- voltaria/_generated/types/installment_status_enum.py +8 -0
- voltaria/_generated/types/jurisdiction_enum.py +5 -0
- voltaria/_generated/types/kyc_status_enum.py +5 -0
- voltaria/_generated/types/limit_request_response.py +59 -0
- voltaria/_generated/types/limit_request_status_enum.py +5 -0
- voltaria/_generated/types/loan_installment_create_payload.py +29 -0
- voltaria/_generated/types/loan_installment_create_payload_amount.py +5 -0
- voltaria/_generated/types/loan_installment_response.py +54 -0
- voltaria/_generated/types/loan_investor_response.py +117 -0
- voltaria/_generated/types/loan_payment_status_enum.py +5 -0
- voltaria/_generated/types/loan_response_with_client_info.py +112 -0
- voltaria/_generated/types/loan_response_with_installments.py +112 -0
- voltaria/_generated/types/loan_status_enum.py +20 -0
- voltaria/_generated/types/paginated_response_checklist_summary_partner_response.py +54 -0
- voltaria/_generated/types/paginated_response_client_account_response.py +54 -0
- voltaria/_generated/types/paginated_response_client_investor_response.py +54 -0
- voltaria/_generated/types/paginated_response_client_response.py +54 -0
- voltaria/_generated/types/paginated_response_document_response.py +54 -0
- voltaria/_generated/types/paginated_response_drawdown_checklist_response.py +54 -0
- voltaria/_generated/types/paginated_response_drawdown_response.py +54 -0
- voltaria/_generated/types/paginated_response_installment_response_with_client_info.py +54 -0
- voltaria/_generated/types/paginated_response_limit_request_response.py +54 -0
- voltaria/_generated/types/paginated_response_loan_investor_response.py +54 -0
- voltaria/_generated/types/paginated_response_loan_response_with_client_info.py +54 -0
- voltaria/_generated/types/paginated_response_payment_promise_response.py +54 -0
- voltaria/_generated/types/paginated_response_repayment_response_with_client_info.py +54 -0
- voltaria/_generated/types/paginated_response_waiver_response.py +54 -0
- voltaria/_generated/types/paginated_response_waterfall_response.py +54 -0
- voltaria/_generated/types/paginated_response_webhook_log_response.py +54 -0
- voltaria/_generated/types/paginated_response_webhook_subscription_response.py +54 -0
- voltaria/_generated/types/partner_data_response.py +33 -0
- voltaria/_generated/types/payment_promise_response.py +74 -0
- voltaria/_generated/types/payment_promise_status_enum.py +5 -0
- voltaria/_generated/types/repayment_response.py +83 -0
- voltaria/_generated/types/repayment_response_with_client_info.py +89 -0
- voltaria/_generated/types/role_response.py +21 -0
- voltaria/_generated/types/validation_error.py +24 -0
- voltaria/_generated/types/validation_error_loc_item.py +5 -0
- voltaria/_generated/types/waiver_response.py +70 -0
- voltaria/_generated/types/waiver_status_enum.py +5 -0
- voltaria/_generated/types/waterfall_response.py +74 -0
- voltaria/_generated/types/waterfall_status_enum.py +5 -0
- voltaria/_generated/types/webhook_event_type_enum.py +10 -0
- voltaria/_generated/types/webhook_log_response.py +75 -0
- voltaria/_generated/types/webhook_log_response_request_body.py +5 -0
- voltaria/_generated/types/webhook_status_enum.py +5 -0
- voltaria/_generated/types/webhook_subscription_response.py +65 -0
- voltaria/_generated/webhooks/__init__.py +4 -0
- voltaria/_generated/webhooks/client.py +673 -0
- voltaria/_generated/webhooks/raw_client.py +941 -0
- voltaria/_wrapper.py +135 -0
- voltaria_sdk-2.34.5.dist-info/METADATA +9 -0
- voltaria_sdk-2.34.5.dist-info/RECORD +177 -0
- voltaria_sdk-2.34.5.dist-info/WHEEL +4 -0
voltaria/__init__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Hand-written package entry — NOT generated by Fern.
|
|
2
|
+
#
|
|
3
|
+
# Re-exports the full generated surface from the `_generated` subpackage, then
|
|
4
|
+
# overrides the public client classes with the prefix-routing wrapper. Because
|
|
5
|
+
# `from ._generated import *` is dynamic, new models/enums/resources added to
|
|
6
|
+
# the API show up here automatically on the next `fern generate` — nothing here
|
|
7
|
+
# needs hand-editing when the API grows.
|
|
8
|
+
|
|
9
|
+
from ._generated import * # noqa: F401, F403
|
|
10
|
+
from ._wrapper import AsyncVoltaria, InvalidApiKeyError, Voltaria # noqa: F401
|
|
11
|
+
|
|
12
|
+
# `Voltaria` / `AsyncVoltaria` above intentionally shadow the generated client
|
|
13
|
+
# classes pulled in by the star import, so `from voltaria import Voltaria`
|
|
14
|
+
# resolves to the prefix-routing wrapper.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Python 3.9+
|
|
10
|
+
- pip
|
|
11
|
+
- poetry
|
|
12
|
+
|
|
13
|
+
### Installation
|
|
14
|
+
|
|
15
|
+
Install the project dependencies:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
poetry install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Building
|
|
22
|
+
|
|
23
|
+
Build the project:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
poetry build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Testing
|
|
30
|
+
|
|
31
|
+
Run the test suite:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
poetry run pytest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Linting and Formatting
|
|
38
|
+
|
|
39
|
+
Check code style:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
poetry run ruff check .
|
|
43
|
+
poetry run ruff format .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Type Checking
|
|
47
|
+
|
|
48
|
+
Run the type checker:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
poetry run mypy .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## About Generated Code
|
|
55
|
+
|
|
56
|
+
**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
|
|
57
|
+
|
|
58
|
+
### Generated Files
|
|
59
|
+
|
|
60
|
+
The following directories contain generated code:
|
|
61
|
+
- `src/` - API client classes and types
|
|
62
|
+
- Most Python files in the project
|
|
63
|
+
|
|
64
|
+
### How to Customize
|
|
65
|
+
|
|
66
|
+
If you need to customize the SDK, you have two options:
|
|
67
|
+
|
|
68
|
+
#### Option 1: Use `.fernignore`
|
|
69
|
+
|
|
70
|
+
For custom code that should persist across SDK regenerations:
|
|
71
|
+
|
|
72
|
+
1. Create a `.fernignore` file in the project root
|
|
73
|
+
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
|
|
74
|
+
3. Add your custom code to those files
|
|
75
|
+
|
|
76
|
+
Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
|
|
77
|
+
|
|
78
|
+
For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
|
|
79
|
+
|
|
80
|
+
#### Option 2: Contribute to the Generator
|
|
81
|
+
|
|
82
|
+
If you want to change how code is generated for all users of this SDK:
|
|
83
|
+
|
|
84
|
+
1. The Python SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
|
|
85
|
+
2. Generator code is located at `generators/python-v2/`
|
|
86
|
+
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
|
|
87
|
+
4. Submit a pull request with your changes to the generator
|
|
88
|
+
|
|
89
|
+
This approach is best for:
|
|
90
|
+
- Bug fixes in generated code
|
|
91
|
+
- New features that would benefit all users
|
|
92
|
+
- Improvements to code generation patterns
|
|
93
|
+
|
|
94
|
+
## Making Changes
|
|
95
|
+
|
|
96
|
+
### Workflow
|
|
97
|
+
|
|
98
|
+
1. Create a new branch for your changes
|
|
99
|
+
2. Make your modifications
|
|
100
|
+
3. Run tests to ensure nothing breaks: `poetry run pytest`
|
|
101
|
+
4. Run linting and formatting: `poetry run ruff check .` and `poetry run ruff format .`
|
|
102
|
+
5. Run type checking: `poetry run mypy .`
|
|
103
|
+
6. Build the project: `poetry build`
|
|
104
|
+
7. Commit your changes with a clear commit message
|
|
105
|
+
8. Push your branch and create a pull request
|
|
106
|
+
|
|
107
|
+
### Commit Messages
|
|
108
|
+
|
|
109
|
+
Write clear, descriptive commit messages that explain what changed and why.
|
|
110
|
+
|
|
111
|
+
### Code Style
|
|
112
|
+
|
|
113
|
+
This project uses automated code formatting and linting. Run `poetry run ruff format .` and `poetry run ruff check .` before committing to ensure your code meets the project's style guidelines.
|
|
114
|
+
|
|
115
|
+
## Questions or Issues?
|
|
116
|
+
|
|
117
|
+
If you have questions or run into issues:
|
|
118
|
+
|
|
119
|
+
1. Check the [Fern documentation](https://buildwithfern.com)
|
|
120
|
+
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
|
|
121
|
+
3. Open a new issue if your question hasn't been addressed
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Voltaria Python Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Voltaria%2FPython)
|
|
4
|
+
[](https://pypi.python.org/pypi/voltaria_sdk)
|
|
5
|
+
|
|
6
|
+
The Voltaria Python library provides convenient access to the Voltaria APIs from Python.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Reference](#reference)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Environments](#environments)
|
|
14
|
+
- [Async Client](#async-client)
|
|
15
|
+
- [Exception Handling](#exception-handling)
|
|
16
|
+
- [Advanced](#advanced)
|
|
17
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
18
|
+
- [Retries](#retries)
|
|
19
|
+
- [Timeouts](#timeouts)
|
|
20
|
+
- [Custom Client](#custom-client)
|
|
21
|
+
- [Contributing](#contributing)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pip install voltaria_sdk
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Reference
|
|
30
|
+
|
|
31
|
+
A full reference for this library is available [here](./reference.md).
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
Instantiate and use the client with the following:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from voltaria import Voltaria
|
|
39
|
+
|
|
40
|
+
client = Voltaria(
|
|
41
|
+
token="<token>",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
client.clients.create_client(
|
|
45
|
+
name="ACME Corp",
|
|
46
|
+
jurisdiction="eu",
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Environments
|
|
51
|
+
|
|
52
|
+
This SDK allows you to configure different environments for API requests.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from voltaria import Voltaria
|
|
56
|
+
from voltaria_sdk.environment import VoltariaEnvironment
|
|
57
|
+
|
|
58
|
+
client = Voltaria(
|
|
59
|
+
environment=VoltariaEnvironment.SANDBOX,
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Async Client
|
|
64
|
+
|
|
65
|
+
The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
import asyncio
|
|
69
|
+
|
|
70
|
+
from voltaria import AsyncVoltaria
|
|
71
|
+
|
|
72
|
+
client = AsyncVoltaria(
|
|
73
|
+
token="<token>",
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
async def main() -> None:
|
|
78
|
+
await client.clients.create_client(
|
|
79
|
+
name="ACME Corp",
|
|
80
|
+
jurisdiction="eu",
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
asyncio.run(main())
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Exception Handling
|
|
88
|
+
|
|
89
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
90
|
+
will be thrown.
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from voltaria_sdk.core.api_error import ApiError
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
client.clients.create_client(...)
|
|
97
|
+
except ApiError as e:
|
|
98
|
+
print(e.status_code)
|
|
99
|
+
print(e.body)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Advanced
|
|
103
|
+
|
|
104
|
+
### Access Raw Response Data
|
|
105
|
+
|
|
106
|
+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
|
|
107
|
+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from voltaria import Voltaria
|
|
111
|
+
|
|
112
|
+
client = Voltaria(...)
|
|
113
|
+
response = client.clients.with_raw_response.create_client(...)
|
|
114
|
+
print(response.headers) # access the response headers
|
|
115
|
+
print(response.status_code) # access the response status code
|
|
116
|
+
print(response.data) # access the underlying object
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Retries
|
|
120
|
+
|
|
121
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
122
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
123
|
+
retry limit (default: 2).
|
|
124
|
+
|
|
125
|
+
Which status codes are retried depends on the `retryStatusCodes` generator configuration:
|
|
126
|
+
|
|
127
|
+
**`legacy`** (current default): retries on
|
|
128
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
129
|
+
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
|
130
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
131
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
|
|
132
|
+
|
|
133
|
+
**`recommended`**: retries on
|
|
134
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
135
|
+
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
|
136
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
137
|
+
- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
|
|
138
|
+
- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
|
|
139
|
+
- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
|
|
140
|
+
|
|
141
|
+
Use the `max_retries` request option to configure this behavior.
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
client.clients.create_client(..., request_options={
|
|
145
|
+
"max_retries": 1
|
|
146
|
+
})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Timeouts
|
|
150
|
+
|
|
151
|
+
The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from voltaria import Voltaria
|
|
155
|
+
|
|
156
|
+
client = Voltaria(..., timeout=20.0)
|
|
157
|
+
|
|
158
|
+
# Override timeout for a specific method
|
|
159
|
+
client.clients.create_client(..., request_options={
|
|
160
|
+
"timeout_in_seconds": 1
|
|
161
|
+
})
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Custom Client
|
|
165
|
+
|
|
166
|
+
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
|
|
167
|
+
and transports.
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
import httpx
|
|
171
|
+
from voltaria import Voltaria
|
|
172
|
+
|
|
173
|
+
client = Voltaria(
|
|
174
|
+
...,
|
|
175
|
+
httpx_client=httpx.Client(
|
|
176
|
+
proxy="http://my.test.proxy.example.com",
|
|
177
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
|
178
|
+
),
|
|
179
|
+
)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Contributing
|
|
183
|
+
|
|
184
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
185
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
186
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
187
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
188
|
+
an issue first to discuss with us!
|
|
189
|
+
|
|
190
|
+
On the other hand, contributions to the README are always very welcome!
|