You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[get](docs/sdks/webhooks/README.md#get) - Get webhook
100
116
*[list](docs/sdks/webhooks/README.md#list) - List webhooks
101
-
<!-- End SDK Available Operations -->
117
+
<!-- End Available Resources and Operations [operations] -->
118
+
119
+
120
+
121
+
<!-- Start Retries [retries] -->
122
+
## Retries
123
+
124
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
125
+
126
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
127
+
```python
128
+
import codatplatform
129
+
from codatplatform.models import shared
130
+
from codatplatform.utils import BackoffStrategy, RetryConfig
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
223
+
224
+
| # | Server | Variables |
225
+
| - | ------ | --------- |
226
+
| 0 |`https://api.codat.io`| None |
227
+
228
+
#### Example
229
+
230
+
```python
231
+
import codatplatform
232
+
from codatplatform.models import shared
233
+
234
+
s = codatplatform.CodatPlatform(
235
+
server_idx=0,
236
+
security=shared.Security(
237
+
auth_header="<YOUR_API_KEY_HERE>",
238
+
),
239
+
)
240
+
241
+
req = shared.CreateAPIKey(
242
+
name='azure-invoice-finance-processor',
243
+
)
244
+
245
+
res = s.settings.create_api_key(req)
103
246
247
+
if res.api_key_details isnotNone:
248
+
# handle response
249
+
pass
250
+
```
104
251
105
-
<!-- Start Dev Containers -->
106
252
253
+
### Override Server URL Per-Client
107
254
255
+
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
256
+
```python
257
+
import codatplatform
258
+
from codatplatform.models import shared
108
259
109
-
<!-- End Dev Containers -->
260
+
s = codatplatform.CodatPlatform(
261
+
server_url="https://api.codat.io",
262
+
security=shared.Security(
263
+
auth_header="<YOUR_API_KEY_HERE>",
264
+
),
265
+
)
266
+
267
+
req = shared.CreateAPIKey(
268
+
name='azure-invoice-finance-processor',
269
+
)
270
+
271
+
res = s.settings.create_api_key(req)
272
+
273
+
if res.api_key_details isnotNone:
274
+
# handle response
275
+
pass
276
+
```
277
+
<!-- End Server Selection [server] -->
278
+
279
+
<!-- Start Custom HTTP Client [http-client] -->
280
+
## Custom HTTP Client
281
+
282
+
The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
283
+
284
+
For example, you could specify a header for every request that this sdk makes as follows:
0 commit comments