Skip to content

Commit

Permalink
Merge pull request #543 from codatio/speakeasy-sdk-regen-1702562839
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate Bank Feeds library
  • Loading branch information
dcoplowe authored Dec 14, 2023
2 parents 39d818a + 0d5442b commit 4226c4f
Show file tree
Hide file tree
Showing 29 changed files with 111 additions and 105 deletions.
55 changes: 24 additions & 31 deletions bank-feeds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
Bank Feeds API enables your SMB users to set up bank feeds from accounts in your application to supported accounting platforms.
<!-- End Codat Library Description -->

<!-- Start SDK Installation -->
<!-- Start SDK Installation [installation] -->
## SDK Installation

```bash
pip install codat-bankfeeds
```
<!-- End SDK Installation -->
<!-- End SDK Installation [installation] -->

## Example Usage
<!-- Start SDK Example Usage -->
<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```python
Expand All @@ -37,12 +39,11 @@ if res.company is not None:
# handle response
pass
```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->

<!-- Start SDK Available Operations -->
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations


### [companies](docs/sdks/companies/README.md)

* [create](docs/sdks/companies/README.md#create) - Create company
Expand Down Expand Up @@ -78,19 +79,13 @@ if res.company is not None:
* [create](docs/sdks/transactions/README.md#create) - Create bank transactions
* [get_create_operation](docs/sdks/transactions/README.md#get_create_operation) - Get create operation
* [list_create_operations](docs/sdks/transactions/README.md#list_create_operations) - List create operations
<!-- End SDK Available Operations -->



<!-- Start Dev Containers -->
<!-- End Available Resources and Operations [operations] -->



<!-- End Dev Containers -->



<!-- Start Retries -->
<!-- Start Retries [retries] -->
## Retries

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.
Expand Down Expand Up @@ -144,11 +139,11 @@ if res.company is not None:
# handle response
pass
```
<!-- End Retries -->
<!-- End Retries [retries] -->



<!-- Start Error Handling -->
<!-- Start Error Handling [errors] -->
## Error Handling

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.
Expand Down Expand Up @@ -178,23 +173,22 @@ req = shared.CompanyRequestBody(
res = None
try:
res = s.companies.create(req)
except (errors.ErrorMessage) as e:
print(e) # handle exception

except (errors.SDKError) as e:
print(e) # handle exception

except errors.ErrorMessage as e:
print(e) # handle exception
raise(e)
except errors.SDKError as e:
print(e) # handle exception
raise(e)

if res.company is not None:
# handle response
pass
```
<!-- End Error Handling [errors] -->

<!-- End Error Handling -->



<!-- Start Server Selection -->
<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index
Expand Down Expand Up @@ -256,11 +250,11 @@ if res.company is not None:
# handle response
pass
```
<!-- End Server Selection -->
<!-- End Server Selection [server] -->



<!-- Start Custom HTTP Client -->
<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

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.
Expand All @@ -274,12 +268,11 @@ http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = codatbankfeeds.CodatBankFeeds(client: http_client)
```
<!-- End Custom HTTP Client -->

<!-- End Custom HTTP Client [http-client] -->


<!-- Start Authentication -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes
Expand Down Expand Up @@ -312,7 +305,7 @@ if res.company is not None:
# handle response
pass
```
<!-- End Authentication -->
<!-- End Authentication [security] -->

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

Expand Down
12 changes: 11 additions & 1 deletion bank-feeds/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,4 +738,14 @@ Based on:
### Generated
- [python v5.0.0] bank-feeds
### Releases
- [PyPI v5.0.0] https://pypi.org/project/codat-bankfeeds/5.0.0 - bank-feeds
- [PyPI v5.0.0] https://pypi.org/project/codat-bankfeeds/5.0.0 - bank-feeds

## 2023-12-14 14:07:14
### Changes
Based on:
- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Bank-Feeds.yaml
- Speakeasy CLI 1.126.3 (2.214.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v5.1.0] bank-feeds
### Releases
- [PyPI v5.1.0] https://pypi.org/project/codat-bankfeeds/5.1.0 - bank-feeds
4 changes: 2 additions & 2 deletions bank-feeds/USAGE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Start SDK Example Usage -->
<!-- Start SDK Example Usage [usage] -->
```python
import codatbankfeeds
from codatbankfeeds.models import shared
Expand All @@ -20,4 +20,4 @@ if res.company is not None:
# handle response
pass
```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->
2 changes: 1 addition & 1 deletion bank-feeds/docs/models/errors/errormessage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ErrorMessage

Your `query` parameter was not correctly formed
The request made is not valid.


## Fields
Expand Down
2 changes: 1 addition & 1 deletion bank-feeds/docs/models/shared/bankfeedmapping.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bank-feeds/docs/models/shared/banktransactions.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bank-feeds/docs/models/shared/company.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bank-feeds/docs/models/shared/connection.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bank-feeds/docs/models/shared/dataconnectionerror.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bank-feeds/docs/models/shared/pushoperation.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bank-feeds/docs/models/shared/sourceaccount.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bank-feeds/docs/models/shared/zero.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bank-feeds/docs/sdks/accountmapping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ s = codatbankfeeds.CodatBankFeeds(

req = operations.CreateBankAccountMappingRequest(
zero=shared.Zero(
feed_start_date='2022-10-23T00:00:00.000Z',
feed_start_date='2022-10-23T00:00:00Z',
),
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171',
Expand Down
17 changes: 9 additions & 8 deletions bank-feeds/docs/sdks/sourceaccounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@ Source accounts act as a bridge to bank accounts in accounting software.

The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software.

#### Account Mapping Variability
#### Account mapping variability

The method of mapping the source account to the target account varies depending on the accounting package your company uses.

#### Mapping Options:
#### Mapping options:

1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience.
2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping.
3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself.

### Integration specific behaviour
### Integration-specific behaviour

| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping |
| --------------------- | ----------- | ---------------- | --------------------------- |
| Xero ||| |
| FreeAgent ||| |
| Oracle NetSuite ||| |
| Exact Online (NL) ||| |
| QuickBooks Online | | ||
| Sage | | ||


### Example Usage

```python
Expand All @@ -54,9 +55,9 @@ s = codatbankfeeds.CodatBankFeeds(
req = operations.CreateSourceAccountRequest(
source_account=shared.SourceAccount(
currency='USD',
feed_start_date='2022-10-23T00:00:00.000Z',
feed_start_date='2022-10-23T00:00:00Z',
id='<ID>',
modified_date='2022-10-23T00:00:00.000Z',
modified_date='2022-10-23T00:00:00Z',
),
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171',
Expand Down Expand Up @@ -305,9 +306,9 @@ s = codatbankfeeds.CodatBankFeeds(
req = operations.UpdateSourceAccountRequest(
source_account=shared.SourceAccount(
currency='EUR',
feed_start_date='2022-10-23T00:00:00.000Z',
feed_start_date='2022-10-23T00:00:00Z',
id='<ID>',
modified_date='2022-10-23T00:00:00.000Z',
modified_date='2022-10-23T00:00:00Z',
),
account_id='13d946f0-c5d5-42bc-b092-97ece17923ab',
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
Expand Down
2 changes: 1 addition & 1 deletion bank-feeds/docs/sdks/transactions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ req = operations.CreateBankTransactionsRequest(
amount=Decimal('999.99'),
balance=Decimal('-999.99'),
counterparty='ACME INC',
date_='2022-10-23T00:00:00.000Z',
date_='2022-10-23T00:00:00Z',
description='Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60',
id='716422529',
reconciled=False,
Expand Down
2 changes: 1 addition & 1 deletion bank-feeds/files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ src/codatbankfeeds/models/errors/__init__.py
src/codatbankfeeds/models/operations/__init__.py
src/codatbankfeeds/models/shared/__init__.py
src/codatbankfeeds/models/webhooks/__init__.py
USAGE.md
docs/models/operations/createcompanyresponse.md
docs/models/operations/deletecompanyrequest.md
docs/models/operations/deletecompanyresponse.md
Expand Down Expand Up @@ -162,4 +161,5 @@ docs/sdks/connections/README.md
docs/sdks/accountmapping/README.md
docs/sdks/sourceaccounts/README.md
docs/sdks/transactions/README.md
USAGE.md
.gitattributes
16 changes: 7 additions & 9 deletions bank-feeds/gen.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
configVersion: 1.0.0
management:
docChecksum: 3883df86e260290925331dc16726311d
docChecksum: a19e6e4f901ace72e0fa1bb907ccb71c
docVersion: 3.0.0
speakeasyVersion: 1.121.3
generationVersion: 2.195.2
speakeasyVersion: 1.126.3
generationVersion: 2.214.3
generation:
comments: {}
sdkClassName: CodatBankFeeds
repoURL: https://github.com/codatio/client-sdk-python.git
usageSnippets:
optionalPropertyRendering: withExample
telemetryEnabled: true
singleTagPerOp: false
features:
python:
core: 4.1.5
core: 4.3.0
deprecations: 2.81.1
examples: 2.81.3
globalSecurity: 2.83.0
globalSecurity: 2.83.1
globalServerURLs: 2.82.1
nameOverrides: 2.81.1
retries: 2.82.0
python:
version: 5.0.0
version: 5.1.0
author: Codat
clientServerStatusCodesAsErrors: true
description: Set up bank feeds from accounts in your application to supported accounting
platforms.
description: Set up bank feeds from accounts in your application to supported accounting platforms.
flattenGlobalSecurity: false
imports:
option: openapi
Expand Down
2 changes: 1 addition & 1 deletion bank-feeds/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="codat-bankfeeds",
version="5.0.0",
version="5.1.0",
author="Codat",
description="Set up bank feeds from accounts in your application to supported accounting platforms.",
long_description=long_description,
Expand Down
2 changes: 1 addition & 1 deletion bank-feeds/src/codatbankfeeds/account_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create(self, request: operations.CreateBankAccountMappingRequest, retries: O

url = utils.generate_url(operations.CreateBankAccountMappingRequest, base_url, '/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "zero", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.CreateBankAccountMappingRequest, "zero", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
6 changes: 3 additions & 3 deletions bank-feeds/src/codatbankfeeds/companies.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, sdk_config: SDKConfiguration) -> None:



def create(self, request: shared.CompanyRequestBody, retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse:
def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse:
r"""Create company
Creates a new company that can be used to assign connections to.
Expand All @@ -24,7 +24,7 @@ def create(self, request: shared.CompanyRequestBody, retries: Optional[utils.Ret

url = base_url + '/companies'
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CompanyRequestBody], "request", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -248,7 +248,7 @@ def update(self, request: operations.UpdateCompanyRequest, retries: Optional[uti

url = utils.generate_url(operations.UpdateCompanyRequest, base_url, '/companies/{companyId}', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "company_request_body", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCompanyRequest, "company_request_body", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
4 changes: 2 additions & 2 deletions bank-feeds/src/codatbankfeeds/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create(self, request: operations.CreateConnectionRequest, retries: Optional[

url = utils.generate_url(operations.CreateConnectionRequest, base_url, '/companies/{companyId}/connections', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request_body", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.CreateConnectionRequest, "request_body", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -249,7 +249,7 @@ def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[

url = utils.generate_url(operations.UnlinkConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request_body", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.UnlinkConnectionRequest, "request_body", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
4 changes: 2 additions & 2 deletions bank-feeds/src/codatbankfeeds/models/errors/errormessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@dataclasses.dataclass
class ErrorMessage(Exception):
r"""Your `query` parameter was not correctly formed"""
r"""The request made is not valid."""
can_be_retried: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('canBeRetried'), 'exclude': lambda f: f is None }})
r"""`True` if the error occurred transiently and can be retried."""
correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }})
Expand All @@ -27,4 +27,4 @@ class ErrorMessage(Exception):


def __str__(self) -> str:
return utils.marshal_json(self)
return utils.marshal_json(self, type(self))
Loading

0 comments on commit 4226c4f

Please sign in to comment.