From 44473bb6addaa10a4a4ee496813b433ca27f65b4 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 12 Jan 2024 10:30:54 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 3.0.0, Speakeasy CLI 1.136.1 --- bank-feeds/.speakeasy/gen.lock | 56 +++-- bank-feeds/README.md | 2 + bank-feeds/RELEASES.md | 12 +- .../operations/createbankaccountrequest.md | 11 + .../operations/createbankaccountresponse.md | 11 + .../getcreatebankaccountsmodelrequest.md | 9 + .../getcreatebankaccountsmodelresponse.md | 11 + .../models/shared/accountingbankaccount.md | 6 +- .../shared/bankaccountcreateresponse.md | 21 ++ ...ankaccountcreateresponsebankaccounttype.md | 14 ++ .../models/shared/bankaccountprototype.md | 18 ++ bank-feeds/docs/models/shared/bankaccounts.md | 14 +- .../bankaccountsaccountingbankaccount.md | 40 ++++ .../shared/bankaccountsbankaccounttype.md | 14 ++ .../models/shared/bankaccountsmetadata.md | 8 + .../shared/bankaccountssupplementaldata.md | 12 ++ .../docs/models/shared/pushfieldvalidation.md | 10 + bank-feeds/docs/models/shared/pushoption.md | 14 ++ .../docs/models/shared/pushoptionchoice.md | 12 ++ .../docs/models/shared/pushoptionproperty.md | 14 ++ .../docs/models/shared/pushoptiontype.md | 17 ++ .../docs/models/shared/pushvalidationinfo.md | 9 + bank-feeds/docs/sdks/bankaccounts/README.md | 115 ++++++++++ bank-feeds/gen.yaml | 2 +- bank-feeds/setup.py | 2 +- .../src/codatbankfeeds/bank_accounts.py | 132 ++++++++++++ .../models/operations/__init__.py | 4 +- .../models/operations/create_bank_account.py | 35 +++ .../get_create_bankaccounts_model.py | 31 +++ .../codatbankfeeds/models/shared/__init__.py | 10 +- .../shared/bankaccountcreateresponse.py | 200 ++++++++++++++++++ .../models/shared/bankaccountprototype.py | 71 +++++++ .../models/shared/bankaccounts.py | 16 +- .../models/shared/pushfieldvalidation.py | 20 ++ .../models/shared/pushoption.py | 29 +++ .../models/shared/pushoptionchoice.py | 25 +++ .../models/shared/pushoptionproperty.py | 28 +++ .../models/shared/pushoptiontype.py | 15 ++ .../models/shared/pushvalidationinfo.py | 17 ++ .../src/codatbankfeeds/sdkconfiguration.py | 6 +- 40 files changed, 1054 insertions(+), 39 deletions(-) create mode 100644 bank-feeds/docs/models/operations/createbankaccountrequest.md create mode 100644 bank-feeds/docs/models/operations/createbankaccountresponse.md create mode 100644 bank-feeds/docs/models/operations/getcreatebankaccountsmodelrequest.md create mode 100644 bank-feeds/docs/models/operations/getcreatebankaccountsmodelresponse.md create mode 100644 bank-feeds/docs/models/shared/bankaccountcreateresponse.md create mode 100644 bank-feeds/docs/models/shared/bankaccountcreateresponsebankaccounttype.md create mode 100644 bank-feeds/docs/models/shared/bankaccountprototype.md create mode 100644 bank-feeds/docs/models/shared/bankaccountsaccountingbankaccount.md create mode 100644 bank-feeds/docs/models/shared/bankaccountsbankaccounttype.md create mode 100644 bank-feeds/docs/models/shared/bankaccountsmetadata.md create mode 100644 bank-feeds/docs/models/shared/bankaccountssupplementaldata.md create mode 100644 bank-feeds/docs/models/shared/pushfieldvalidation.md create mode 100644 bank-feeds/docs/models/shared/pushoption.md create mode 100644 bank-feeds/docs/models/shared/pushoptionchoice.md create mode 100644 bank-feeds/docs/models/shared/pushoptionproperty.md create mode 100644 bank-feeds/docs/models/shared/pushoptiontype.md create mode 100644 bank-feeds/docs/models/shared/pushvalidationinfo.md create mode 100644 bank-feeds/src/codatbankfeeds/models/operations/create_bank_account.py create mode 100644 bank-feeds/src/codatbankfeeds/models/operations/get_create_bankaccounts_model.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/bankaccountcreateresponse.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/bankaccountprototype.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/pushfieldvalidation.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/pushoption.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/pushoptionchoice.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/pushoptionproperty.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/pushoptiontype.py create mode 100644 bank-feeds/src/codatbankfeeds/models/shared/pushvalidationinfo.py diff --git a/bank-feeds/.speakeasy/gen.lock b/bank-feeds/.speakeasy/gen.lock index e89a88ff2..47c819bc1 100755 --- a/bank-feeds/.speakeasy/gen.lock +++ b/bank-feeds/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 07093ad1-99d8-4bbd-a29c-a624e1b0e25a management: - docChecksum: 3a0b899f2dc3766b39e4fd3e931ebe0c + docChecksum: d8a3c846c6e6c943937af494c3623e4f docVersion: 3.0.0 speakeasyVersion: internal - generationVersion: 2.230.3 - releaseVersion: 6.0.1 - configChecksum: 6e0bf71d5591a041364a525f826b1966 + generationVersion: 2.231.0 + releaseVersion: 6.1.0 + configChecksum: 708926194b40801b64a55104595fbdbc repoURL: https://github.com/codatio/client-sdk-python.git repoSubDirectory: bank-feeds installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=bank-feeds @@ -19,6 +19,7 @@ features: examples: 2.81.3 globalSecurity: 2.83.1 globalServerURLs: 2.82.1 + inputOutputModels: 2.83.0 nameOverrides: 2.81.1 retries: 2.82.0 generatedFiles: @@ -57,6 +58,8 @@ generatedFiles: - src/codatbankfeeds/models/operations/generate_credentials.py - src/codatbankfeeds/models/operations/list_source_accounts.py - src/codatbankfeeds/models/operations/update_source_account.py + - src/codatbankfeeds/models/operations/create_bank_account.py + - src/codatbankfeeds/models/operations/get_create_bankaccounts_model.py - src/codatbankfeeds/models/operations/list_bank_accounts.py - src/codatbankfeeds/models/operations/create_bank_transactions.py - src/codatbankfeeds/models/operations/get_create_operation.py @@ -79,17 +82,25 @@ generatedFiles: - src/codatbankfeeds/models/shared/targetaccountoption.py - src/codatbankfeeds/models/shared/sourceaccount.py - src/codatbankfeeds/models/shared/bankaccountcredentials.py - - src/codatbankfeeds/models/shared/bankaccounts.py - - src/codatbankfeeds/models/shared/createbanktransactionsresponse.py + - src/codatbankfeeds/models/shared/bankaccountcreateresponse.py - src/codatbankfeeds/models/shared/validation.py - src/codatbankfeeds/models/shared/validationitem.py - src/codatbankfeeds/models/shared/pushoperationstatus.py - src/codatbankfeeds/models/shared/datatype.py - - src/codatbankfeeds/models/shared/createbanktransactions.py - - src/codatbankfeeds/models/shared/banktransactions.py - src/codatbankfeeds/models/shared/pushoperationchange.py - src/codatbankfeeds/models/shared/pushchangetype.py - src/codatbankfeeds/models/shared/pushoperationref.py + - src/codatbankfeeds/models/shared/bankaccountprototype.py + - src/codatbankfeeds/models/shared/pushoption.py + - src/codatbankfeeds/models/shared/pushvalidationinfo.py + - src/codatbankfeeds/models/shared/pushfieldvalidation.py + - src/codatbankfeeds/models/shared/pushoptiontype.py + - src/codatbankfeeds/models/shared/pushoptionproperty.py + - src/codatbankfeeds/models/shared/pushoptionchoice.py + - src/codatbankfeeds/models/shared/bankaccounts.py + - src/codatbankfeeds/models/shared/createbanktransactionsresponse.py + - src/codatbankfeeds/models/shared/createbanktransactions.py + - src/codatbankfeeds/models/shared/banktransactions.py - src/codatbankfeeds/models/shared/pushoperation.py - src/codatbankfeeds/models/shared/pushoperations.py - src/codatbankfeeds/models/shared/configuration.py @@ -151,6 +162,10 @@ generatedFiles: - docs/models/operations/listsourceaccountsresponse.md - docs/models/operations/updatesourceaccountrequest.md - docs/models/operations/updatesourceaccountresponse.md + - docs/models/operations/createbankaccountrequest.md + - docs/models/operations/createbankaccountresponse.md + - docs/models/operations/getcreatebankaccountsmodelrequest.md + - docs/models/operations/getcreatebankaccountsmodelresponse.md - docs/models/operations/listbankaccountsrequest.md - docs/models/operations/listbankaccountsresponse.md - docs/models/operations/createbanktransactionsrequest.md @@ -181,22 +196,35 @@ generatedFiles: - docs/models/shared/targetaccountoption.md - docs/models/shared/sourceaccount.md - docs/models/shared/bankaccountcredentials.md - - docs/models/shared/bankaccounttype.md + - docs/models/shared/bankaccountcreateresponsebankaccounttype.md - docs/models/shared/metadata.md - docs/models/shared/supplementaldata.md - docs/models/shared/accountingbankaccount.md - - docs/models/shared/bankaccounts.md - - docs/models/shared/createbanktransactionsresponse.md + - docs/models/shared/bankaccountcreateresponse.md - docs/models/shared/validation.md - docs/models/shared/validationitem.md - docs/models/shared/pushoperationstatus.md - docs/models/shared/datatype.md - - docs/models/shared/createbanktransactions.md - - docs/models/shared/banktransactiontype.md - - docs/models/shared/banktransactions.md - docs/models/shared/pushoperationchange.md - docs/models/shared/pushchangetype.md - docs/models/shared/pushoperationref.md + - docs/models/shared/bankaccounttype.md + - docs/models/shared/bankaccountprototype.md + - docs/models/shared/pushoption.md + - docs/models/shared/pushvalidationinfo.md + - docs/models/shared/pushfieldvalidation.md + - docs/models/shared/pushoptiontype.md + - docs/models/shared/pushoptionproperty.md + - docs/models/shared/pushoptionchoice.md + - docs/models/shared/bankaccountsbankaccounttype.md + - docs/models/shared/bankaccountsmetadata.md + - docs/models/shared/bankaccountssupplementaldata.md + - docs/models/shared/bankaccountsaccountingbankaccount.md + - docs/models/shared/bankaccounts.md + - docs/models/shared/createbanktransactionsresponse.md + - docs/models/shared/createbanktransactions.md + - docs/models/shared/banktransactiontype.md + - docs/models/shared/banktransactions.md - docs/models/shared/pushoperation.md - docs/models/shared/pushoperations.md - docs/models/shared/configuration.md diff --git a/bank-feeds/README.md b/bank-feeds/README.md index 5c9912672..34f3c5d85 100755 --- a/bank-feeds/README.md +++ b/bank-feeds/README.md @@ -81,6 +81,8 @@ if res.company is not None: ### [bank_accounts](docs/sdks/bankaccounts/README.md) +* [create](docs/sdks/bankaccounts/README.md#create) - Create bank account +* [get_create_model](docs/sdks/bankaccounts/README.md#get_create_model) - Get create/update bank account model * [list](docs/sdks/bankaccounts/README.md#list) - List bank accounts ### [transactions](docs/sdks/transactions/README.md) diff --git a/bank-feeds/RELEASES.md b/bank-feeds/RELEASES.md index 2cc8d60ac..b9b6e4d74 100644 --- a/bank-feeds/RELEASES.md +++ b/bank-feeds/RELEASES.md @@ -768,4 +768,14 @@ Based on: ### Generated - [python v6.0.1] bank-feeds ### Releases -- [PyPI v6.0.1] https://pypi.org/project/codat-bankfeeds/6.0.1 - bank-feeds \ No newline at end of file +- [PyPI v6.0.1] https://pypi.org/project/codat-bankfeeds/6.0.1 - bank-feeds + +## 2024-01-12 10:30:39 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Bank-Feeds.yaml +- Speakeasy CLI 1.136.1 (2.231.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v6.1.0] bank-feeds +### Releases +- [PyPI v6.1.0] https://pypi.org/project/codat-bankfeeds/6.1.0 - bank-feeds \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/createbankaccountrequest.md b/bank-feeds/docs/models/operations/createbankaccountrequest.md new file mode 100644 index 000000000..c7324959e --- /dev/null +++ b/bank-feeds/docs/models/operations/createbankaccountrequest.md @@ -0,0 +1,11 @@ +# CreateBankAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `bank_account_prototype` | [Optional[shared.BankAccountPrototype]](../../models/shared/bankaccountprototype.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/createbankaccountresponse.md b/bank-feeds/docs/models/operations/createbankaccountresponse.md new file mode 100644 index 000000000..dd96effea --- /dev/null +++ b/bank-feeds/docs/models/operations/createbankaccountresponse.md @@ -0,0 +1,11 @@ +# CreateBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `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_account_create_response` | [Optional[shared.BankAccountCreateResponse]](../../models/shared/bankaccountcreateresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/getcreatebankaccountsmodelrequest.md b/bank-feeds/docs/models/operations/getcreatebankaccountsmodelrequest.md new file mode 100644 index 000000000..a45e1bb79 --- /dev/null +++ b/bank-feeds/docs/models/operations/getcreatebankaccountsmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateBankAccountsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/getcreatebankaccountsmodelresponse.md b/bank-feeds/docs/models/operations/getcreatebankaccountsmodelresponse.md new file mode 100644 index 000000000..1d1026c90 --- /dev/null +++ b/bank-feeds/docs/models/operations/getcreatebankaccountsmodelresponse.md @@ -0,0 +1,11 @@ +# GetCreateBankAccountsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/accountingbankaccount.md b/bank-feeds/docs/models/shared/accountingbankaccount.md index f61922a6f..e29cc863b 100644 --- a/bank-feeds/docs/models/shared/accountingbankaccount.md +++ b/bank-feeds/docs/models/shared/accountingbankaccount.md @@ -1,4 +1,4 @@ -# AccountingBankAccount +# ~~AccountingBankAccount~~ > **Accessing Bank Accounts through Banking API** > @@ -17,6 +17,8 @@ Bank accounts data includes: * The currency and balance of the account. * The sort code and account number. +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + ## Fields @@ -24,7 +26,7 @@ Bank accounts data includes: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `account_name` | *Optional[str]* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | | `account_number` | *Optional[str]* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | -| `account_type` | [Optional[shared.BankAccountType]](../../models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `account_type` | [Optional[shared.BankAccountCreateResponseBankAccountType]](../../models/shared/bankaccountcreateresponsebankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `available_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | | `balance` | *Optional[Decimal]* | :heavy_minus_sign: | Balance of the bank account. | | | `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | diff --git a/bank-feeds/docs/models/shared/bankaccountcreateresponse.md b/bank-feeds/docs/models/shared/bankaccountcreateresponse.md new file mode 100644 index 000000000..cbf080b36 --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountcreateresponse.md @@ -0,0 +1,21 @@ +# BankAccountCreateResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `data` | [Optional[shared.AccountingBankAccount]](../../models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *str* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccountcreateresponsebankaccounttype.md b/bank-feeds/docs/models/shared/bankaccountcreateresponsebankaccounttype.md new file mode 100644 index 000000000..1672cfb66 --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountcreateresponsebankaccounttype.md @@ -0,0 +1,14 @@ +# BankAccountCreateResponseBankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccountprototype.md b/bank-feeds/docs/models/shared/bankaccountprototype.md new file mode 100644 index 000000000..9923f042f --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountprototype.md @@ -0,0 +1,18 @@ +# BankAccountPrototype + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *Optional[str]* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | +| `account_number` | *Optional[str]* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | +| `account_type` | [Optional[shared.BankAccountType]](../../models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `available_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | +| `balance` | *Optional[Decimal]* | :heavy_minus_sign: | Balance of the bank account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `i_ban` | *Optional[str]* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | +| `institution` | *Optional[str]* | :heavy_minus_sign: | The institution of the bank account. | | +| `nominal_code` | *Optional[str]* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `overdraft_limit` | *Optional[Decimal]* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | +| `sort_code` | *Optional[str]* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccounts.md b/bank-feeds/docs/models/shared/bankaccounts.md index f19c089e5..14aa06d80 100644 --- a/bank-feeds/docs/models/shared/bankaccounts.md +++ b/bank-feeds/docs/models/shared/bankaccounts.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | -| `results` | List[[shared.AccountingBankAccount](../../models/shared/accountingbankaccount.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[shared.BankAccountsAccountingBankAccount](../../models/shared/bankaccountsaccountingbankaccount.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccountsaccountingbankaccount.md b/bank-feeds/docs/models/shared/bankaccountsaccountingbankaccount.md new file mode 100644 index 000000000..8d59f6e72 --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountsaccountingbankaccount.md @@ -0,0 +1,40 @@ +# BankAccountsAccountingBankAccount + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/bank-feeds-api#/schemas/Account) + +> View the coverage for bank accounts in the Data coverage explorer. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting platform. +* The currency and balance of the account. +* The sort code and account number. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *Optional[str]* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | +| `account_number` | *Optional[str]* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | +| `account_type` | [Optional[shared.BankAccountsBankAccountType]](../../models/shared/bankaccountsbankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `available_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | +| `balance` | *Optional[Decimal]* | :heavy_minus_sign: | Balance of the bank account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `i_ban` | *Optional[str]* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | | +| `institution` | *Optional[str]* | :heavy_minus_sign: | The institution of the bank account. | | +| `metadata` | [Optional[shared.BankAccountsMetadata]](../../models/shared/bankaccountsmetadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `nominal_code` | *Optional[str]* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `overdraft_limit` | *Optional[Decimal]* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | +| `sort_code` | *Optional[str]* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.BankAccountsSupplementalData]](../../models/shared/bankaccountssupplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccountsbankaccounttype.md b/bank-feeds/docs/models/shared/bankaccountsbankaccounttype.md new file mode 100644 index 000000000..d40325914 --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountsbankaccounttype.md @@ -0,0 +1,14 @@ +# BankAccountsBankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccountsmetadata.md b/bank-feeds/docs/models/shared/bankaccountsmetadata.md new file mode 100644 index 000000000..c0150d48c --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountsmetadata.md @@ -0,0 +1,8 @@ +# BankAccountsMetadata + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `is_deleted` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankaccountssupplementaldata.md b/bank-feeds/docs/models/shared/bankaccountssupplementaldata.md new file mode 100644 index 000000000..6676dbbe9 --- /dev/null +++ b/bank-feeds/docs/models/shared/bankaccountssupplementaldata.md @@ -0,0 +1,12 @@ +# BankAccountsSupplementalData + +Supplemental data is additional data you can include in our standard data types. + +It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `content` | Dict[str, Dict[str, *Any*]] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/pushfieldvalidation.md b/bank-feeds/docs/models/shared/pushfieldvalidation.md new file mode 100644 index 000000000..60ce548f0 --- /dev/null +++ b/bank-feeds/docs/models/shared/pushfieldvalidation.md @@ -0,0 +1,10 @@ +# PushFieldValidation + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `details` | *str* | :heavy_check_mark: | Details on the validation issue. | +| `field` | *Optional[str]* | :heavy_minus_sign: | Field name that resulted in the validation issue. | +| `ref` | *Optional[str]* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/pushoption.md b/bank-feeds/docs/models/shared/pushoption.md new file mode 100644 index 000000000..e908d0b28 --- /dev/null +++ b/bank-feeds/docs/models/shared/pushoption.md @@ -0,0 +1,14 @@ +# PushOption + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `description` | *Optional[str]* | :heavy_minus_sign: | A description of the property. | +| `display_name` | *str* | :heavy_check_mark: | The property's display name. | +| `options` | List[[shared.PushOptionChoice](../../models/shared/pushoptionchoice.md)] | :heavy_minus_sign: | N/A | +| `properties` | Dict[str, [shared.PushOptionProperty](../../models/shared/pushoptionproperty.md)] | :heavy_minus_sign: | N/A | +| `required` | *bool* | :heavy_check_mark: | The property is required if `True`. | +| `type` | [shared.PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `validation` | [Optional[shared.PushValidationInfo]](../../models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/pushoptionchoice.md b/bank-feeds/docs/models/shared/pushoptionchoice.md new file mode 100644 index 000000000..44e988b26 --- /dev/null +++ b/bank-feeds/docs/models/shared/pushoptionchoice.md @@ -0,0 +1,12 @@ +# PushOptionChoice + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `description` | *Optional[str]* | :heavy_minus_sign: | A description of the property. | +| `display_name` | *Optional[str]* | :heavy_minus_sign: | The property's display name. | +| `required` | *Optional[bool]* | :heavy_minus_sign: | The property is required if `True`. | +| `type` | [Optional[shared.PushOptionType]](../../models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | +| `value` | *Optional[str]* | :heavy_minus_sign: | Allowed value for field. | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/pushoptionproperty.md b/bank-feeds/docs/models/shared/pushoptionproperty.md new file mode 100644 index 000000000..2bedd19d3 --- /dev/null +++ b/bank-feeds/docs/models/shared/pushoptionproperty.md @@ -0,0 +1,14 @@ +# PushOptionProperty + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `description` | *str* | :heavy_check_mark: | A description of the property. | +| `display_name` | *str* | :heavy_check_mark: | The property's display name. | +| `options` | List[[shared.PushOptionChoice](../../models/shared/pushoptionchoice.md)] | :heavy_minus_sign: | N/A | +| `properties` | Dict[str, [shared.PushOptionProperty](../../models/shared/pushoptionproperty.md)] | :heavy_minus_sign: | N/A | +| `required` | *bool* | :heavy_check_mark: | The property is required if `True`. | +| `type` | [shared.PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `validation` | [Optional[shared.PushValidationInfo]](../../models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/pushoptiontype.md b/bank-feeds/docs/models/shared/pushoptiontype.md new file mode 100644 index 000000000..2f263a07c --- /dev/null +++ b/bank-feeds/docs/models/shared/pushoptiontype.md @@ -0,0 +1,17 @@ +# PushOptionType + +The option type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ARRAY` | Array | +| `OBJECT` | Object | +| `STRING` | String | +| `NUMBER` | Number | +| `BOOLEAN` | Boolean | +| `DATE_TIME` | DateTime | +| `FILE` | File | +| `MULTI_PART` | MultiPart | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/pushvalidationinfo.md b/bank-feeds/docs/models/shared/pushvalidationinfo.md new file mode 100644 index 000000000..110eb3f76 --- /dev/null +++ b/bank-feeds/docs/models/shared/pushvalidationinfo.md @@ -0,0 +1,9 @@ +# PushValidationInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `information` | List[[shared.PushFieldValidation](../../models/shared/pushfieldvalidation.md)] | :heavy_minus_sign: | N/A | +| `warnings` | List[[shared.PushFieldValidation](../../models/shared/pushfieldvalidation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/bankaccounts/README.md b/bank-feeds/docs/sdks/bankaccounts/README.md index d427e3808..2575837fd 100644 --- a/bank-feeds/docs/sdks/bankaccounts/README.md +++ b/bank-feeds/docs/sdks/bankaccounts/README.md @@ -7,8 +7,123 @@ Access bank accounts in an SMBs accounting platform. ### Available Operations +* [create](#create) - Create bank account +* [get_create_model](#get_create_model) - Get create/update bank account model * [list](#list) - List bank accounts +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + +### Example Usage + +```python +import codatbankfeeds +from codatbankfeeds.models import operations, shared +from decimal import Decimal + +s = codatbankfeeds.CodatBankFeeds( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateBankAccountRequest( + bank_account_prototype=shared.BankAccountPrototype( + currency='USD', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bank_accounts.create(req) + +if res.bank_account_create_response is not None: + # handle response + pass +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountRequest](../../models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.CreateBankAccountResponse](../../models/operations/createbankaccountresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | +| errors.SDKError | 4x-5xx | */* | + +## get_create_model + +The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + + +### Example Usage + +```python +import codatbankfeeds +from codatbankfeeds.models import operations, shared + +s = codatbankfeeds.CodatBankFeeds( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateBankAccountsModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bank_accounts.get_create_model(req) + +if res.push_option is not None: + # handle response + pass +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateBankAccountsModelRequest](../../models/operations/getcreatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.GetCreateBankAccountsModelResponse](../../models/operations/getcreatebankaccountsmodelresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | +| errors.SDKError | 4x-5xx | */* | + ## list The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. diff --git a/bank-feeds/gen.yaml b/bank-feeds/gen.yaml index b7616033e..b88088821 100644 --- a/bank-feeds/gen.yaml +++ b/bank-feeds/gen.yaml @@ -7,7 +7,7 @@ generation: nameResolutionDec2023: false telemetryEnabled: true python: - version: 6.0.1 + version: 6.1.0 author: Codat clientServerStatusCodesAsErrors: true description: Set up bank feeds from accounts in your application to supported accounting platforms. diff --git a/bank-feeds/setup.py b/bank-feeds/setup.py index dca9205e2..b5ec4b721 100644 --- a/bank-feeds/setup.py +++ b/bank-feeds/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-bankfeeds", - version="6.0.1", + version="6.1.0", author="Codat", description="Set up bank feeds from accounts in your application to supported accounting platforms.", long_description=long_description, diff --git a/bank-feeds/src/codatbankfeeds/bank_accounts.py b/bank-feeds/src/codatbankfeeds/bank_accounts.py index 192c23f22..782d18e84 100644 --- a/bank-feeds/src/codatbankfeeds/bank_accounts.py +++ b/bank-feeds/src/codatbankfeeds/bank_accounts.py @@ -14,6 +14,138 @@ def __init__(self, sdk_config: SDKConfiguration) -> None: + def create(self, request: operations.CreateBankAccountRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateBankAccountResponse: + r"""Create bank account + The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. + + [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateBankAccountRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/bankAccounts', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, operations.CreateBankAccountRequest, "bank_account_prototype", False, True, 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateBankAccountRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = self.sdk_configuration.user_agent + + if callable(self.sdk_configuration.security): + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) + else: + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, data=data, files=form, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + content_type = http_res.headers.get('Content-Type') + + res = operations.CreateBankAccountResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.BankAccountCreateResponse]) + res.bank_account_create_response = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) + out.raw_response = http_res + raise out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: + raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) + + return res + + + + def get_create_model(self, request: operations.GetCreateBankAccountsModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateBankAccountsModelResponse: + r"""Get create/update bank account model + The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. + + [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateBankAccountsModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/bankAccounts', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = self.sdk_configuration.user_agent + + if callable(self.sdk_configuration.security): + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) + else: + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('GET', url, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + content_type = http_res.headers.get('Content-Type') + + res = operations.GetCreateBankAccountsModelResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + res.push_option = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) + out.raw_response = http_res + raise out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: + raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListBankAccountsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListBankAccountsResponse: r"""List bank accounts The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. diff --git a/bank-feeds/src/codatbankfeeds/models/operations/__init__.py b/bank-feeds/src/codatbankfeeds/models/operations/__init__.py index 53c867812..be219e88a 100644 --- a/bank-feeds/src/codatbankfeeds/models/operations/__init__.py +++ b/bank-feeds/src/codatbankfeeds/models/operations/__init__.py @@ -1,5 +1,6 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +from .create_bank_account import * from .create_bank_account_mapping import * from .create_bank_transactions import * from .create_company import * @@ -14,6 +15,7 @@ from .get_company import * from .get_configuration import * from .get_connection import * +from .get_create_bankaccounts_model import * from .get_create_operation import * from .list_bank_accounts import * from .list_companies import * @@ -25,4 +27,4 @@ from .update_company import * from .update_source_account import * -__all__ = ["CreateBankAccountMappingRequest","CreateBankAccountMappingResponse","CreateBankTransactionsRequest","CreateBankTransactionsResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateSourceAccountRequest","CreateSourceAccountResponse","DeleteBankFeedCredentialsRequest","DeleteBankFeedCredentialsResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","DeleteSourceAccountRequest","DeleteSourceAccountResponse","GenerateCredentialsRequest","GenerateCredentialsResponse","GetBankAccountMappingRequest","GetBankAccountMappingResponse","GetCompanyRequest","GetCompanyResponse","GetConfigurationRequest","GetConfigurationResponse","GetConnectionRequest","GetConnectionResponse","GetCreateOperationRequest","GetCreateOperationResponse","ListBankAccountsRequest","ListBankAccountsResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListCreateOperationsRequest","ListCreateOperationsResponse","ListSourceAccountsRequest","ListSourceAccountsResponse","SetConfigurationRequest","SetConfigurationResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UnlinkConnectionUpdateConnection","UpdateCompanyRequest","UpdateCompanyResponse","UpdateSourceAccountRequest","UpdateSourceAccountResponse"] +__all__ = ["CreateBankAccountMappingRequest","CreateBankAccountMappingResponse","CreateBankAccountRequest","CreateBankAccountResponse","CreateBankTransactionsRequest","CreateBankTransactionsResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateSourceAccountRequest","CreateSourceAccountResponse","DeleteBankFeedCredentialsRequest","DeleteBankFeedCredentialsResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","DeleteSourceAccountRequest","DeleteSourceAccountResponse","GenerateCredentialsRequest","GenerateCredentialsResponse","GetBankAccountMappingRequest","GetBankAccountMappingResponse","GetCompanyRequest","GetCompanyResponse","GetConfigurationRequest","GetConfigurationResponse","GetConnectionRequest","GetConnectionResponse","GetCreateBankAccountsModelRequest","GetCreateBankAccountsModelResponse","GetCreateOperationRequest","GetCreateOperationResponse","ListBankAccountsRequest","ListBankAccountsResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListCreateOperationsRequest","ListCreateOperationsResponse","ListSourceAccountsRequest","ListSourceAccountsResponse","SetConfigurationRequest","SetConfigurationResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UnlinkConnectionUpdateConnection","UpdateCompanyRequest","UpdateCompanyResponse","UpdateSourceAccountRequest","UpdateSourceAccountResponse"] diff --git a/bank-feeds/src/codatbankfeeds/models/operations/create_bank_account.py b/bank-feeds/src/codatbankfeeds/models/operations/create_bank_account.py new file mode 100644 index 000000000..966378c64 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/operations/create_bank_account.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ...models.shared import bankaccountcreateresponse as shared_bankaccountcreateresponse +from ...models.shared import bankaccountprototype as shared_bankaccountprototype +from typing import Optional + + +@dataclasses.dataclass +class CreateBankAccountRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" + bank_account_prototype: Optional[shared_bankaccountprototype.BankAccountPrototype] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + r"""Time limit for the push operation to complete before it is timed out.""" + + + + +@dataclasses.dataclass +class CreateBankAccountResponse: + content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" + raw_response: requests_http.Response = dataclasses.field() + r"""Raw HTTP response; suitable for custom response parsing""" + status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" + bank_account_create_response: Optional[shared_bankaccountcreateresponse.BankAccountCreateResponse] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/bank-feeds/src/codatbankfeeds/models/operations/get_create_bankaccounts_model.py b/bank-feeds/src/codatbankfeeds/models/operations/get_create_bankaccounts_model.py new file mode 100644 index 000000000..eb18f3d72 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/operations/get_create_bankaccounts_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ...models.shared import pushoption as shared_pushoption +from typing import Optional + + +@dataclasses.dataclass +class GetCreateBankAccountsModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" + + + + +@dataclasses.dataclass +class GetCreateBankAccountsModelResponse: + content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" + raw_response: requests_http.Response = dataclasses.field() + r"""Raw HTTP response; suitable for custom response parsing""" + status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/__init__.py b/bank-feeds/src/codatbankfeeds/models/shared/__init__.py index 25a45d8c7..62d33e07d 100644 --- a/bank-feeds/src/codatbankfeeds/models/shared/__init__.py +++ b/bank-feeds/src/codatbankfeeds/models/shared/__init__.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +from .bankaccountcreateresponse import * from .bankaccountcredentials import * from .bankaccountoption import * +from .bankaccountprototype import * from .bankaccounts import * from .bankfeedaccountmappingresponse import * from .bankfeedmapping import * @@ -29,11 +31,17 @@ from .items import * from .links import * from .pushchangetype import * +from .pushfieldvalidation import * from .pushoperation import * from .pushoperationchange import * from .pushoperationref import * from .pushoperations import * from .pushoperationstatus import * +from .pushoption import * +from .pushoptionchoice import * +from .pushoptionproperty import * +from .pushoptiontype import * +from .pushvalidationinfo import * from .security import * from .sourceaccount import * from .syncasbankfeeds import * @@ -44,4 +52,4 @@ from .validationitem import * from .zero import * -__all__ = ["AccountingBankAccount","BankAccountCredentials","BankAccountOption","BankAccountType","BankAccounts","BankFeedAccountMappingResponse","BankFeedMapping","BankTransactionType","BankTransactions","ClientRateLimitReachedWebhook","ClientRateLimitReachedWebhookData","ClientRateLimitResetWebhook","ClientRateLimitResetWebhookData","Companies","Company","CompanyRequestBody","Configuration","ConfigurationContactRef","ConfigurationCustomer","ConfigurationSchedule","ConfigurationSupplier","Connection","Connections","CreateBankTransactions","CreateBankTransactionsResponse","DataConnectionError","DataConnectionStatus","DataType","GroupReference","HalRef","Items","Links","Metadata","PushChangeType","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperations","Security","SourceAccount","SourceType","SupplementalData","SyncAsBankFeeds","SyncAsExpenses","SyncConfiguration","TargetAccountOption","Validation","ValidationItem","Zero"] +__all__ = ["AccountingBankAccount","BankAccountCreateResponse","BankAccountCreateResponseBankAccountType","BankAccountCredentials","BankAccountOption","BankAccountPrototype","BankAccountType","BankAccounts","BankAccountsAccountingBankAccount","BankAccountsBankAccountType","BankAccountsMetadata","BankAccountsSupplementalData","BankFeedAccountMappingResponse","BankFeedMapping","BankTransactionType","BankTransactions","ClientRateLimitReachedWebhook","ClientRateLimitReachedWebhookData","ClientRateLimitResetWebhook","ClientRateLimitResetWebhookData","Companies","Company","CompanyRequestBody","Configuration","ConfigurationContactRef","ConfigurationCustomer","ConfigurationSchedule","ConfigurationSupplier","Connection","Connections","CreateBankTransactions","CreateBankTransactionsResponse","DataConnectionError","DataConnectionStatus","DataType","GroupReference","HalRef","Items","Links","Metadata","PushChangeType","PushFieldValidation","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperations","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","Security","SourceAccount","SourceType","SupplementalData","SyncAsBankFeeds","SyncAsExpenses","SyncConfiguration","TargetAccountOption","Validation","ValidationItem","Zero"] diff --git a/bank-feeds/src/codatbankfeeds/models/shared/bankaccountcreateresponse.py b/bank-feeds/src/codatbankfeeds/models/shared/bankaccountcreateresponse.py new file mode 100644 index 000000000..1faf346b9 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/bankaccountcreateresponse.py @@ -0,0 +1,200 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from .datatype import DataType +from .pushoperationchange import PushOperationChange +from .pushoperationstatus import PushOperationStatus +from .validation import Validation +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal +from enum import Enum +from typing import Any, Dict, List, Optional + +class BankAccountCreateResponseBankAccountType(str, Enum): + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + UNKNOWN = 'Unknown' + CREDIT = 'Credit' + DEBIT = 'Debit' + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class Metadata: + is_deleted: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isDeleted') }}) + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class SupplementalData: + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + content: Optional[Dict[str, Dict[str, Any]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content') }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class AccountingBankAccount: + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/bank-feeds-api#/schemas/Account) + + > View the coverage for bank accounts in the Data coverage explorer. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting platform. + * The currency and balance of the account. + * The sort code and account number. + + Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + """ + account_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountName') }}) + r"""Name of the bank account in the accounting platform.""" + account_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountNumber') }}) + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + account_type: Optional[BankAccountCreateResponseBankAccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountType'), 'exclude': lambda f: f is None }}) + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + available_balance: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('availableBalance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + balance: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('balance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""Balance of the bank account.""" + currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + i_ban: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('iBan') }}) + r"""International bank account number of the account. Often used when making or receiving international payments.""" + id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) + r"""Identifier for the account, unique for the company in the accounting platform.""" + institution: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('institution') }}) + r"""The institution of the bank account.""" + metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + nominal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('nominalCode') }}) + r"""Code used to identify each nominal account for a business.""" + overdraft_limit: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('overdraftLimit'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + sort_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sortCode') }}) + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) + supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class BankAccountCreateResponse: + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The current status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + r"""Push status code.""" + changes: Optional[List[PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes') }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + data: Optional[AccountingBankAccount] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data') }}) + data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage') }}) + r"""A message about the error.""" + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes') }}) + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds') }}) + r"""Number of seconds the push operation must complete within before it times out. + + Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + """ + validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/bankaccountprototype.py b/bank-feeds/src/codatbankfeeds/models/shared/bankaccountprototype.py new file mode 100644 index 000000000..2f1279749 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/bankaccountprototype.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal +from enum import Enum +from typing import Optional + +class BankAccountType(str, Enum): + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + UNKNOWN = 'Unknown' + CREDIT = 'Credit' + DEBIT = 'Debit' + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class BankAccountPrototype: + account_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountName') }}) + r"""Name of the bank account in the accounting platform.""" + account_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountNumber') }}) + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + account_type: Optional[BankAccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountType'), 'exclude': lambda f: f is None }}) + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + available_balance: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('availableBalance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + balance: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('balance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""Balance of the bank account.""" + currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + i_ban: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('iBan') }}) + r"""International bank account number of the account. Often used when making or receiving international payments.""" + institution: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('institution') }}) + r"""The institution of the bank account.""" + nominal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('nominalCode') }}) + r"""Code used to identify each nominal account for a business.""" + overdraft_limit: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('overdraftLimit'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + sort_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sortCode') }}) + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/bankaccounts.py b/bank-feeds/src/codatbankfeeds/models/shared/bankaccounts.py index 8e90c30ab..b45303237 100644 --- a/bank-feeds/src/codatbankfeeds/models/shared/bankaccounts.py +++ b/bank-feeds/src/codatbankfeeds/models/shared/bankaccounts.py @@ -9,7 +9,7 @@ from enum import Enum from typing import Any, Dict, List, Optional -class BankAccountType(str, Enum): +class BankAccountsBankAccountType(str, Enum): r"""The type of transactions and balances on the account. For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. For Debit accounts, positive balances are assets, and positive transactions **increase** assets. @@ -21,7 +21,7 @@ class BankAccountType(str, Enum): @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass -class Metadata: +class BankAccountsMetadata: is_deleted: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isDeleted') }}) r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" @@ -30,7 +30,7 @@ class Metadata: @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass -class SupplementalData: +class BankAccountsSupplementalData: r"""Supplemental data is additional data you can include in our standard data types. It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. @@ -42,7 +42,7 @@ class SupplementalData: @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass -class AccountingBankAccount: +class BankAccountsAccountingBankAccount: r"""> **Accessing Bank Accounts through Banking API** > > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. @@ -71,7 +71,7 @@ class AccountingBankAccount: FreeAgent integrations For Credit accounts, only the last four digits are required. For other types, the field is optional. """ - account_type: Optional[BankAccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountType'), 'exclude': lambda f: f is None }}) + account_type: Optional[BankAccountsBankAccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountType'), 'exclude': lambda f: f is None }}) r"""The type of transactions and balances on the account. For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. For Debit accounts, positive balances are assets, and positive transactions **increase** assets. @@ -95,7 +95,7 @@ class AccountingBankAccount: r"""Identifier for the account, unique for the company in the accounting platform.""" institution: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('institution') }}) r"""The institution of the bank account.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + metadata: Optional[BankAccountsMetadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) nominal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('nominalCode') }}) r"""Code used to identify each nominal account for a business.""" @@ -111,7 +111,7 @@ class AccountingBankAccount: The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. """ source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) + supplemental_data: Optional[BankAccountsSupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) r"""Supplemental data is additional data you can include in our standard data types. It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. @@ -130,6 +130,6 @@ class BankAccounts: r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) r"""Total number of items.""" - results: Optional[List[AccountingBankAccount]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + results: Optional[List[BankAccountsAccountingBankAccount]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/bank-feeds/src/codatbankfeeds/models/shared/pushfieldvalidation.py b/bank-feeds/src/codatbankfeeds/models/shared/pushfieldvalidation.py new file mode 100644 index 000000000..9da4b4e33 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/pushfieldvalidation.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class PushFieldValidation: + details: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('details') }}) + r"""Details on the validation issue.""" + field: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('field'), 'exclude': lambda f: f is None }}) + r"""Field name that resulted in the validation issue.""" + ref: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ref') }}) + r"""Unique reference identifier for the validation issue.""" + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/pushoption.py b/bank-feeds/src/codatbankfeeds/models/shared/pushoption.py new file mode 100644 index 000000000..da4d844a8 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/pushoption.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from .pushoptionchoice import PushOptionChoice +from .pushoptionproperty import PushOptionProperty +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Dict, List, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class PushOption: + display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) + r"""The property's display name.""" + required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) + r"""The property is required if `True`.""" + type: PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""The option type.""" + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""A description of the property.""" + options: Optional[List[PushOptionChoice]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options') }}) + properties: Optional[Dict[str, PushOptionProperty]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties') }}) + validation: Optional[PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/pushoptionchoice.py b/bank-feeds/src/codatbankfeeds/models/shared/pushoptionchoice.py new file mode 100644 index 000000000..b255ecbac --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/pushoptionchoice.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from .pushoptiontype import PushOptionType +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class PushOptionChoice: + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""A description of the property.""" + display_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName'), 'exclude': lambda f: f is None }}) + r"""The property's display name.""" + required: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required'), 'exclude': lambda f: f is None }}) + r"""The property is required if `True`.""" + type: Optional[PushOptionType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""The option type.""" + value: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('value'), 'exclude': lambda f: f is None }}) + r"""Allowed value for field.""" + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/pushoptionproperty.py b/bank-feeds/src/codatbankfeeds/models/shared/pushoptionproperty.py new file mode 100644 index 000000000..4db696b7b --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/pushoptionproperty.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from .pushoptionchoice import PushOptionChoice +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Dict, List, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class PushOptionProperty: + description: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }}) + r"""A description of the property.""" + display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) + r"""The property's display name.""" + required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) + r"""The property is required if `True`.""" + type: PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""The option type.""" + options: Optional[List[PushOptionChoice]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options') }}) + properties: Optional[Dict[str, PushOptionProperty]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties') }}) + validation: Optional[PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) + + diff --git a/bank-feeds/src/codatbankfeeds/models/shared/pushoptiontype.py b/bank-feeds/src/codatbankfeeds/models/shared/pushoptiontype.py new file mode 100644 index 000000000..f069e2d84 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/pushoptiontype.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class PushOptionType(str, Enum): + r"""The option type.""" + ARRAY = 'Array' + OBJECT = 'Object' + STRING = 'String' + NUMBER = 'Number' + BOOLEAN = 'Boolean' + DATE_TIME = 'DateTime' + FILE = 'File' + MULTI_PART = 'MultiPart' diff --git a/bank-feeds/src/codatbankfeeds/models/shared/pushvalidationinfo.py b/bank-feeds/src/codatbankfeeds/models/shared/pushvalidationinfo.py new file mode 100644 index 000000000..abdee84c4 --- /dev/null +++ b/bank-feeds/src/codatbankfeeds/models/shared/pushvalidationinfo.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from .pushfieldvalidation import PushFieldValidation +from codatbankfeeds import utils +from dataclasses_json import Undefined, dataclass_json +from typing import List, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class PushValidationInfo: + information: Optional[List[PushFieldValidation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('information') }}) + warnings: Optional[List[PushFieldValidation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings') }}) + + diff --git a/bank-feeds/src/codatbankfeeds/sdkconfiguration.py b/bank-feeds/src/codatbankfeeds/sdkconfiguration.py index abaaf6ea8..05a50a762 100644 --- a/bank-feeds/src/codatbankfeeds/sdkconfiguration.py +++ b/bank-feeds/src/codatbankfeeds/sdkconfiguration.py @@ -22,9 +22,9 @@ class SDKConfiguration: server_idx: int = 0 language: str = 'python' openapi_doc_version: str = '3.0.0' - sdk_version: str = '6.0.1' - gen_version: str = '2.230.3' - user_agent: str = 'speakeasy-sdk/python 6.0.1 2.230.3 3.0.0 codat-bankfeeds' + sdk_version: str = '6.1.0' + gen_version: str = '2.231.0' + user_agent: str = 'speakeasy-sdk/python 6.1.0 2.231.0 3.0.0 codat-bankfeeds' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: