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_sync_transaction](docs/sdks/transactionstatus/README.md#get_sync_transaction) - Get sync transaction
90
93
*[list_sync_transactions](docs/sdks/transactionstatus/README.md#list_sync_transactions) - Get sync transactions
91
-
<!-- End SDK Available Operations -->
94
+
<!-- End Available Resources and Operations [operations] -->
95
+
96
+
97
+
98
+
<!-- Start Retries [retries] -->
99
+
## Retries
100
+
101
+
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.
102
+
103
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
104
+
```python
105
+
import codatsyncexpenses
106
+
from codatsyncexpenses.models import shared
107
+
from codatsyncexpenses.utils import BackoffStrategy, RetryConfig
108
+
109
+
s = codatsyncexpenses.CodatSyncExpenses(
110
+
security=shared.Security(
111
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
112
+
),
113
+
)
114
+
115
+
req = shared.CompanyRequestBody(
116
+
description='Requested early access to the new financing scheme.',
description='Requested early access to the new financing scheme.',
143
+
name='Bank of Dave',
144
+
)
145
+
146
+
res = s.companies.create_company(req)
147
+
148
+
if res.company isnotNone:
149
+
# handle response
150
+
pass
151
+
```
152
+
<!-- End Retries [retries] -->
153
+
154
+
<!-- Start Error Handling [errors] -->
155
+
## Error Handling
156
+
157
+
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.',
178
+
name='Bank of Dave',
179
+
)
180
+
181
+
res =None
182
+
try:
183
+
res = s.companies.create_company(req)
184
+
except errors.ErrorMessage as e:
185
+
print(e) # handle exception
186
+
raise(e)
187
+
except errors.SDKError as e:
188
+
print(e) # handle exception
189
+
raise(e)
190
+
191
+
if res.company isnotNone:
192
+
# handle response
193
+
pass
194
+
```
195
+
<!-- End Error Handling [errors] -->
96
196
197
+
<!-- Start Server Selection [server] -->
198
+
## Server Selection
97
199
200
+
### Select Server by Index
98
201
99
-
<!-- End Dev Containers -->
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 codatsyncexpenses
212
+
from codatsyncexpenses.models import shared
213
+
214
+
s = codatsyncexpenses.CodatSyncExpenses(
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_company(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 codatsyncexpenses
239
+
from codatsyncexpenses.models import shared
240
+
241
+
s = codatsyncexpenses.CodatSyncExpenses(
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_company(req)
254
+
255
+
if res.company isnotNone:
256
+
# handle response
257
+
pass
258
+
```
259
+
<!-- End Server Selection [server] -->
260
+
261
+
<!-- Start Custom HTTP Client [http-client] -->
262
+
## Custom HTTP Client
263
+
264
+
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.
265
+
266
+
For example, you could specify a header for every request that this sdk makes as follows:
|`company`|[Optional[shared.Company]](../../models/shared/company.md)|:heavy_minus_sign:| OK |
9
9
|`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 |
|`connection`|[Optional[shared.Connection]](../../models/shared/connection.md)|:heavy_minus_sign:| OK |
9
9
|`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:| Your API request was not properly authorized. |
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