Skip to content

Commit 546efd1

Browse files
authored
Merge pull request #502 from codatio/speakeasy-sdk-regen-1700565540
chore: 🐝 Update SDK - Generate Bank Feeds library
2 parents df5c157 + b5e00c2 commit 546efd1

File tree

169 files changed

+1070
-564
lines changed

Some content is hidden

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

169 files changed

+1070
-564
lines changed

β€Žbank-feeds/.gitattributesβ€Ž

100755100644
File mode changed.

β€Žbank-feeds/README.mdβ€Ž

Lines changed: 239 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,26 @@ pip install codat-bankfeeds
1414

1515
## Example Usage
1616
<!-- Start SDK Example Usage -->
17+
### Example
18+
1719
```python
1820
import codatbankfeeds
19-
from codatbankfeeds.models import operations, shared
21+
from codatbankfeeds.models import shared
2022

2123
s = codatbankfeeds.CodatBankFeeds(
2224
security=shared.Security(
2325
auth_header="Basic BASE_64_ENCODED(API_KEY)",
2426
),
2527
)
2628

27-
req = operations.CreateBankAccountMappingRequest(
28-
request_body=operations.CreateBankAccountMappingBankFeedAccountMapping(
29-
feed_start_date='2022-10-23T00:00:00.000Z',
30-
),
31-
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
32-
connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171',
29+
req = shared.CompanyRequestBody(
30+
description='Requested early access to the new financing scheme.',
31+
name='Bank of Dave',
3332
)
3433

35-
res = s.account_mapping.create(req)
34+
res = s.companies.create(req)
3635

37-
if res.bank_feed_account_mapping_response is not None:
36+
if res.company is not None:
3837
# handle response
3938
pass
4039
```
@@ -44,11 +43,6 @@ if res.bank_feed_account_mapping_response is not None:
4443
## Available Resources and Operations
4544

4645

47-
### [account_mapping](docs/sdks/accountmapping/README.md)
48-
49-
* [create](docs/sdks/accountmapping/README.md#create) - Create bank feed account mapping
50-
* [get](docs/sdks/accountmapping/README.md#get) - List bank feed account mappings
51-
5246
### [companies](docs/sdks/companies/README.md)
5347

5448
* [create](docs/sdks/companies/README.md#create) - Create company
@@ -65,6 +59,11 @@ if res.bank_feed_account_mapping_response is not None:
6559
* [list](docs/sdks/connections/README.md#list) - List connections
6660
* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection
6761

62+
### [account_mapping](docs/sdks/accountmapping/README.md)
63+
64+
* [create](docs/sdks/accountmapping/README.md#create) - Create bank feed account mapping
65+
* [get](docs/sdks/accountmapping/README.md#get) - List bank feed account mappings
66+
6867
### [source_accounts](docs/sdks/sourceaccounts/README.md)
6968

7069
* [create](docs/sdks/sourceaccounts/README.md#create) - Create source account
@@ -89,6 +88,232 @@ if res.bank_feed_account_mapping_response is not None:
8988

9089
<!-- End Dev Containers -->
9190

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.',
112+
name='Bank of Dave',
113+
)
114+
115+
res = s.companies.create(req,
116+
RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False))
117+
118+
if res.company is not None:
119+
# handle response
120+
pass
121+
```
122+
123+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
124+
```python
125+
import codatbankfeeds
126+
from codatbankfeeds.models import shared
127+
from codatbankfeeds.utils import BackoffStrategy, RetryConfig
128+
129+
s = codatbankfeeds.CodatBankFeeds(
130+
retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)
131+
security=shared.Security(
132+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
133+
),
134+
)
135+
136+
req = shared.CompanyRequestBody(
137+
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 is not None:
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.
155+
156+
| Error Object | Status Code | Content Type |
157+
| --------------------------- | --------------------------- | --------------------------- |
158+
| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json |
159+
| errors.SDKError | 400-600 | */* |
160+
161+
### Example
162+
163+
```python
164+
import codatbankfeeds
165+
from codatbankfeeds.models import shared
166+
167+
s = codatbankfeeds.CodatBankFeeds(
168+
security=shared.Security(
169+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
170+
),
171+
)
172+
173+
req = shared.CompanyRequestBody(
174+
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 is not None:
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 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 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 is not None:
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:
269+
```python
270+
import codatbankfeeds
271+
import requests
272+
273+
http_client = requests.Session()
274+
http_client.headers.update({'x-custom-header': 'someValue'})
275+
s = codatbankfeeds.CodatBankFeeds(client: http_client)
276+
```
277+
<!-- End Custom HTTP Client -->
278+
279+
280+
281+
<!-- Start Authentication -->
282+
283+
## Authentication
284+
285+
### Per-Client Security Schemes
286+
287+
This SDK supports the following security scheme globally:
288+
289+
| Name | Type | Scheme |
290+
| ------------- | ------------- | ------------- |
291+
| `auth_header` | apiKey | API key |
292+
293+
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
294+
```python
295+
import codatbankfeeds
296+
from codatbankfeeds.models import shared
297+
298+
s = codatbankfeeds.CodatBankFeeds(
299+
security=shared.Security(
300+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
301+
),
302+
)
303+
304+
req = shared.CompanyRequestBody(
305+
description='Requested early access to the new financing scheme.',
306+
name='Bank of Dave',
307+
)
308+
309+
res = s.companies.create(req)
310+
311+
if res.company is not None:
312+
# handle response
313+
pass
314+
```
315+
<!-- End Authentication -->
316+
92317
<!-- Placeholder for Future Speakeasy SDK Sections -->
93318

94319

β€Žbank-feeds/RELEASES.mdβ€Ž

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,4 +728,14 @@ Based on:
728728
### Generated
729729
- [python v4.0.0] bank-feeds
730730
### Releases
731-
- [PyPI v4.0.0] https://pypi.org/project/codat-bankfeeds/4.0.0 - bank-feeds
731+
- [PyPI v4.0.0] https://pypi.org/project/codat-bankfeeds/4.0.0 - bank-feeds
732+
733+
## 2023-11-21 11:18:56
734+
### Changes
735+
Based on:
736+
- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Bank-Feeds.yaml
737+
- Speakeasy CLI 1.121.3 (2.195.2) https://github.com/speakeasy-api/speakeasy
738+
### Generated
739+
- [python v5.0.0] bank-feeds
740+
### Releases
741+
- [PyPI v5.0.0] https://pypi.org/project/codat-bankfeeds/5.0.0 - bank-feeds

β€Žbank-feeds/USAGE.mdβ€Ž

100755100644
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
<!-- Start SDK Example Usage -->
2-
3-
42
```python
53
import codatbankfeeds
6-
from codatbankfeeds.models import operations, shared
4+
from codatbankfeeds.models import shared
75

86
s = codatbankfeeds.CodatBankFeeds(
97
security=shared.Security(
108
auth_header="Basic BASE_64_ENCODED(API_KEY)",
119
),
1210
)
1311

14-
req = operations.CreateBankAccountMappingRequest(
15-
request_body=operations.CreateBankAccountMappingBankFeedAccountMapping(
16-
feed_start_date='2022-10-23T00:00:00.000Z',
17-
),
18-
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
19-
connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171',
12+
req = shared.CompanyRequestBody(
13+
description='Requested early access to the new financing scheme.',
14+
name='Bank of Dave',
2015
)
2116

22-
res = s.account_mapping.create(req)
17+
res = s.companies.create(req)
2318

24-
if res.bank_feed_account_mapping_response is not None:
19+
if res.company is not None:
2520
# handle response
2621
pass
2722
```

β€Žbank-feeds/docs/models/shared/errormessage.mdβ€Ž renamed to β€Žbank-feeds/docs/models/errors/errormessage.mdβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ErrorMessage
22

3+
Your `query` parameter was not correctly formed
4+
35

46
## Fields
57

β€Žbank-feeds/docs/models/operations/createbankaccountmappingrequest.mdβ€Ž

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

44
## Fields
55

6-
| Field | Type | Required | Description | Example |
7-
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
8-
| `request_body` | [Optional[CreateBankAccountMappingBankFeedAccountMapping]](../../models/operations/createbankaccountmappingbankfeedaccountmapping.md) | :heavy_minus_sign: | N/A | |
9-
| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 |
10-
| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 |
6+
| Field | Type | Required | Description | Example |
7+
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
8+
| `zero` | [Optional[shared.Zero]](../../models/shared/zero.md) | :heavy_minus_sign: | N/A | |
9+
| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 |
10+
| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 |

β€Žbank-feeds/docs/models/operations/createbankaccountmappingresponse.mdβ€Ž

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

β€Žbank-feeds/docs/models/operations/createbanktransactionsrequest.mdβ€Ž

100755100644
File mode changed.

0 commit comments

Comments
Β (0)