Skip to content

Commit 458ffc4

Browse files
authored
Merge pull request #522 from codatio/speakeasy-sdk-regen-1701853191
chore: 🐝 Update SDK - Generate Sync for Expenses version 1 library
2 parents cd3dcfc + a223620 commit 458ffc4

File tree

208 files changed

+1190
-684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+1190
-684
lines changed

β€Žprevious-versions/sync-for-expenses-version-1/.gitattributesβ€Ž

100755100644
File mode changed.

β€Žprevious-versions/sync-for-expenses-version-1/README.mdβ€Ž

Lines changed: 225 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44
Push expenses to accounting platforms.
55
<!-- End Codat Library Description -->
66

7-
<!-- Start SDK Installation -->
7+
<!-- Start SDK Installation [installation] -->
88
## SDK Installation
99

1010
```bash
1111
pip install codat-sync-for-expenses-version-1
1212
```
13-
<!-- End SDK Installation -->
13+
<!-- End SDK Installation [installation] -->
1414

1515
## Example Usage
16-
<!-- Start SDK Example Usage -->
16+
<!-- Start SDK Example Usage [usage] -->
17+
## SDK Example Usage
18+
19+
### Example
20+
1721
```python
1822
import codatsyncexpenses
1923
from codatsyncexpenses.models import shared
@@ -35,12 +39,11 @@ if res.company is not None:
3539
# handle response
3640
pass
3741
```
38-
<!-- End SDK Example Usage -->
42+
<!-- End SDK Example Usage [usage] -->
3943

40-
<!-- Start SDK Available Operations -->
44+
<!-- Start Available Resources and Operations [operations] -->
4145
## Available Resources and Operations
4246

43-
4447
### [companies](docs/sdks/companies/README.md)
4548

4649
* [create_company](docs/sdks/companies/README.md#create_company) - Create company
@@ -49,11 +52,6 @@ if res.company is not None:
4952
* [list_companies](docs/sdks/companies/README.md#list_companies) - List companies
5053
* [update_company](docs/sdks/companies/README.md#update_company) - Update company
5154

52-
### [configuration](docs/sdks/configuration/README.md)
53-
54-
* [get_company_configuration](docs/sdks/configuration/README.md#get_company_configuration) - Get company configuration
55-
* [save_company_configuration](docs/sdks/configuration/README.md#save_company_configuration) - Set company configuration
56-
5755
### [connections](docs/sdks/connections/README.md)
5856

5957
* [create_connection](docs/sdks/connections/README.md#create_connection) - Create connection
@@ -63,6 +61,11 @@ if res.company is not None:
6361
* [list_connections](docs/sdks/connections/README.md#list_connections) - List connections
6462
* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection
6563

64+
### [configuration](docs/sdks/configuration/README.md)
65+
66+
* [get_company_configuration](docs/sdks/configuration/README.md#get_company_configuration) - Get company configuration
67+
* [save_company_configuration](docs/sdks/configuration/README.md#save_company_configuration) - Set company configuration
68+
6669
### [expenses](docs/sdks/expenses/README.md)
6770

6871
* [create_expense_dataset](docs/sdks/expenses/README.md#create_expense_dataset) - Create expense-transactions
@@ -88,15 +91,223 @@ if res.company is not None:
8891

8992
* [get_sync_transaction](docs/sdks/transactionstatus/README.md#get_sync_transaction) - Get sync transaction
9093
* [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.',
117+
name='Bank of Dave',
118+
)
119+
120+
res = s.companies.create_company(req,
121+
RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False))
122+
123+
if res.company is not None:
124+
# handle response
125+
pass
126+
```
127+
128+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
129+
```python
130+
import codatsyncexpenses
131+
from codatsyncexpenses.models import shared
132+
from codatsyncexpenses.utils import BackoffStrategy, RetryConfig
133+
134+
s = codatsyncexpenses.CodatSyncExpenses(
135+
retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)
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.',
143+
name='Bank of Dave',
144+
)
145+
146+
res = s.companies.create_company(req)
147+
148+
if res.company is not None:
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.
92158

159+
| Error Object | Status Code | Content Type |
160+
| --------------------------- | --------------------------- | --------------------------- |
161+
| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json |
162+
| errors.SDKError | 400-600 | */* |
93163

164+
### Example
94165

95-
<!-- Start Dev Containers -->
166+
```python
167+
import codatsyncexpenses
168+
from codatsyncexpenses.models import shared
169+
170+
s = codatsyncexpenses.CodatSyncExpenses(
171+
security=shared.Security(
172+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
173+
),
174+
)
175+
176+
req = shared.CompanyRequestBody(
177+
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 is not None:
192+
# handle response
193+
pass
194+
```
195+
<!-- End Error Handling [errors] -->
96196

197+
<!-- Start Server Selection [server] -->
198+
## Server Selection
97199

200+
### Select Server by Index
98201

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 is not None:
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 is not None:
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:
267+
```python
268+
import codatsyncexpenses
269+
import requests
270+
271+
http_client = requests.Session()
272+
http_client.headers.update({'x-custom-header': 'someValue'})
273+
s = codatsyncexpenses.CodatSyncExpenses(client: http_client)
274+
```
275+
<!-- End Custom HTTP Client [http-client] -->
276+
277+
<!-- Start Authentication [security] -->
278+
## Authentication
279+
280+
### Per-Client Security Schemes
281+
282+
This SDK supports the following security scheme globally:
283+
284+
| Name | Type | Scheme |
285+
| ------------- | ------------- | ------------- |
286+
| `auth_header` | apiKey | API key |
287+
288+
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
289+
```python
290+
import codatsyncexpenses
291+
from codatsyncexpenses.models import shared
292+
293+
s = codatsyncexpenses.CodatSyncExpenses(
294+
security=shared.Security(
295+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
296+
),
297+
)
298+
299+
req = shared.CompanyRequestBody(
300+
description='Requested early access to the new financing scheme.',
301+
name='Bank of Dave',
302+
)
303+
304+
res = s.companies.create_company(req)
305+
306+
if res.company is not None:
307+
# handle response
308+
pass
309+
```
310+
<!-- End Authentication [security] -->
100311

101312
<!-- Placeholder for Future Speakeasy SDK Sections -->
102313

β€Žprevious-versions/sync-for-expenses-version-1/RELEASES.mdβ€Ž

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@ Based on:
88
### Generated
99
- [python v0.2.0] previous-versions/sync-for-expenses-version-1
1010
### Releases
11-
- [PyPI v0.2.0] https://pypi.org/project/codat-sync-for-expenses-version-1/0.2.0 - previous-versions/sync-for-expenses-version-1
11+
- [PyPI v0.2.0] https://pypi.org/project/codat-sync-for-expenses-version-1/0.2.0 - previous-versions/sync-for-expenses-version-1
12+
13+
## 2023-12-06 08:59:47
14+
### Changes
15+
Based on:
16+
- OpenAPI Doc prealpha https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses-v1.yaml
17+
- Speakeasy CLI 1.125.2 (2.210.6) https://github.com/speakeasy-api/speakeasy
18+
### Generated
19+
- [python v0.3.0] previous-versions/sync-for-expenses-version-1
20+
### Releases
21+
- [PyPI v0.3.0] https://pypi.org/project/codat-sync-for-expenses-version-1/0.3.0 - previous-versions/sync-for-expenses-version-1

β€Žprevious-versions/sync-for-expenses-version-1/USAGE.mdβ€Ž

100755100644
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<!-- Start SDK Example Usage -->
2-
3-
1+
<!-- Start SDK Example Usage [usage] -->
42
```python
53
import codatsyncexpenses
64
from codatsyncexpenses.models import shared
@@ -22,4 +20,4 @@ if res.company is not None:
2220
# handle response
2321
pass
2422
```
25-
<!-- End SDK Example Usage -->
23+
<!-- End SDK Example Usage [usage] -->
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ErrorMessage
22

3+
The request made is not valid.
4+
35

46
## Fields
57

β€Žprevious-versions/sync-for-expenses-version-1/docs/models/operations/createcompanyresponse.mdβ€Ž

100755100644
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
88
| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK |
99
| `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. |
1110
| `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 |

β€Žprevious-versions/sync-for-expenses-version-1/docs/models/operations/createconnectionrequest.mdβ€Ž

100755100644
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Fields
55

6-
| Field | Type | Required | Description | Example |
7-
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
8-
| `request_body` | [Optional[CreateConnectionRequestBody]](../../models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | |
9-
| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 |
6+
| Field | Type | Required | Description | Example |
7+
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
8+
| `request_body` | [Optional[operations.CreateConnectionRequestBody]](../../models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | |
9+
| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 |

β€Žprevious-versions/sync-for-expenses-version-1/docs/models/operations/createconnectionrequestbody.mdβ€Ž

100755100644
File mode changed.

β€Žprevious-versions/sync-for-expenses-version-1/docs/models/operations/createconnectionresponse.mdβ€Ž

100755100644
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
88
| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK |
99
| `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. |
1110
| `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 |

β€Žprevious-versions/sync-for-expenses-version-1/docs/models/operations/createexpensedatasetrequest.mdβ€Ž

100755100644
File mode changed.

0 commit comments

Comments
Β (0)