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
@@ -89,6 +88,232 @@ if res.bank_feed_account_mapping_response is not None:
89
88
90
89
<!-- End Dev Containers -->
91
90
91
+
92
+
93
+
<!-- Start Retries -->
94
+
## Retries
95
+
96
+
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.
97
+
98
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
99
+
```python
100
+
import codatbankfeeds
101
+
from codatbankfeeds.models import shared
102
+
from codatbankfeeds.utils import BackoffStrategy, RetryConfig
103
+
104
+
s = codatbankfeeds.CodatBankFeeds(
105
+
security=shared.Security(
106
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
107
+
),
108
+
)
109
+
110
+
req = shared.CompanyRequestBody(
111
+
description='Requested early access to the new financing scheme.',
description='Requested early access to the new financing scheme.',
138
+
name='Bank of Dave',
139
+
)
140
+
141
+
res = s.companies.create(req)
142
+
143
+
if res.company isnotNone:
144
+
# handle response
145
+
pass
146
+
```
147
+
<!-- End Retries -->
148
+
149
+
150
+
151
+
<!-- Start Error Handling -->
152
+
## Error Handling
153
+
154
+
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.
description='Requested early access to the new financing scheme.',
175
+
name='Bank of Dave',
176
+
)
177
+
178
+
res =None
179
+
try:
180
+
res = s.companies.create(req)
181
+
except (errors.ErrorMessage) as e:
182
+
print(e) # handle exception
183
+
184
+
except (errors.SDKError) as e:
185
+
print(e) # handle exception
186
+
187
+
188
+
if res.company isnotNone:
189
+
# handle response
190
+
pass
191
+
```
192
+
193
+
<!-- End Error Handling -->
194
+
195
+
196
+
197
+
<!-- Start Server Selection -->
198
+
## Server Selection
199
+
200
+
### Select Server by Index
201
+
202
+
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:
203
+
204
+
| # | Server | Variables |
205
+
| - | ------ | --------- |
206
+
| 0 |`https://api.codat.io`| None |
207
+
208
+
#### Example
209
+
210
+
```python
211
+
import codatbankfeeds
212
+
from codatbankfeeds.models import shared
213
+
214
+
s = codatbankfeeds.CodatBankFeeds(
215
+
server_idx=0,
216
+
security=shared.Security(
217
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
218
+
),
219
+
)
220
+
221
+
req = shared.CompanyRequestBody(
222
+
description='Requested early access to the new financing scheme.',
223
+
name='Bank of Dave',
224
+
)
225
+
226
+
res = s.companies.create(req)
227
+
228
+
if res.company isnotNone:
229
+
# handle response
230
+
pass
231
+
```
232
+
233
+
234
+
### Override Server URL Per-Client
235
+
236
+
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:
237
+
```python
238
+
import codatbankfeeds
239
+
from codatbankfeeds.models import shared
240
+
241
+
s = codatbankfeeds.CodatBankFeeds(
242
+
server_url="https://api.codat.io",
243
+
security=shared.Security(
244
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
245
+
),
246
+
)
247
+
248
+
req = shared.CompanyRequestBody(
249
+
description='Requested early access to the new financing scheme.',
250
+
name='Bank of Dave',
251
+
)
252
+
253
+
res = s.companies.create(req)
254
+
255
+
if res.company isnotNone:
256
+
# handle response
257
+
pass
258
+
```
259
+
<!-- End Server Selection -->
260
+
261
+
262
+
263
+
<!-- Start Custom HTTP Client -->
264
+
## Custom HTTP Client
265
+
266
+
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.
267
+
268
+
For example, you could specify a header for every request that this sdk makes as follows:
|`content_type`|*str*|:heavy_check_mark:| HTTP response content type for this operation |
10
-
|`error_message`|[Optional[shared.ErrorMessage]](../../models/shared/errormessage.md)|:heavy_minus_sign:| The request made is not valid. |
11
10
|`status_code`|*int*|:heavy_check_mark:| HTTP response status code for this operation |
12
-
|`raw_response`|[requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response)|:heavy_minus_sign:| Raw HTTP response; suitable for custom response parsing |
11
+
|`raw_response`|[requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response)|:heavy_check_mark:| Raw HTTP response; suitable for custom response parsing |
0 commit comments