Skip to content

Commit 73b8540

Browse files
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.477.0 (#635)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent 4ca2dca commit 73b8540

22 files changed

+271
-198
lines changed

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.469.10
1+
speakeasyVersion: 1.477.0
22
sources:
33
accounting-source:
44
sourceNamespace: accounting-source
@@ -16,11 +16,11 @@ sources:
1616
- main
1717
bank-feeds-source:
1818
sourceNamespace: bank-feeds-source
19-
sourceRevisionDigest: sha256:05a608be985dc9deb12eeb3a747ef0ae4cd1690b42852f97e61c7a43881748a7
20-
sourceBlobDigest: sha256:cffec1fdf5b4aa33774403da44fc8cfb24f5f59d507b1e83d73b1b28f8efa50e
19+
sourceRevisionDigest: sha256:406fc65cd0789662c52a4543f8ebde1591a55b4dccd1ce5ca1f79b753fe3b6b8
20+
sourceBlobDigest: sha256:32ef2170d2a23ba969ba364ad8138e99de4de8e5ec43e66a9a2020b489f2ca18
2121
tags:
2222
- latest
23-
- speakeasy-sdk-regen-1737391437
23+
- speakeasy-sdk-regen-1738082181
2424
- 3.0.0
2525
banking-source:
2626
sourceNamespace: banking-source
@@ -111,10 +111,10 @@ targets:
111111
bank-feeds-library:
112112
source: bank-feeds-source
113113
sourceNamespace: bank-feeds-source
114-
sourceRevisionDigest: sha256:05a608be985dc9deb12eeb3a747ef0ae4cd1690b42852f97e61c7a43881748a7
115-
sourceBlobDigest: sha256:cffec1fdf5b4aa33774403da44fc8cfb24f5f59d507b1e83d73b1b28f8efa50e
114+
sourceRevisionDigest: sha256:406fc65cd0789662c52a4543f8ebde1591a55b4dccd1ce5ca1f79b753fe3b6b8
115+
sourceBlobDigest: sha256:32ef2170d2a23ba969ba364ad8138e99de4de8e5ec43e66a9a2020b489f2ca18
116116
codeSamplesNamespace: bank-feeds-source-python-code-samples
117-
codeSamplesRevisionDigest: sha256:769f019b1d6e0ca253780d1cec262d51ccd8297fa6a53d9bb1e28fd6b2ae11c1
117+
codeSamplesRevisionDigest: sha256:a33dae9c9ff3c3d3205b35071ec9959903db9ca435c218fa7f3bad95fd4abce3
118118
banking-library:
119119
source: banking-source
120120
sourceNamespace: banking-source

bank-feeds/.speakeasy/gen.lock

Lines changed: 22 additions & 24 deletions
Large diffs are not rendered by default.

bank-feeds/.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generation:
1212
oAuth2PasswordEnabled: false
1313
telemetryEnabled: true
1414
python:
15-
version: 10.2.0
15+
version: 11.0.0
1616
additionalDependencies:
1717
dev: {}
1818
main: {}

bank-feeds/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ A bank feed is a connection between a source bank account in your application an
4444
* [Server Selection](#server-selection)
4545
* [Custom HTTP Client](#custom-http-client)
4646
* [Authentication](#authentication)
47+
* [Resource Management](#resource-management)
4748
* [Debugging](#debugging)
4849
* [Support](#support)
4950

@@ -52,6 +53,11 @@ A bank feed is a connection between a source bank account in your application an
5253
<!-- Start SDK Installation [installation] -->
5354
## SDK Installation
5455

56+
> [!NOTE]
57+
> **Python version upgrade policy**
58+
>
59+
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
60+
5561
The SDK can be installed with either *pip* or *poetry* package managers.
5662

5763
### PIP
@@ -541,6 +547,36 @@ with CodatBankFeeds(
541547
```
542548
<!-- End Authentication [security] -->
543549

550+
<!-- Start Resource Management [resource-management] -->
551+
## Resource Management
552+
553+
The `CodatBankFeeds` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
554+
555+
[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
556+
557+
```python
558+
from codat_bankfeeds import CodatBankFeeds
559+
from codat_bankfeeds.models import shared
560+
def main():
561+
with CodatBankFeeds(
562+
security=shared.Security(
563+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
564+
),
565+
) as codat_bank_feeds:
566+
# Rest of application here...
567+
568+
569+
# Or when using async:
570+
async def amain():
571+
async with CodatBankFeeds(
572+
security=shared.Security(
573+
auth_header="Basic BASE_64_ENCODED(API_KEY)",
574+
),
575+
) as codat_bank_feeds:
576+
# Rest of application here...
577+
```
578+
<!-- End Resource Management [resource-management] -->
579+
544580
<!-- Start Debugging [debug] -->
545581
## Debugging
546582

bank-feeds/RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,4 +868,14 @@ Based on:
868868
### Generated
869869
- [python v10.2.0] bank-feeds
870870
### Releases
871-
- [PyPI v10.2.0] https://pypi.org/project/codat-bankfeeds/10.2.0 - bank-feeds
871+
- [PyPI v10.2.0] https://pypi.org/project/codat-bankfeeds/10.2.0 - bank-feeds
872+
873+
## 2025-01-28 16:36:02
874+
### Changes
875+
Based on:
876+
- OpenAPI Doc
877+
- Speakeasy CLI 1.477.0 (2.497.0) https://github.com/speakeasy-api/speakeasy
878+
### Generated
879+
- [python v11.0.0] bank-feeds
880+
### Releases
881+
- [PyPI v11.0.0] https://pypi.org/project/codat-bankfeeds/11.0.0 - bank-feeds

bank-feeds/docs/models/operations/createbatchsourceaccountrequestbody.md

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

44
## Supported Types
55

6-
### `List[shared.SourceAccountV2]`
6+
### `List[shared.SourceAccountV2Prototype]`
77

88
```python
9-
value: List[shared.SourceAccountV2] = /* values here */
9+
value: List[shared.SourceAccountV2Prototype] = /* values here */
1010
```
1111

12-
### `List[shared.SourceAccount]`
12+
### `List[shared.SourceAccountPrototype]`
1313

1414
```python
15-
value: List[shared.SourceAccount] = /* values here */
15+
value: List[shared.SourceAccountPrototype] = /* values here */
1616
```
1717

bank-feeds/docs/models/operations/createbatchsourceaccountresponse.md

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

44
## Supported Types
55

6-
### `operations.CreateBatchSourceAccountResponseBody`
6+
### `List[operations.ResponseBody]`
77

88
```python
9-
value: operations.CreateBatchSourceAccountResponseBody = /* values here */
9+
value: List[operations.ResponseBody] = /* values here */
1010
```
1111

12-
### `operations.CreateBatchSourceAccountSourceAccountsResponseBody`
12+
### `List[operations.CreateBatchSourceAccountResponseBody]`
1313

1414
```python
15-
value: operations.CreateBatchSourceAccountSourceAccountsResponseBody = /* values here */
15+
value: List[operations.CreateBatchSourceAccountResponseBody] = /* values here */
1616
```
1717

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# CreateBatchSourceAccountResponseBody
22

3-
Success
4-
53

64
## Supported Types
75

8-
### `List[operations.One]`
6+
### `shared.SourceAccountV2BatchCreateResponse`
7+
8+
```python
9+
value: shared.SourceAccountV2BatchCreateResponse = /* values here */
10+
```
11+
12+
### `shared.SourceAccountBatchCreateResponse`
13+
14+
```python
15+
value: shared.SourceAccountBatchCreateResponse = /* values here */
16+
```
17+
18+
### `shared.SourceAccountBatchErrorResponse`
919

1020
```python
11-
value: List[operations.One] = /* values here */
21+
value: shared.SourceAccountBatchErrorResponse = /* values here */
1222
```
1323

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ResponseBody
2+
3+
4+
## Supported Types
5+
6+
### `shared.SourceAccountV2BatchCreateResponse`
7+
8+
```python
9+
value: shared.SourceAccountV2BatchCreateResponse = /* values here */
10+
```
11+
12+
### `shared.SourceAccountBatchCreateResponse`
13+
14+
```python
15+
value: shared.SourceAccountBatchCreateResponse = /* values here */
16+
```
17+

bank-feeds/docs/models/shared/sourceaccountprototype.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

bank-feeds/docs/models/shared/sourceaccountv2prototype.md

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

bank-feeds/docs/sdks/sourceaccounts/README.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The _Create Source Account_ endpoint allows you to create a representation of a
2727
```python
2828
from codat_bankfeeds import CodatBankFeeds
2929
from codat_bankfeeds.models import shared
30+
from decimal import Decimal
3031

3132
with CodatBankFeeds(
3233
security=shared.Security(
@@ -38,10 +39,15 @@ with CodatBankFeeds(
3839
"company_id": "8a210b68-6988-11ed-a1eb-0242ac120002",
3940
"connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
4041
"request_body": {
42+
"account_name": "<value>",
43+
"account_number": "<value>",
44+
"account_type": shared.AccountType.CREDIT_CARD,
45+
"balance": Decimal("4174.58"),
46+
"currency": "GBP",
47+
"id": "<id>",
4148
"account_info": {
4249
"account_open_date": "2022-10-23",
4350
},
44-
"currency": "USD",
4551
"modified_date": "2022-10-23T00:00:00Z",
4652
},
4753
})
@@ -84,7 +90,6 @@ The _Batch create source accounts_ endpoint allows you to create multiple repres
8490
```python
8591
from codat_bankfeeds import CodatBankFeeds
8692
from codat_bankfeeds.models import shared
87-
from decimal import Decimal
8893

8994
with CodatBankFeeds(
9095
security=shared.Security(
@@ -97,26 +102,14 @@ with CodatBankFeeds(
97102
"connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
98103
"request_body": [
99104
{
100-
"id": "acc-002",
101-
"account_name": "account-081",
102-
"account_number": "12345670",
103-
"account_type": "Credit",
104-
"balance": Decimal("99.99"),
105-
"currency": "GBP",
106-
"modified_date": "2023-01-09T14:14:14.1057478Z",
107-
"sort_code": "123456",
108-
"status": shared.Status.PENDING,
105+
"id": "<id>",
106+
"currency": "EUR",
107+
"modified_date": "2022-10-23T00:00:00Z",
109108
},
110109
{
111-
"id": "acc-003",
112-
"account_name": "account-095",
113-
"account_number": "12345671",
114-
"account_type": "Credit",
115-
"balance": Decimal("0"),
110+
"id": "<id>",
116111
"currency": "USD",
117-
"modified_date": "2023-01-09T14:14:14.1057478Z",
118-
"sort_code": "123456",
119-
"status": shared.Status.PENDING,
112+
"modified_date": "2022-10-23T00:00:00Z",
120113
},
121114
],
122115
})
@@ -141,11 +134,11 @@ with CodatBankFeeds(
141134

142135
### Errors
143136

144-
| Error Type | Status Code | Content Type |
145-
| --------------------------------- | --------------------------------- | --------------------------------- |
146-
| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json |
147-
| errors.ErrorMessage | 500, 503 | application/json |
148-
| errors.SDKError | 4XX, 5XX | \*/\* |
137+
| Error Type | Status Code | Content Type |
138+
| ---------------------------- | ---------------------------- | ---------------------------- |
139+
| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json |
140+
| errors.ErrorMessage | 500, 503 | application/json |
141+
| errors.SDKError | 4XX, 5XX | \*/\* |
149142

150143
## delete
151144

bank-feeds/poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bank-feeds/pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[project]
22
name = "codat-bankfeeds"
3-
version = "10.2.0"
3+
version = "11.0.0"
44
description = "Set up bank feeds from accounts in your application to supported accounting software."
55
authors = [{ name = "Speakeasy" },]
66
readme = "README-PYPI.md"
77
requires-python = ">=3.9"
88
dependencies = [
9-
"eval-type-backport (>=0.2.0,<0.3.0)",
10-
"httpx (>=0.28.1,<0.29.0)",
11-
"jsonpath-python (>=1.0.6,<2.0.0)",
12-
"pydantic (>=2.10.3,<2.11.0)",
13-
"python-dateutil (>=2.8.2,<3.0.0)",
14-
"typing-inspect (>=0.9.0,<0.10.0)",
9+
"eval-type-backport >=0.2.0",
10+
"httpx >=0.28.1",
11+
"jsonpath-python >=1.0.6",
12+
"pydantic >=2.10.3",
13+
"python-dateutil >=2.8.2",
14+
"typing-inspect >=0.9.0",
1515
]
1616

1717
[tool.poetry]

bank-feeds/src/codat_bankfeeds/_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import importlib.metadata
44

55
__title__: str = "codat-bankfeeds"
6-
__version__: str = "10.2.0"
6+
__version__: str = "11.0.0"
77
__openapi_doc_version__: str = "3.0.0"
8-
__gen_version__: str = "2.493.31"
9-
__user_agent__: str = "speakeasy-sdk/python 10.2.0 2.493.31 3.0.0 codat-bankfeeds"
8+
__gen_version__: str = "2.497.0"
9+
__user_agent__: str = "speakeasy-sdk/python 11.0.0 2.497.0 3.0.0 codat-bankfeeds"
1010

1111
try:
1212
if __package__ is not None:

bank-feeds/src/codat_bankfeeds/httpclient.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
22

33
# pyright: reportReturnType = false
4+
import asyncio
5+
from concurrent.futures import ThreadPoolExecutor
46
from typing_extensions import Protocol, runtime_checkable
57
import httpx
68
from typing import Any, Optional, Union
@@ -82,3 +84,51 @@ def build_request(
8284

8385
async def aclose(self) -> None:
8486
pass
87+
88+
89+
class ClientOwner(Protocol):
90+
client: Union[HttpClient, None]
91+
async_client: Union[AsyncHttpClient, None]
92+
93+
94+
def close_clients(
95+
owner: ClientOwner,
96+
sync_client: Union[HttpClient, None],
97+
async_client: Union[AsyncHttpClient, None],
98+
) -> None:
99+
"""
100+
A finalizer function that is meant to be used with weakref.finalize to close
101+
httpx clients used by an SDK so that underlying resources can be garbage
102+
collected.
103+
"""
104+
105+
# Unset the client/async_client properties so there are no more references
106+
# to them from the owning SDK instance and they can be reaped.
107+
owner.client = None
108+
owner.async_client = None
109+
110+
if sync_client is not None:
111+
try:
112+
sync_client.close()
113+
except Exception:
114+
pass
115+
116+
if async_client is not None:
117+
is_async = False
118+
try:
119+
asyncio.get_running_loop()
120+
is_async = True
121+
except RuntimeError:
122+
pass
123+
124+
try:
125+
# If this function is called in an async loop then start another
126+
# loop in a separate thread to close the async http client.
127+
if is_async:
128+
with ThreadPoolExecutor(max_workers=1) as executor:
129+
future = executor.submit(asyncio.run, async_client.aclose())
130+
future.result()
131+
else:
132+
asyncio.run(async_client.aclose())
133+
except Exception:
134+
pass

0 commit comments

Comments
 (0)