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
@@ -144,25 +117,223 @@ if res.create_account_response is not None:
144
117
145
118
*[get](docs/sdks/transactionstatus/README.md#get) - Get sync transaction
146
119
*[list](docs/sdks/transactionstatus/README.md#list) - List sync transactions
147
-
<!-- End SDK Available Operations -->
120
+
<!-- End Available Resources and Operations [operations] -->
121
+
122
+
123
+
124
+
<!-- Start Retries [retries] -->
125
+
## Retries
126
+
127
+
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.
128
+
129
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
130
+
```python
131
+
import codatsyncexpenses
132
+
from codatsyncexpenses.models import shared
133
+
from codatsyncexpenses.utils import BackoffStrategy, RetryConfig
134
+
135
+
s = codatsyncexpenses.CodatSyncExpenses(
136
+
security=shared.Security(
137
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
138
+
),
139
+
)
140
+
141
+
req = shared.CompanyRequestBody(
142
+
description='Requested early access to the new financing scheme.',
description='Requested early access to the new financing scheme.',
169
+
name='Bank of Dave',
170
+
)
171
+
172
+
res = s.companies.create(req)
173
+
174
+
if res.company isnotNone:
175
+
# handle response
176
+
pass
177
+
```
178
+
<!-- End Retries [retries] -->
179
+
180
+
<!-- Start Error Handling [errors] -->
181
+
## Error Handling
182
+
183
+
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.',
204
+
name='Bank of Dave',
205
+
)
206
+
207
+
res =None
208
+
try:
209
+
res = s.companies.create(req)
210
+
except errors.ErrorMessage as e:
211
+
print(e) # handle exception
212
+
raise(e)
213
+
except errors.SDKError as e:
214
+
print(e) # handle exception
215
+
raise(e)
216
+
217
+
if res.company isnotNone:
218
+
# handle response
219
+
pass
220
+
```
221
+
<!-- End Error Handling [errors] -->
222
+
223
+
<!-- Start Server Selection [server] -->
224
+
## Server Selection
225
+
226
+
### Select Server by Index
227
+
228
+
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:
229
+
230
+
| # | Server | Variables |
231
+
| - | ------ | --------- |
232
+
| 0 |`https://api.codat.io`| None |
233
+
234
+
#### Example
235
+
236
+
```python
237
+
import codatsyncexpenses
238
+
from codatsyncexpenses.models import shared
239
+
240
+
s = codatsyncexpenses.CodatSyncExpenses(
241
+
server_idx=0,
242
+
security=shared.Security(
243
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
244
+
),
245
+
)
246
+
247
+
req = shared.CompanyRequestBody(
248
+
description='Requested early access to the new financing scheme.',
249
+
name='Bank of Dave',
250
+
)
251
+
252
+
res = s.companies.create(req)
253
+
254
+
if res.company isnotNone:
255
+
# handle response
256
+
pass
257
+
```
258
+
259
+
260
+
### Override Server URL Per-Client
148
261
149
-
<!-- Start Dev Containers -->
262
+
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:
263
+
```python
264
+
import codatsyncexpenses
265
+
from codatsyncexpenses.models import shared
266
+
267
+
s = codatsyncexpenses.CodatSyncExpenses(
268
+
server_url="https://api.codat.io",
269
+
security=shared.Security(
270
+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
271
+
),
272
+
)
150
273
151
-
<!-- End Dev Containers -->
274
+
req = shared.CompanyRequestBody(
275
+
description='Requested early access to the new financing scheme.',
276
+
name='Bank of Dave',
277
+
)
152
278
279
+
res = s.companies.create(req)
153
280
281
+
if res.company isnotNone:
282
+
# handle response
283
+
pass
284
+
```
285
+
<!-- End Server Selection [server] -->
154
286
155
-
<!-- Start Pagination-->
156
-
#Pagination
287
+
<!-- Start Custom HTTP Client [http-client]-->
288
+
## Custom HTTP Client
157
289
158
-
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
159
-
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
160
-
return value of `Next` is `None`, then there are no more pages to be fetched.
290
+
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.
161
291
162
-
Here's an example of one such pagination call:
292
+
For example, you could specify a header for every request that this sdk makes as follows:
0 commit comments