Skip to content

Commit 00fcceb

Browse files
Merge pull request #18 from codatio/speakeasy-sdk-regen-1677684850
chore: speakeasy sdk regeneration - Generate Banking SDK
2 parents 8aacbc7 + 80c7a15 commit 00fcceb

27 files changed

+2263
-1
lines changed

banking/README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# codat-banking
2+
3+
<!-- Start SDK Installation -->
4+
## SDK Installation
5+
6+
```bash
7+
pip install codat-banking
8+
```
9+
<!-- End SDK Installation -->
10+
11+
## SDK Example Usage
12+
<!-- Start SDK Example Usage -->
13+
```python
14+
import codat
15+
from codat.models import operations, shared
16+
17+
s = codat.Codat()
18+
s.config_security(
19+
security=shared.Security(
20+
api_key="YOUR_API_KEY_HERE",
21+
)
22+
)
23+
24+
req = operations.ListBankingAccountBalancesRequest(
25+
security=operations.ListBankingAccountBalancesSecurity(
26+
api_key="YOUR_API_KEY_HERE",
27+
),
28+
path_params=operations.ListBankingAccountBalancesPathParams(
29+
company_id="unde",
30+
connection_id="deserunt",
31+
),
32+
query_params=operations.ListBankingAccountBalancesQueryParams(
33+
order_by="porro",
34+
page=8442.66,
35+
page_size=6027.63,
36+
query="vero",
37+
),
38+
)
39+
40+
res = s.account_balances.list_banking_account_balances(req)
41+
42+
if res.links is not None:
43+
# handle response
44+
```
45+
<!-- End SDK Example Usage -->
46+
47+
<!-- Start SDK Available Operations -->
48+
## SDK Available Operations
49+
50+
51+
### account_balances
52+
53+
* `list_banking_account_balances` - List bank balances
54+
55+
### accounts
56+
57+
* `get_bank_account` - Get bank account
58+
* `list_banking_accounts` - List bank accounts
59+
60+
### transaction_categories
61+
62+
* `get_bank_transaction_category` - Get transaction category
63+
* `list_bank_transaction_categories` - List all transaction categories
64+
65+
### transactions
66+
67+
* `get_banking_transaction` - Get bank transaction
68+
* `list_all_banking_transactions` - List banking transactions
69+
* `list_banking_transactions` - List bank account transactions
70+
<!-- End SDK Available Operations -->
71+
72+
### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)

banking/RELEASES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
## 2023-03-01 15:34:09
4+
### Changes
5+
Based on:
6+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Banking.yaml
7+
- Speakeasy CLI 1.7.0 https://github.com/speakeasy-api/speakeasy
8+
### Releases
9+
- [PyPI v0.1.0] https://pypi.org/project/codat-banking/0.1.0 - banking
10+
11+
## 2023-03-02 00:02:17
12+
### Changes
13+
Based on:
14+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Banking.yaml
15+
- Speakeasy CLI 1.7.1 https://github.com/speakeasy-api/speakeasy
16+
### Releases
17+
- [PyPI v0.1.1] https://pypi.org/project/codat-banking/0.1.1 - banking

banking/USAGE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- Start SDK Example Usage -->
2+
```python
3+
import codat
4+
from codat.models import operations, shared
5+
6+
s = codat.Codat()
7+
s.config_security(
8+
security=shared.Security(
9+
api_key="YOUR_API_KEY_HERE",
10+
)
11+
)
12+
13+
req = operations.ListBankingAccountBalancesRequest(
14+
security=operations.ListBankingAccountBalancesSecurity(
15+
api_key="YOUR_API_KEY_HERE",
16+
),
17+
path_params=operations.ListBankingAccountBalancesPathParams(
18+
company_id="unde",
19+
connection_id="deserunt",
20+
),
21+
query_params=operations.ListBankingAccountBalancesQueryParams(
22+
order_by="porro",
23+
page=8442.66,
24+
page_size=6027.63,
25+
query="vero",
26+
),
27+
)
28+
29+
res = s.account_balances.list_banking_account_balances(req)
30+
31+
if res.links is not None:
32+
# handle response
33+
```
34+
<!-- End SDK Example Usage -->

banking/files.gen

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
src/codat/account_balances.py
2+
src/codat/accounts.py
3+
src/codat/transaction_categories.py
4+
src/codat/transactions.py
5+
src/codat/sdk.py
6+
setup.py
7+
src/codat/__init__.py
8+
src/codat/models/__init__.py
9+
src/codat/utils/__init__.py
10+
src/codat/utils/retries.py
11+
src/codat/utils/utils.py
12+
src/codat/models/operations/list_banking_account_balances.py
13+
src/codat/models/operations/get_bank_account.py
14+
src/codat/models/operations/list_banking_accounts.py
15+
src/codat/models/operations/get_bank_transaction_category.py
16+
src/codat/models/operations/list_bank_transaction_categories.py
17+
src/codat/models/operations/get_banking_transaction.py
18+
src/codat/models/operations/list_all_banking_transactions.py
19+
src/codat/models/operations/list_banking_transactions.py
20+
src/codat/models/operations/__init__.py
21+
src/codat/models/shared/security.py
22+
src/codat/models/shared/__init__.py
23+
USAGE.md

banking/gen.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
configVersion: 1.0.0
2+
management:
3+
docChecksum: f7f15367a30f949e2d1941199e54f2b1
4+
docVersion: 2.1.0
5+
speakeasyVersion: 1.7.1
26
generation:
7+
telemetryEnabled: false
38
sdkClassName: codat
49
sdkFlattening: true
510
python:
6-
version: 0.0.1
11+
version: 0.1.1
12+
author: Speakeasy
13+
description: Python Client SDK Generated by Speakeasy
714
packageName: codat-banking

banking/setup.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import setuptools
2+
3+
try:
4+
with open("README.md", "r") as fh:
5+
long_description = fh.read()
6+
except FileNotFoundError:
7+
long_description = ""
8+
9+
setuptools.setup(
10+
name="codat-banking",
11+
version="0.1.1",
12+
author="Speakeasy",
13+
description="Python Client SDK Generated by Speakeasy",
14+
long_description=long_description,
15+
long_description_content_type="text/markdown",
16+
packages=setuptools.find_packages(where="src"),
17+
install_requires=[
18+
"certifi==2022.12.07",
19+
"charset-normalizer==2.1.1",
20+
"dataclasses-json-speakeasy==0.5.8",
21+
"idna==3.3",
22+
"marshmallow==3.17.1",
23+
"marshmallow-enum==1.5.1",
24+
"mypy-extensions==0.4.3",
25+
"packaging==21.3",
26+
"pyparsing==3.0.9",
27+
"python-dateutil==2.8.2",
28+
"requests==2.28.1",
29+
"six==1.16.0",
30+
"typing-inspect==0.8.0",
31+
"typing_extensions==4.3.0",
32+
"urllib3==1.26.12",
33+
],
34+
package_dir={'': 'src'},
35+
python_requires='>=3.9'
36+
)

banking/src/codat/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .sdk import *
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import requests
2+
from . import utils
3+
from codat.models import operations
4+
from typing import Optional
5+
6+
class AccountBalances:
7+
_client: requests.Session
8+
_security_client: requests.Session
9+
_server_url: str
10+
_language: str
11+
_sdk_version: str
12+
_gen_version: str
13+
14+
def __init__(self, client: requests.Session, security_client: requests.Session, server_url: str, language: str, sdk_version: str, gen_version: str) -> None:
15+
self._client = client
16+
self._security_client = security_client
17+
self._server_url = server_url
18+
self._language = language
19+
self._sdk_version = sdk_version
20+
self._gen_version = gen_version
21+
22+
23+
def list_banking_account_balances(self, request: operations.ListBankingAccountBalancesRequest) -> operations.ListBankingAccountBalancesResponse:
24+
r"""List bank balances
25+
Gets a list of balances for a bank account including end-of-day batch balance or running balances per transaction.
26+
"""
27+
28+
base_url = self._server_url
29+
30+
url = utils.generate_url(base_url, "/companies/{companyId}/connections/{connectionId}/data/banking-accountBalances", request.path_params)
31+
32+
query_params = utils.get_query_params(request.query_params)
33+
34+
client = utils.configure_security_client(self._client, request.security)
35+
36+
r = client.request("GET", url, params=query_params)
37+
content_type = r.headers.get("Content-Type")
38+
39+
res = operations.ListBankingAccountBalancesResponse(status_code=r.status_code, content_type=content_type)
40+
41+
if r.status_code == 200:
42+
if utils.match_content_type(content_type, "application/json"):
43+
out = utils.unmarshal_json(r.text, Optional[operations.ListBankingAccountBalancesLinks])
44+
res.links = out
45+
46+
return res
47+
48+

banking/src/codat/accounts.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import requests
2+
from . import utils
3+
from codat.models import operations
4+
from typing import Optional
5+
6+
class Accounts:
7+
_client: requests.Session
8+
_security_client: requests.Session
9+
_server_url: str
10+
_language: str
11+
_sdk_version: str
12+
_gen_version: str
13+
14+
def __init__(self, client: requests.Session, security_client: requests.Session, server_url: str, language: str, sdk_version: str, gen_version: str) -> None:
15+
self._client = client
16+
self._security_client = security_client
17+
self._server_url = server_url
18+
self._language = language
19+
self._sdk_version = sdk_version
20+
self._gen_version = gen_version
21+
22+
23+
def get_bank_account(self, request: operations.GetBankAccountRequest) -> operations.GetBankAccountResponse:
24+
r"""Get bank account
25+
Gets a specified bank account for a given company
26+
"""
27+
28+
base_url = self._server_url
29+
30+
url = utils.generate_url(base_url, "/companies/{companyId}/connections/{connectionId}/data/banking-accounts/{accountId}", request.path_params)
31+
32+
33+
client = utils.configure_security_client(self._client, request.security)
34+
35+
r = client.request("GET", url)
36+
content_type = r.headers.get("Content-Type")
37+
38+
res = operations.GetBankAccountResponse(status_code=r.status_code, content_type=content_type)
39+
40+
if r.status_code == 200:
41+
if utils.match_content_type(content_type, "application/json"):
42+
out = utils.unmarshal_json(r.text, Optional[operations.GetBankAccountSourceModifiedDate])
43+
res.source_modified_date = out
44+
45+
return res
46+
47+
48+
def list_banking_accounts(self, request: operations.ListBankingAccountsRequest) -> operations.ListBankingAccountsResponse:
49+
r"""List bank accounts
50+
Gets a list of all bank accounts of the SMB, with rich data like balances, account numbers and institutions holdingthe accounts.
51+
"""
52+
53+
base_url = self._server_url
54+
55+
url = utils.generate_url(base_url, "/companies/{companyId}/connections/{connectionId}/data/banking-accounts", request.path_params)
56+
57+
query_params = utils.get_query_params(request.query_params)
58+
59+
client = utils.configure_security_client(self._client, request.security)
60+
61+
r = client.request("GET", url, params=query_params)
62+
content_type = r.headers.get("Content-Type")
63+
64+
res = operations.ListBankingAccountsResponse(status_code=r.status_code, content_type=content_type)
65+
66+
if r.status_code == 200:
67+
if utils.match_content_type(content_type, "application/json"):
68+
out = utils.unmarshal_json(r.text, Optional[operations.ListBankingAccountsLinks])
69+
res.links = out
70+
71+
return res
72+
73+

banking/src/codat/models/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)