diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index dd861f070..efb6ce3c2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.453.8 +speakeasyVersion: 1.455.5 sources: accounting-source: sourceNamespace: accounting-source @@ -16,11 +16,11 @@ sources: - main bank-feeds-source: sourceNamespace: bank-feeds-source - sourceRevisionDigest: sha256:9133167d1473dc045331f1cfa81fb00aa3234e2b2b438f6808f576b259a76be8 - sourceBlobDigest: sha256:b5233f0bab180b8aae271a0d5ab149316931ec9e84a140e1c073a2025305eb7d + sourceRevisionDigest: sha256:9aaa05521af2d39743759c03b1f419f63c5d9726a66c9b9e448e95a9a53ccf2b + sourceBlobDigest: sha256:d8080d68edd35d878fad42ac6b343ac5c287f2cab63280c281a2adad5ddd117a tags: - latest - - speakeasy-sdk-regen-1733825306 + - speakeasy-sdk-regen-1734364659 - 3.0.0 banking-source: sourceNamespace: banking-source @@ -111,10 +111,10 @@ targets: bank-feeds-library: source: bank-feeds-source sourceNamespace: bank-feeds-source - sourceRevisionDigest: sha256:9133167d1473dc045331f1cfa81fb00aa3234e2b2b438f6808f576b259a76be8 - sourceBlobDigest: sha256:b5233f0bab180b8aae271a0d5ab149316931ec9e84a140e1c073a2025305eb7d + sourceRevisionDigest: sha256:9aaa05521af2d39743759c03b1f419f63c5d9726a66c9b9e448e95a9a53ccf2b + sourceBlobDigest: sha256:d8080d68edd35d878fad42ac6b343ac5c287f2cab63280c281a2adad5ddd117a codeSamplesNamespace: bank-feeds-source-python-code-samples - codeSamplesRevisionDigest: sha256:213db3e6e8d49d181aa23b48af0e4b8fc917552e39fb8ef2a69edab2eaa52e67 + codeSamplesRevisionDigest: sha256:44e2ed21312eba2cf9216de98b7101573e310f02fb8aa33f930d02296c84821f banking-library: source: banking-source sourceNamespace: banking-source diff --git a/bank-feeds/.speakeasy/gen.lock b/bank-feeds/.speakeasy/gen.lock index 44c2febd4..7098381c8 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: af010093774a298b2b6a17e641f9cd1b + docChecksum: 66b0b2a05ab126aac947c52e5cee36e3 docVersion: 3.0.0 - speakeasyVersion: 1.453.8 - generationVersion: 2.474.15 - releaseVersion: 9.0.1 - configChecksum: 8ec4388e5997c479ecac5ec505c82d48 + speakeasyVersion: 1.455.5 + generationVersion: 2.479.3 + releaseVersion: 10.0.0 + configChecksum: ff8ffd8b2ba28524f91955857db0c0a5 repoURL: https://github.com/codatio/client-sdk-python.git repoSubDirectory: bank-feeds installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=bank-feeds @@ -15,7 +15,7 @@ features: python: additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.6.11 + core: 5.7.2 decimal: 1.0.0 defaultEnabledRetries: 0.2.0 deprecations: 3.0.0 @@ -154,11 +154,15 @@ generatedFiles: - docs/models/shared/sourceaccount.md - docs/models/shared/sourceaccountbatchcreateresponse.md - docs/models/shared/sourceaccountbatcherrorresponse.md + - docs/models/shared/sourceaccountprototype.md - docs/models/shared/sourceaccountv2.md + - docs/models/shared/sourceaccountv2accounttype.md - docs/models/shared/sourceaccountv2batchcreateresponse.md + - docs/models/shared/sourceaccountv2prototype.md - docs/models/shared/sourceaccountv2status.md - docs/models/shared/sourceaccountwebhook.md - docs/models/shared/sourceaccountwebhookpayload.md + - docs/models/shared/sourceaccountwebhookpayloadsourceaccount.md - docs/models/shared/sourcetype.md - docs/models/shared/status.md - docs/models/shared/supplementaldata.md @@ -235,6 +239,7 @@ generatedFiles: - src/codat_bankfeeds/models/operations/update_source_account.py - src/codat_bankfeeds/models/shared/__init__.py - src/codat_bankfeeds/models/shared/accountinfo.py + - src/codat_bankfeeds/models/shared/accounttype.py - src/codat_bankfeeds/models/shared/bankaccountcreateresponse.py - src/codat_bankfeeds/models/shared/bankaccountcredentials.py - src/codat_bankfeeds/models/shared/bankaccountoption.py @@ -291,8 +296,10 @@ generatedFiles: - src/codat_bankfeeds/models/shared/sourceaccount.py - src/codat_bankfeeds/models/shared/sourceaccountbatchcreateresponse.py - src/codat_bankfeeds/models/shared/sourceaccountbatcherrorresponse.py + - src/codat_bankfeeds/models/shared/sourceaccountprototype.py - src/codat_bankfeeds/models/shared/sourceaccountv2.py - src/codat_bankfeeds/models/shared/sourceaccountv2batchcreateresponse.py + - src/codat_bankfeeds/models/shared/sourceaccountv2prototype.py - src/codat_bankfeeds/models/shared/sourceaccountwebhook.py - src/codat_bankfeeds/models/shared/sourceaccountwebhookpayload.py - src/codat_bankfeeds/models/shared/syncasbankfeeds.py @@ -411,6 +418,7 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"}], "totalResults": 1} @@ -422,6 +430,7 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "referenceSubsidiaryCompanies": []}], "totalResults": 1} @@ -432,6 +441,7 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}], "totalResults": 3} @@ -442,6 +452,7 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "400": application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} @@ -452,6 +463,7 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "400": application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} @@ -638,7 +650,7 @@ examples: connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: "200": - application/json: [{"sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": "99.99", "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"accountNumber": "789", "id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456"}, {"accountNumber": "99887766", "id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866"}, {"accountNumber": "123456789", "id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456"}]}] + application/json: [{"sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": 99.99, "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"accountNumber": "789", "id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456"}, {"accountNumber": "99887766", "id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866"}, {"accountNumber": "123456789", "id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456"}]}] get-company-information: Malformed query: parameters: @@ -655,10 +667,32 @@ examples: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" requestBody: - application/json: {"accountInfo": {"accountOpenDate": "2023-05-06T00:00:00Z", "availableBalance": 10, "description": "account description 1", "nickname": "account 123"}, "accountName": "account-081", "accountNumber": "12345670", "accountType": "checking", "balance": 99.99, "currency": "GBP", "feedStartDate": "2024-05-01T00:00:00Z", "id": "acc-001", "modifiedDate": "2024-08-02T00:00:00.000Z", "routingInfo": {"bankCode": "21001088", "type": "bankcode"}, "status": "pending"} + application/json: {"accountInfo": {"accountOpenDate": "2022-10-23"}, "currency": "GBP", "modifiedDate": "2022-10-23T00:00:00Z"} responses: "400": application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + Version 2: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"accountInfo": {"accountOpenDate": "2022-10-23"}, "currency": "USD", "modifiedDate": "2022-10-23T00:00:00Z"} + responses: + "200": + application/json: {"accountInfo": {"accountOpenDate": "2023-05-06T00:00:00Z", "availableBalance": 10, "description": "account description 1", "nickname": "account 123"}, "accountName": "account-081", "accountNumber": "12345670", "accountType": "checking", "balance": 99.99, "currency": "GBP", "feedStartDate": "2024-05-01T00:00:00Z", "id": "acc-001", "modifiedDate": "2024-08-02T00:00:00.000Z", "routingInfo": {"bankCode": "21001088", "type": "bankcode"}, "status": "pending"} + "400": {} + Version 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"accountName": "account-081", "accountNumber": "12345670", "accountType": "Credit", "balance": 99.99, "currency": "GBP", "id": "acc-002", "modifiedDate": "2023-01-09T14:14:14.1057478Z", "sortCode": "123456"} + responses: + "200": + application/json: {"accountName": "account-095", "accountNumber": "12345671", "accountType": "Credit", "balance": 0, "currency": "USD", "id": "acc-003", "modifiedDate": "2023-01-09T14:14:14.1057478Z", "sortCode": "123456", "status": "pending"} + "400": {} delete-source-account: Unauthorized: parameters: diff --git a/bank-feeds/.speakeasy/gen.yaml b/bank-feeds/.speakeasy/gen.yaml index 8f36c7dc3..8f9ba5a2b 100644 --- a/bank-feeds/.speakeasy/gen.yaml +++ b/bank-feeds/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: oAuth2PasswordEnabled: false telemetryEnabled: true python: - version: 9.0.1 + version: 10.0.0 additionalDependencies: dev: {} main: {} diff --git a/bank-feeds/README.md b/bank-feeds/README.md index 06ed5d380..2cccc377f 100755 --- a/bank-feeds/README.md +++ b/bank-feeds/README.md @@ -94,6 +94,7 @@ from codat_bankfeeds.models import shared from decimal import Decimal with CodatBankFeeds() as codat_bank_feeds: + codat_bank_feeds.bank_feeds_source_account_connected(request={ "event_type": "bankFeeds.sourceAccount.connected", "generated_date": "2022-10-23T00:00:00Z", @@ -136,6 +137,7 @@ from decimal import Decimal async def main(): async with CodatBankFeeds() as codat_bank_feeds: + await codat_bank_feeds.bank_feeds_source_account_connected_async(request={ "event_type": "bankFeeds.sourceAccount.connected", "generated_date": "2022-10-23T00:00:00Z", @@ -260,15 +262,17 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.source_accounts.generate_credentials(request={ "request_body": open("example.file", "rb"), "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -289,15 +293,17 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -313,14 +319,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -361,14 +369,16 @@ with CodatBankFeeds( ) as codat_bank_feeds: res = None try: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) except errors.ErrorMessage as e: # handle e.data: errors.ErrorMessageData @@ -397,14 +407,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -515,14 +527,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/RELEASES.md b/bank-feeds/RELEASES.md index e56d8865e..e4c8d6e93 100644 --- a/bank-feeds/RELEASES.md +++ b/bank-feeds/RELEASES.md @@ -828,4 +828,14 @@ Based on: ### Generated - [python v9.0.1] bank-feeds ### Releases -- [PyPI v9.0.1] https://pypi.org/project/codat-bankfeeds/9.0.1 - bank-feeds \ No newline at end of file +- [PyPI v9.0.1] https://pypi.org/project/codat-bankfeeds/9.0.1 - bank-feeds + +## 2024-12-16 15:57:30 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.455.5 (2.479.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v10.0.0] bank-feeds +### Releases +- [PyPI v10.0.0] https://pypi.org/project/codat-bankfeeds/10.0.0 - bank-feeds \ No newline at end of file diff --git a/bank-feeds/USAGE.md b/bank-feeds/USAGE.md index 1fdbb88cb..8c4d42220 100644 --- a/bank-feeds/USAGE.md +++ b/bank-feeds/USAGE.md @@ -9,14 +9,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ```
@@ -34,14 +36,16 @@ async def main(): auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = await codat_bank_feeds.companies.create_async(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) asyncio.run(main()) ``` diff --git a/bank-feeds/docs/models/operations/createsourceaccountrequestbody.md b/bank-feeds/docs/models/operations/createsourceaccountrequestbody.md index 9529b6957..12a62d529 100644 --- a/bank-feeds/docs/models/operations/createsourceaccountrequestbody.md +++ b/bank-feeds/docs/models/operations/createsourceaccountrequestbody.md @@ -3,15 +3,15 @@ ## Supported Types -### `shared.SourceAccountV2` +### `shared.SourceAccountV2Prototype` ```python -value: shared.SourceAccountV2 = /* values here */ +value: shared.SourceAccountV2Prototype = /* values here */ ``` -### `shared.SourceAccount` +### `shared.SourceAccountPrototype` ```python -value: shared.SourceAccount = /* values here */ +value: shared.SourceAccountPrototype = /* values here */ ``` diff --git a/bank-feeds/docs/models/operations/listcompaniesrequest.md b/bank-feeds/docs/models/operations/listcompaniesrequest.md index 9fc1a9c7e..25cc480a0 100644 --- a/bank-feeds/docs/models/operations/listcompaniesrequest.md +++ b/bank-feeds/docs/models/operations/listcompaniesrequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | -| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +| `tags` | *Optional[str]* | :heavy_minus_sign: | Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). | region=uk && team=invoice-finance | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/bankfeedmapping.md b/bank-feeds/docs/models/shared/bankfeedmapping.md index b3fbadba2..dad7258d2 100644 --- a/bank-feeds/docs/models/shared/bankfeedmapping.md +++ b/bank-feeds/docs/models/shared/bankfeedmapping.md @@ -11,7 +11,7 @@ A bank feed connection between a source account and a target account, including | `source_account_id` | *Optional[str]* | :heavy_minus_sign: | Unique ID for the source account. | | | `source_account_name` | *Optional[str]* | :heavy_minus_sign: | Name for the source account. | | | `source_account_number` | *Optional[str]* | :heavy_minus_sign: | Account number for the source account. | | -| `source_balance` | *Optional[str]* | :heavy_minus_sign: | Balance for the source account. | | +| `source_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Balance for the source account. | | | `source_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 | | `status` | *Optional[str]* | :heavy_minus_sign: | The status. | | | `target_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique ID for the target account in the accounting software. | | diff --git a/bank-feeds/docs/models/shared/sourceaccountprototype.md b/bank-feeds/docs/models/shared/sourceaccountprototype.md new file mode 100644 index 000000000..b9aabafd8 --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountprototype.md @@ -0,0 +1,15 @@ +# SourceAccountPrototype + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The bank account name. | | +| `account_number` | *OptionalNullable[str]* | :heavy_minus_sign: | The account number. | | +| `account_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of bank account e.g. Credit. | | +| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | The latest balance for 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 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique ID for the bank account. | | +| `modified_date` | *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 | +| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | The sort code. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountv2.md b/bank-feeds/docs/models/shared/sourceaccountv2.md index 32faef421..27e7da48d 100644 --- a/bank-feeds/docs/models/shared/sourceaccountv2.md +++ b/bank-feeds/docs/models/shared/sourceaccountv2.md @@ -9,7 +9,7 @@ The target bank account in a supported accounting software for ingestion into a | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `account_name` | *str* | :heavy_check_mark: | The bank account name. | | | `account_number` | *str* | :heavy_check_mark: | The account number. | | -| `account_type` | [shared.AccountType](../../models/shared/accounttype.md) | :heavy_check_mark: | The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. | | +| `account_type` | [shared.SourceAccountV2AccountType](../../models/shared/sourceaccountv2accounttype.md) | :heavy_check_mark: | The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. | | | `balance` | *Decimal* | :heavy_check_mark: | The latest balance for the bank account. | | | `currency` | *str* | :heavy_check_mark: | 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 | | `id` | *str* | :heavy_check_mark: | Unique ID for the bank account. | | @@ -17,4 +17,5 @@ The target bank account in a supported accounting software for ingestion into a | `feed_start_date` | *OptionalNullable[str]* | :heavy_minus_sign: | In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example:
```
2020-10-08
``` | 2022-10-23 | | `modified_date` | *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 | | `routing_info` | [Optional[shared.RoutingInfo]](../../models/shared/routinginfo.md) | :heavy_minus_sign: | Routing information for the bank. This does not include account number. | | +| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | The sort code. | | | `status` | [OptionalNullable[shared.SourceAccountV2Status]](../../models/shared/sourceaccountv2status.md) | :heavy_minus_sign: | Status of the source account. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountv2accounttype.md b/bank-feeds/docs/models/shared/sourceaccountv2accounttype.md new file mode 100644 index 000000000..a8207471b --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountv2accounttype.md @@ -0,0 +1,14 @@ +# SourceAccountV2AccountType + +The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `CHECKING` | checking | +| `SAVINGS` | savings | +| `LOAN` | loan | +| `CREDIT_CARD` | creditCard | +| `PREPAID_CARD` | prepaidCard | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountv2prototype.md b/bank-feeds/docs/models/shared/sourceaccountv2prototype.md new file mode 100644 index 000000000..f2178f016 --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountv2prototype.md @@ -0,0 +1,17 @@ +# SourceAccountV2Prototype + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_info` | [OptionalNullable[shared.AccountInfo]](../../models/shared/accountinfo.md) | :heavy_minus_sign: | N/A | | +| `account_name` | *Optional[str]* | :heavy_minus_sign: | The bank account name. | | +| `account_number` | *Optional[str]* | :heavy_minus_sign: | The account number. | | +| `account_type` | [Optional[shared.AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. | | +| `balance` | *Optional[Decimal]* | :heavy_minus_sign: | The latest balance for 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 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique ID for the bank account. | | +| `modified_date` | *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 | +| `routing_info` | [Optional[shared.RoutingInfo]](../../models/shared/routinginfo.md) | :heavy_minus_sign: | Routing information for the bank. This does not include account number. | | +| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | The sort code. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountwebhookpayload.md b/bank-feeds/docs/models/shared/sourceaccountwebhookpayload.md index 73bc9923d..5691e75d8 100644 --- a/bank-feeds/docs/models/shared/sourceaccountwebhookpayload.md +++ b/bank-feeds/docs/models/shared/sourceaccountwebhookpayload.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `reference_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `source_account` | [Optional[shared.SourceAccount]](../../models/shared/sourceaccount.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `reference_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | +| `source_account` | [Optional[shared.SourceAccountWebhookPayloadSourceAccount]](../../models/shared/sourceaccountwebhookpayloadsourceaccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountwebhookpayloadsourceaccount.md b/bank-feeds/docs/models/shared/sourceaccountwebhookpayloadsourceaccount.md new file mode 100644 index 000000000..b4de039c1 --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountwebhookpayloadsourceaccount.md @@ -0,0 +1,17 @@ +# SourceAccountWebhookPayloadSourceAccount + + +## Supported Types + +### `shared.SourceAccountV2` + +```python +value: shared.SourceAccountV2 = /* values here */ +``` + +### `shared.SourceAccount` + +```python +value: shared.SourceAccount = /* values here */ +``` + diff --git a/bank-feeds/docs/sdks/accountmapping/README.md b/bank-feeds/docs/sdks/accountmapping/README.md index 5f1893ac9..885afb385 100644 --- a/bank-feeds/docs/sdks/accountmapping/README.md +++ b/bank-feeds/docs/sdks/accountmapping/README.md @@ -54,6 +54,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.account_mapping.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -63,9 +64,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -108,14 +110,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.account_mapping.get(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/bankaccounts/README.md b/bank-feeds/docs/sdks/bankaccounts/README.md index 9719a7729..00648a8ae 100644 --- a/bank-feeds/docs/sdks/bankaccounts/README.md +++ b/bank-feeds/docs/sdks/bankaccounts/README.md @@ -32,6 +32,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.bank_accounts.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -41,9 +42,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -87,14 +89,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.bank_accounts.get_create_model(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -136,6 +140,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.bank_accounts.list(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -145,9 +150,10 @@ with CodatBankFeeds( "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/companies/README.md b/bank-feeds/docs/sdks/companies/README.md index f1ded0d3e..2d41e7ddc 100644 --- a/bank-feeds/docs/sdks/companies/README.md +++ b/bank-feeds/docs/sdks/companies/README.md @@ -34,14 +34,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.create(request={ "name": "Technicalium", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -82,6 +84,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + codat_bank_feeds.companies.delete(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) @@ -123,13 +126,15 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.get(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -167,13 +172,15 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.get_access_token(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -202,6 +209,19 @@ with CodatBankFeeds( A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` + ### Example Usage ```python @@ -213,16 +233,19 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.list(request={ "order_by": "-modifiedDate", "page": 1, "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -262,6 +285,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.companies.update(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "company_request_body": { @@ -270,9 +294,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/companyinformation/README.md b/bank-feeds/docs/sdks/companyinformation/README.md index 126a2a840..de0ebae87 100644 --- a/bank-feeds/docs/sdks/companyinformation/README.md +++ b/bank-feeds/docs/sdks/companyinformation/README.md @@ -26,14 +26,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.company_information.get(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/configuration/README.md b/bank-feeds/docs/sdks/configuration/README.md index d260185db..06162c889 100644 --- a/bank-feeds/docs/sdks/configuration/README.md +++ b/bank-feeds/docs/sdks/configuration/README.md @@ -25,13 +25,15 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.configuration.get(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -68,6 +70,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.configuration.set(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "configuration": { @@ -75,9 +78,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/connections/README.md b/bank-feeds/docs/sdks/connections/README.md index f7132f101..52dec4f25 100644 --- a/bank-feeds/docs/sdks/connections/README.md +++ b/bank-feeds/docs/sdks/connections/README.md @@ -30,6 +30,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.connections.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "request_body": { @@ -37,9 +38,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -77,6 +79,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + codat_bank_feeds.connections.delete(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -115,14 +118,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.connections.get(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -159,6 +164,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.connections.list(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "order_by": "-modifiedDate", @@ -167,9 +173,10 @@ with CodatBankFeeds( "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -206,6 +213,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.connections.unlink(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -214,9 +222,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/sourceaccounts/README.md b/bank-feeds/docs/sdks/sourceaccounts/README.md index 26a6479f5..6dd34aff8 100644 --- a/bank-feeds/docs/sdks/sourceaccounts/README.md +++ b/bank-feeds/docs/sdks/sourceaccounts/README.md @@ -27,42 +27,29 @@ The _Create Source Account_ endpoint allows you to create a representation of a ```python from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -from decimal import Decimal with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.source_accounts.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "request_body": { - "account_name": "account-081", - "account_number": "12345670", - "account_type": shared.AccountType.CHECKING, - "balance": Decimal("99.99"), - "currency": "GBP", - "id": "acc-001", "account_info": { - "account_open_date": "2023-05-06T00:00:00Z", - "available_balance": Decimal("10"), - "description": "account description 1", - "nickname": "account 123", + "account_open_date": "2022-10-23", }, - "feed_start_date": "2024-05-01T00:00:00Z", - "modified_date": "2024-08-02T00:00:00.000Z", - "routing_info": { - "bank_code": "21001088", - "type": shared.Type.BANKCODE, - }, - "status": shared.SourceAccountV2Status.PENDING, + "currency": "USD", + "modified_date": "2022-10-23T00:00:00Z", }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -103,6 +90,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.source_accounts.create_batch(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -132,9 +120,10 @@ with CodatBankFeeds( ], }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -174,6 +163,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + codat_bank_feeds.source_accounts.delete(request={ "account_id": "7110701885", "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", @@ -215,6 +205,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + codat_bank_feeds.source_accounts.delete_credentials(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -259,15 +250,17 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.source_accounts.generate_credentials(request={ "request_body": open("example.file", "rb"), "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -309,14 +302,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.source_accounts.list(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -359,6 +354,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.source_accounts.update(request={ "account_id": "7110701885", "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", @@ -377,9 +373,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/sync/README.md b/bank-feeds/docs/sdks/sync/README.md index fc2a827ff..40f109f1e 100644 --- a/bank-feeds/docs/sdks/sync/README.md +++ b/bank-feeds/docs/sdks/sync/README.md @@ -24,13 +24,15 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.sync.get_last_successful_sync(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/docs/sdks/transactions/README.md b/bank-feeds/docs/sdks/transactions/README.md index dcc09f576..4465b9245 100644 --- a/bank-feeds/docs/sdks/transactions/README.md +++ b/bank-feeds/docs/sdks/transactions/README.md @@ -35,6 +35,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.transactions.create(request={ "account_id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", @@ -79,9 +80,10 @@ with CodatBankFeeds( }, }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -124,15 +126,17 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.transactions.get_create_model(request={ "account_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -173,14 +177,16 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.transactions.get_create_operation(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "push_operation_key": "1fb73c31-a851-46c2-ab8a-5ce6e25b57b8", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -221,6 +227,7 @@ with CodatBankFeeds( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_bank_feeds: + res = codat_bank_feeds.transactions.list_create_operations(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "order_by": "-modifiedDate", @@ -229,9 +236,10 @@ with CodatBankFeeds( "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }) - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` diff --git a/bank-feeds/pyproject.toml b/bank-feeds/pyproject.toml index 04d56a0e5..8085f0302 100644 --- a/bank-feeds/pyproject.toml +++ b/bank-feeds/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "codat-bankfeeds" -version = "9.0.1" +version = "10.0.0" description = "Set up bank feeds from accounts in your application to supported accounting software." authors = ["Speakeasy",] readme = "README-PYPI.md" diff --git a/bank-feeds/src/codat_bankfeeds/_version.py b/bank-feeds/src/codat_bankfeeds/_version.py index ebed3c86a..027131b2b 100644 --- a/bank-feeds/src/codat_bankfeeds/_version.py +++ b/bank-feeds/src/codat_bankfeeds/_version.py @@ -3,7 +3,7 @@ import importlib.metadata __title__: str = "codat-bankfeeds" -__version__: str = "9.0.1" +__version__: str = "10.0.0" try: if __package__ is not None: diff --git a/bank-feeds/src/codat_bankfeeds/account_mapping.py b/bank-feeds/src/codat_bankfeeds/account_mapping.py index 1277557c9..50e56ca80 100644 --- a/bank-feeds/src/codat_bankfeeds/account_mapping.py +++ b/bank-feeds/src/codat_bankfeeds/account_mapping.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, List, Optional, Union, cast +from typing import Any, List, Mapping, Optional, Union, cast class AccountMapping(BaseSDK): @@ -21,6 +21,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankFeedAccountMappingResponse]: r"""Create bank feed account mapping @@ -59,6 +60,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -85,6 +87,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.bank_feed_account_mapping, @@ -167,6 +170,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankFeedAccountMappingResponse]: r"""Create bank feed account mapping @@ -205,6 +209,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -231,6 +236,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.bank_feed_account_mapping, @@ -313,6 +319,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[List[shared.BankFeedMapping]]: r"""List bank feed accounts @@ -328,6 +335,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -352,6 +360,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -426,6 +435,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[List[shared.BankFeedMapping]]: r"""List bank feed accounts @@ -441,6 +451,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -465,6 +476,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) diff --git a/bank-feeds/src/codat_bankfeeds/bank_accounts.py b/bank-feeds/src/codat_bankfeeds/bank_accounts.py index d2952bc60..86a9c19b9 100644 --- a/bank-feeds/src/codat_bankfeeds/bank_accounts.py +++ b/bank-feeds/src/codat_bankfeeds/bank_accounts.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class BankAccounts(BaseSDK): @@ -21,6 +21,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankAccountCreateResponse]: r"""Create bank account @@ -36,6 +37,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -60,6 +62,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.bank_account_prototype, @@ -142,6 +145,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankAccountCreateResponse]: r"""Create bank account @@ -157,6 +161,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -181,6 +186,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.bank_account_prototype, @@ -263,6 +269,7 @@ def get_create_model( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOption]: r"""Get create/update bank account model @@ -279,6 +286,7 @@ def get_create_model( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -305,6 +313,7 @@ def get_create_model( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -377,6 +386,7 @@ async def get_create_model_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOption]: r"""Get create/update bank account model @@ -393,6 +403,7 @@ async def get_create_model_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -419,6 +430,7 @@ async def get_create_model_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -491,6 +503,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankAccounts]: r"""List bank accounts @@ -505,6 +518,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -529,6 +543,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -603,6 +618,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankAccounts]: r"""List bank accounts @@ -617,6 +633,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +658,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) diff --git a/bank-feeds/src/codat_bankfeeds/basesdk.py b/bank-feeds/src/codat_bankfeeds/basesdk.py index 3265615fa..942e525a4 100644 --- a/bank-feeds/src/codat_bankfeeds/basesdk.py +++ b/bank-feeds/src/codat_bankfeeds/basesdk.py @@ -10,7 +10,7 @@ from codat_bankfeeds.models import errors from codat_bankfeeds.utils import RetryConfig, SerializedRequestBody, get_body_content import httpx -from typing import Callable, List, Optional, Tuple +from typing import Callable, List, Mapping, Optional, Tuple from urllib.parse import parse_qs, urlparse @@ -50,6 +50,7 @@ def build_request_async( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: client = self.sdk_configuration.async_client return self.build_request_with_client( @@ -69,6 +70,7 @@ def build_request_async( timeout_ms, get_serialized_body, url_override, + http_headers, ) def build_request( @@ -90,6 +92,7 @@ def build_request( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: client = self.sdk_configuration.client return self.build_request_with_client( @@ -109,6 +112,7 @@ def build_request( timeout_ms, get_serialized_body, url_override, + http_headers, ) def build_request_with_client( @@ -131,6 +135,7 @@ def build_request_with_client( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: query_params = {} @@ -186,6 +191,10 @@ def build_request_with_client( ): headers["content-type"] = serialized_request_body.media_type + if http_headers is not None: + for header, value in http_headers.items(): + headers[header] = value + timeout = timeout_ms / 1000 if timeout_ms is not None else None return client.build_request( diff --git a/bank-feeds/src/codat_bankfeeds/companies.py b/bank-feeds/src/codat_bankfeeds/companies.py index 768f69163..bea25c0b7 100644 --- a/bank-feeds/src/codat_bankfeeds/companies.py +++ b/bank-feeds/src/codat_bankfeeds/companies.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class Companies(BaseSDK): @@ -20,6 +20,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Company]: r"""Create company @@ -34,6 +35,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -58,6 +60,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, True, "json", Optional[shared.CompanyRequestBody] @@ -132,6 +135,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Company]: r"""Create company @@ -146,6 +150,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -170,6 +175,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, True, "json", Optional[shared.CompanyRequestBody] @@ -244,6 +250,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete a company @@ -257,6 +264,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -281,6 +289,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -352,6 +361,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete a company @@ -365,6 +375,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -389,6 +400,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -460,6 +472,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Company]: r"""Get company @@ -473,6 +486,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -497,6 +511,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -568,6 +583,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Company]: r"""Get company @@ -581,6 +597,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -605,6 +622,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -677,6 +695,7 @@ def get_access_token( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CompanyAccessToken]: r"""Get company access token @@ -687,6 +706,7 @@ def get_access_token( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -711,6 +731,7 @@ def get_access_token( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -785,6 +806,7 @@ async def get_access_token_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CompanyAccessToken]: r"""Get company access token @@ -795,6 +817,7 @@ async def get_access_token_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -819,6 +842,7 @@ async def get_access_token_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -892,6 +916,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Companies]: r"""List companies @@ -900,10 +925,24 @@ def list( A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + ## Filter by tags + + The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + + - equals (`=`) + - not equals (`!=`) + - contains (`~`) + + For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: + - Foreign key: `uid = {yourCustomerId}` + - Region: `region != uk` + - Owning team and region: `region = uk && owningTeam = invoice-finance` + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -928,6 +967,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1000,6 +1040,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Companies]: r"""List companies @@ -1008,10 +1049,24 @@ async def list_async( A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + ## Filter by tags + + The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + + - equals (`=`) + - not equals (`!=`) + - contains (`~`) + + For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: + - Foreign key: `uid = {yourCustomerId}` + - Region: `region != uk` + - Owning team and region: `region = uk && owningTeam = invoice-finance` + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1036,6 +1091,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1108,6 +1164,7 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Company]: r"""Update company @@ -1120,6 +1177,7 @@ def update( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1144,6 +1202,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.company_request_body, @@ -1222,6 +1281,7 @@ async def update_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Company]: r"""Update company @@ -1234,6 +1294,7 @@ async def update_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1258,6 +1319,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.company_request_body, diff --git a/bank-feeds/src/codat_bankfeeds/company_information.py b/bank-feeds/src/codat_bankfeeds/company_information.py index e3aad34e4..836553150 100644 --- a/bank-feeds/src/codat_bankfeeds/company_information.py +++ b/bank-feeds/src/codat_bankfeeds/company_information.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class CompanyInformation(BaseSDK): @@ -21,6 +21,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CompanyInformation]: r"""Get company information @@ -32,6 +33,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -56,6 +58,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -131,6 +134,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CompanyInformation]: r"""Get company information @@ -142,6 +146,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -166,6 +171,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) diff --git a/bank-feeds/src/codat_bankfeeds/configuration.py b/bank-feeds/src/codat_bankfeeds/configuration.py index 6b68cf095..cf9f2aa77 100644 --- a/bank-feeds/src/codat_bankfeeds/configuration.py +++ b/bank-feeds/src/codat_bankfeeds/configuration.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class Configuration(BaseSDK): @@ -21,6 +21,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Configuration]: r"""Get configuration @@ -30,6 +31,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -54,6 +56,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -126,6 +129,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Configuration]: r"""Get configuration @@ -135,6 +139,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -159,6 +164,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -231,6 +237,7 @@ def set( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Configuration]: r"""Set configuration @@ -240,6 +247,7 @@ def set( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -264,6 +272,7 @@ def set( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.configuration, @@ -343,6 +352,7 @@ async def set_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Configuration]: r"""Set configuration @@ -352,6 +362,7 @@ async def set_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -376,6 +387,7 @@ async def set_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.configuration, diff --git a/bank-feeds/src/codat_bankfeeds/connections.py b/bank-feeds/src/codat_bankfeeds/connections.py index dd4e94970..0963890ba 100644 --- a/bank-feeds/src/codat_bankfeeds/connections.py +++ b/bank-feeds/src/codat_bankfeeds/connections.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class Connections(BaseSDK): @@ -21,6 +21,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connection]: r"""Create connection @@ -32,6 +33,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -56,6 +58,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -135,6 +138,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connection]: r"""Create connection @@ -146,6 +150,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -170,6 +175,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -249,6 +255,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete connection @@ -259,6 +266,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -283,6 +291,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -355,6 +364,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete connection @@ -365,6 +375,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -389,6 +400,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -460,6 +472,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connection]: r"""Get connection @@ -469,6 +482,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -493,6 +507,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -564,6 +579,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connection]: r"""Get connection @@ -573,6 +589,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -597,6 +614,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -669,6 +687,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connections]: r"""List connections @@ -678,6 +697,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -702,6 +722,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -775,6 +796,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connections]: r"""List connections @@ -784,6 +806,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -808,6 +831,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -881,6 +905,7 @@ def unlink( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connection]: r"""Unlink connection @@ -890,6 +915,7 @@ def unlink( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -914,6 +940,7 @@ def unlink( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -993,6 +1020,7 @@ async def unlink_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.Connection]: r"""Unlink connection @@ -1002,6 +1030,7 @@ async def unlink_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1026,6 +1055,7 @@ async def unlink_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py b/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py index 66a47be93..4da7c4191 100644 --- a/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py +++ b/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py @@ -3,7 +3,9 @@ from __future__ import annotations from codat_bankfeeds.models.shared import ( sourceaccount as shared_sourceaccount, + sourceaccountprototype as shared_sourceaccountprototype, sourceaccountv2 as shared_sourceaccountv2, + sourceaccountv2prototype as shared_sourceaccountv2prototype, ) from codat_bankfeeds.types import BaseModel from codat_bankfeeds.utils import FieldMetadata, PathParamMetadata, RequestMetadata @@ -15,15 +17,18 @@ CreateSourceAccountRequestBodyTypedDict = TypeAliasType( "CreateSourceAccountRequestBodyTypedDict", Union[ - shared_sourceaccount.SourceAccountTypedDict, - shared_sourceaccountv2.SourceAccountV2TypedDict, + shared_sourceaccountprototype.SourceAccountPrototypeTypedDict, + shared_sourceaccountv2prototype.SourceAccountV2PrototypeTypedDict, ], ) CreateSourceAccountRequestBody = TypeAliasType( "CreateSourceAccountRequestBody", - Union[shared_sourceaccount.SourceAccount, shared_sourceaccountv2.SourceAccountV2], + Union[ + shared_sourceaccountprototype.SourceAccountPrototype, + shared_sourceaccountv2prototype.SourceAccountV2Prototype, + ], ) diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/list_companies.py b/bank-feeds/src/codat_bankfeeds/models/operations/list_companies.py index e6a9e8a0b..b164e4afa 100644 --- a/bank-feeds/src/codat_bankfeeds/models/operations/list_companies.py +++ b/bank-feeds/src/codat_bankfeeds/models/operations/list_companies.py @@ -17,6 +17,8 @@ class ListCompaniesRequestTypedDict(TypedDict): r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: NotRequired[str] r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + tags: NotRequired[str] + r"""Filter companies by tags using the \"equals\" (=), \"not equals\" (!=), and \"contains\" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying).""" class ListCompaniesRequest(BaseModel): @@ -45,3 +47,9 @@ class ListCompaniesRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + tags: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter companies by tags using the \"equals\" (=), \"not equals\" (!=), and \"contains\" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying).""" diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py b/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py index 4d7ea6d52..f61b3e7cb 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .accountinfo import AccountInfo, AccountInfoTypedDict +from .accounttype import AccountType from .bankaccountcreateresponse import ( AccountingBankAccount, AccountingBankAccountTypedDict, @@ -138,9 +139,13 @@ SourceAccountBatchErrorResponse, SourceAccountBatchErrorResponseTypedDict, ) +from .sourceaccountprototype import ( + SourceAccountPrototype, + SourceAccountPrototypeTypedDict, +) from .sourceaccountv2 import ( - AccountType, SourceAccountV2, + SourceAccountV2AccountType, SourceAccountV2Status, SourceAccountV2TypedDict, ) @@ -148,9 +153,15 @@ SourceAccountV2BatchCreateResponse, SourceAccountV2BatchCreateResponseTypedDict, ) +from .sourceaccountv2prototype import ( + SourceAccountV2Prototype, + SourceAccountV2PrototypeTypedDict, +) from .sourceaccountwebhook import SourceAccountWebhook, SourceAccountWebhookTypedDict from .sourceaccountwebhookpayload import ( SourceAccountWebhookPayload, + SourceAccountWebhookPayloadSourceAccount, + SourceAccountWebhookPayloadSourceAccountTypedDict, SourceAccountWebhookPayloadTypedDict, ) from .syncasbankfeeds import SyncAsBankFeeds, SyncAsBankFeedsTypedDict @@ -288,14 +299,21 @@ "SourceAccountBatchCreateResponseTypedDict", "SourceAccountBatchErrorResponse", "SourceAccountBatchErrorResponseTypedDict", + "SourceAccountPrototype", + "SourceAccountPrototypeTypedDict", "SourceAccountTypedDict", "SourceAccountV2", + "SourceAccountV2AccountType", "SourceAccountV2BatchCreateResponse", "SourceAccountV2BatchCreateResponseTypedDict", + "SourceAccountV2Prototype", + "SourceAccountV2PrototypeTypedDict", "SourceAccountV2Status", "SourceAccountV2TypedDict", "SourceAccountWebhook", "SourceAccountWebhookPayload", + "SourceAccountWebhookPayloadSourceAccount", + "SourceAccountWebhookPayloadSourceAccountTypedDict", "SourceAccountWebhookPayloadTypedDict", "SourceAccountWebhookTypedDict", "SourceType", diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/accounttype.py b/bank-feeds/src/codat_bankfeeds/models/shared/accounttype.py new file mode 100644 index 000000000..a2db0ccb0 --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/accounttype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountType(str, Enum): + r"""The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard.""" + + CHECKING = "checking" + SAVINGS = "savings" + LOAN = "loan" + CREDIT_CARD = "creditCard" + PREPAID_CARD = "prepaidCard" diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/bankfeedmapping.py b/bank-feeds/src/codat_bankfeeds/models/shared/bankfeedmapping.py index 9de4364a9..ab508a270 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/bankfeedmapping.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/bankfeedmapping.py @@ -9,8 +9,12 @@ UNSET, UNSET_SENTINEL, ) +from codat_bankfeeds.utils import serialize_decimal, validate_decimal +from decimal import Decimal import pydantic from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -45,7 +49,7 @@ class BankFeedMappingTypedDict(TypedDict): r"""Name for the source account.""" source_account_number: NotRequired[str] r"""Account number for the source account.""" - source_balance: NotRequired[str] + source_balance: NotRequired[Decimal] r"""Balance for the source account.""" source_currency: NotRequired[str] r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. @@ -108,9 +112,14 @@ class BankFeedMapping(BaseModel): ] = None r"""Account number for the source account.""" - source_balance: Annotated[Optional[str], pydantic.Field(alias="sourceBalance")] = ( - None - ) + source_balance: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="sourceBalance"), + ] = None r"""Balance for the source account.""" source_currency: Annotated[ diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountprototype.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountprototype.py new file mode 100644 index 000000000..0713adaac --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountprototype.py @@ -0,0 +1,172 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_bankfeeds.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_bankfeeds.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SourceAccountPrototypeTypedDict(TypedDict): + account_name: NotRequired[Nullable[str]] + r"""The bank account name.""" + account_number: NotRequired[Nullable[str]] + r"""The account number.""" + account_type: NotRequired[Nullable[str]] + r"""The type of bank account e.g. Credit.""" + balance: NotRequired[Nullable[Decimal]] + r"""The latest balance for the bank account.""" + currency: NotRequired[str] + 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. + """ + id: NotRequired[str] + r"""Unique ID for the bank account.""" + modified_date: NotRequired[str] + 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. + """ + sort_code: NotRequired[Nullable[str]] + r"""The sort code.""" + + +class SourceAccountPrototype(BaseModel): + account_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountName") + ] = UNSET + r"""The bank account name.""" + + account_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountNumber") + ] = UNSET + r"""The account number.""" + + account_type: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountType") + ] = UNSET + r"""The type of bank account e.g. Credit.""" + + balance: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""The latest balance for the bank account.""" + + currency: Optional[str] = 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. + """ + + id: Optional[str] = None + r"""Unique ID for the bank account.""" + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = 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. + """ + + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""The sort code.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountName", + "accountNumber", + "accountType", + "balance", + "currency", + "id", + "modifiedDate", + "sortCode", + ] + nullable_fields = [ + "accountName", + "accountNumber", + "accountType", + "balance", + "sortCode", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2.py index 99ee98016..561687032 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2.py @@ -21,7 +21,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict -class AccountType(str, Enum): +class SourceAccountV2AccountType(str, Enum): r"""The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard.""" CHECKING = "checking" @@ -48,7 +48,7 @@ class SourceAccountV2TypedDict(TypedDict): r"""The bank account name.""" account_number: str r"""The account number.""" - account_type: AccountType + account_type: SourceAccountV2AccountType r"""The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard.""" balance: Decimal r"""The latest balance for the bank account.""" @@ -93,6 +93,8 @@ class SourceAccountV2TypedDict(TypedDict): """ routing_info: NotRequired[RoutingInfoTypedDict] r"""Routing information for the bank. This does not include account number.""" + sort_code: NotRequired[Nullable[str]] + r"""The sort code.""" status: NotRequired[Nullable[SourceAccountV2Status]] r"""Status of the source account.""" @@ -106,7 +108,9 @@ class SourceAccountV2(BaseModel): account_number: Annotated[str, pydantic.Field(alias="accountNumber")] r"""The account number.""" - account_type: Annotated[AccountType, pydantic.Field(alias="accountType")] + account_type: Annotated[ + SourceAccountV2AccountType, pydantic.Field(alias="accountType") + ] r"""The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard.""" balance: Annotated[ @@ -169,6 +173,11 @@ class SourceAccountV2(BaseModel): ] = None r"""Routing information for the bank. This does not include account number.""" + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""The sort code.""" + status: OptionalNullable[SourceAccountV2Status] = UNSET r"""Status of the source account.""" @@ -179,9 +188,10 @@ def serialize_model(self, handler): "feedStartDate", "modifiedDate", "routingInfo", + "sortCode", "status", ] - nullable_fields = ["accountInfo", "feedStartDate", "status"] + nullable_fields = ["accountInfo", "feedStartDate", "sortCode", "status"] null_default_fields = [] serialized = handler(self) diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2prototype.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2prototype.py new file mode 100644 index 000000000..be0bcdddd --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2prototype.py @@ -0,0 +1,181 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountinfo import AccountInfo, AccountInfoTypedDict +from .accounttype import AccountType +from .routinginfo import RoutingInfo, RoutingInfoTypedDict +from codat_bankfeeds.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_bankfeeds.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SourceAccountV2PrototypeTypedDict(TypedDict): + account_info: NotRequired[Nullable[AccountInfoTypedDict]] + account_name: NotRequired[str] + r"""The bank account name.""" + account_number: NotRequired[str] + r"""The account number.""" + account_type: NotRequired[AccountType] + r"""The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard.""" + balance: NotRequired[Decimal] + r"""The latest balance for the bank account.""" + currency: NotRequired[str] + 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. + """ + id: NotRequired[str] + r"""Unique ID for the bank account.""" + modified_date: NotRequired[str] + 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. + """ + routing_info: NotRequired[RoutingInfoTypedDict] + r"""Routing information for the bank. This does not include account number.""" + sort_code: NotRequired[Nullable[str]] + r"""The sort code.""" + + +class SourceAccountV2Prototype(BaseModel): + account_info: Annotated[ + OptionalNullable[AccountInfo], pydantic.Field(alias="accountInfo") + ] = UNSET + + account_name: Annotated[Optional[str], pydantic.Field(alias="accountName")] = None + r"""The bank account name.""" + + account_number: Annotated[Optional[str], pydantic.Field(alias="accountNumber")] = ( + None + ) + r"""The account number.""" + + account_type: Annotated[ + Optional[AccountType], pydantic.Field(alias="accountType") + ] = None + r"""The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard.""" + + balance: Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = None + r"""The latest balance for the bank account.""" + + currency: Optional[str] = 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. + """ + + id: Optional[str] = None + r"""Unique ID for the bank account.""" + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = 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. + """ + + routing_info: Annotated[ + Optional[RoutingInfo], pydantic.Field(alias="routingInfo") + ] = None + r"""Routing information for the bank. This does not include account number.""" + + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""The sort code.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountInfo", + "accountName", + "accountNumber", + "accountType", + "balance", + "currency", + "id", + "modifiedDate", + "routingInfo", + "sortCode", + ] + nullable_fields = ["accountInfo", "sortCode"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountwebhookpayload.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountwebhookpayload.py index 98d875cfe..00e630c60 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountwebhookpayload.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountwebhookpayload.py @@ -3,10 +3,22 @@ from __future__ import annotations from .companyreference import CompanyReference, CompanyReferenceTypedDict from .sourceaccount import SourceAccount, SourceAccountTypedDict +from .sourceaccountv2 import SourceAccountV2, SourceAccountV2TypedDict from codat_bankfeeds.types import BaseModel import pydantic -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict +from typing import Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +SourceAccountWebhookPayloadSourceAccountTypedDict = TypeAliasType( + "SourceAccountWebhookPayloadSourceAccountTypedDict", + Union[SourceAccountTypedDict, SourceAccountV2TypedDict], +) + + +SourceAccountWebhookPayloadSourceAccount = TypeAliasType( + "SourceAccountWebhookPayloadSourceAccount", Union[SourceAccount, SourceAccountV2] +) class SourceAccountWebhookPayloadTypedDict(TypedDict): @@ -15,8 +27,7 @@ class SourceAccountWebhookPayloadTypedDict(TypedDict): connection_id: NotRequired[str] r"""Unique identifier for a company's data connection.""" reference_company: NotRequired[CompanyReferenceTypedDict] - source_account: NotRequired[SourceAccountTypedDict] - r"""The target bank account in a supported accounting software for ingestion into a bank feed.""" + source_account: NotRequired[SourceAccountWebhookPayloadSourceAccountTypedDict] class SourceAccountWebhookPayload(BaseModel): @@ -31,6 +42,6 @@ class SourceAccountWebhookPayload(BaseModel): ] = None source_account: Annotated[ - Optional[SourceAccount], pydantic.Field(alias="sourceAccount") + Optional[SourceAccountWebhookPayloadSourceAccount], + pydantic.Field(alias="sourceAccount"), ] = None - r"""The target bank account in a supported accounting software for ingestion into a bank feed.""" diff --git a/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py b/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py index 5ead8e097..372e6daab 100644 --- a/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py +++ b/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py @@ -27,9 +27,9 @@ class SDKConfiguration: server_idx: Optional[int] = 0 language: str = "python" openapi_doc_version: str = "3.0.0" - sdk_version: str = "9.0.1" - gen_version: str = "2.474.15" - user_agent: str = "speakeasy-sdk/python 9.0.1 2.474.15 3.0.0 codat-bankfeeds" + sdk_version: str = "10.0.0" + gen_version: str = "2.479.3" + user_agent: str = "speakeasy-sdk/python 10.0.0 2.479.3 3.0.0 codat-bankfeeds" retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None diff --git a/bank-feeds/src/codat_bankfeeds/source_accounts.py b/bank-feeds/src/codat_bankfeeds/source_accounts.py index 19555399f..f96d4f0ef 100644 --- a/bank-feeds/src/codat_bankfeeds/source_accounts.py +++ b/bank-feeds/src/codat_bankfeeds/source_accounts.py @@ -6,7 +6,7 @@ from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET import io -from typing import Any, IO, Optional, Union, cast +from typing import Any, IO, Mapping, Optional, Union, cast class SourceAccounts(BaseSDK): @@ -22,6 +22,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[operations.CreateSourceAccountResponseBody]: r"""Create single source account @@ -34,6 +35,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -58,6 +60,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -140,6 +143,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[operations.CreateSourceAccountResponseBody]: r"""Create single source account @@ -152,6 +156,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -176,6 +181,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -258,6 +264,7 @@ def create_batch( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[operations.CreateBatchSourceAccountResponse]: r"""Create source accounts @@ -270,6 +277,7 @@ def create_batch( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -296,6 +304,7 @@ def create_batch( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -384,6 +393,7 @@ async def create_batch_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[operations.CreateBatchSourceAccountResponse]: r"""Create source accounts @@ -396,6 +406,7 @@ async def create_batch_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -422,6 +433,7 @@ async def create_batch_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -510,6 +522,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete source account @@ -522,6 +535,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -546,6 +560,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -618,6 +633,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete source account @@ -630,6 +646,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -654,6 +671,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -726,6 +744,7 @@ def delete_credentials( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete all source account credentials @@ -737,6 +756,7 @@ def delete_credentials( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -763,6 +783,7 @@ def delete_credentials( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -835,6 +856,7 @@ async def delete_credentials_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ): r"""Delete all source account credentials @@ -846,6 +868,7 @@ async def delete_credentials_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -872,6 +895,7 @@ async def delete_credentials_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -944,6 +968,7 @@ def generate_credentials( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankAccountCredentials]: r"""Generate source account credentials @@ -959,6 +984,7 @@ def generate_credentials( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -983,6 +1009,7 @@ def generate_credentials( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -1064,6 +1091,7 @@ async def generate_credentials_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.BankAccountCredentials]: r"""Generate source account credentials @@ -1079,6 +1107,7 @@ async def generate_credentials_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1103,6 +1132,7 @@ async def generate_credentials_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -1184,6 +1214,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[operations.ListSourceAccountsResponseBody]: r"""List source accounts @@ -1198,6 +1229,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1222,6 +1254,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1296,6 +1329,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[operations.ListSourceAccountsResponseBody]: r"""List source accounts @@ -1310,6 +1344,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1334,6 +1369,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1408,6 +1444,7 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.SourceAccount]: r"""Update source account @@ -1422,6 +1459,7 @@ def update( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1446,6 +1484,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.source_account, @@ -1526,6 +1565,7 @@ async def update_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.SourceAccount]: r"""Update source account @@ -1540,6 +1580,7 @@ async def update_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1564,6 +1605,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.source_account, diff --git a/bank-feeds/src/codat_bankfeeds/sync.py b/bank-feeds/src/codat_bankfeeds/sync.py index ba147f38b..6d358adcb 100644 --- a/bank-feeds/src/codat_bankfeeds/sync.py +++ b/bank-feeds/src/codat_bankfeeds/sync.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class Sync(BaseSDK): @@ -21,6 +21,7 @@ def get_last_successful_sync( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CompanySyncStatus]: r"""Get last successful sync @@ -30,6 +31,7 @@ def get_last_successful_sync( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -54,6 +56,7 @@ def get_last_successful_sync( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -128,6 +131,7 @@ async def get_last_successful_sync_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CompanySyncStatus]: r"""Get last successful sync @@ -137,6 +141,7 @@ async def get_last_successful_sync_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -161,6 +166,7 @@ async def get_last_successful_sync_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) diff --git a/bank-feeds/src/codat_bankfeeds/transactions.py b/bank-feeds/src/codat_bankfeeds/transactions.py index c13576650..62cd60672 100644 --- a/bank-feeds/src/codat_bankfeeds/transactions.py +++ b/bank-feeds/src/codat_bankfeeds/transactions.py @@ -5,7 +5,7 @@ from codat_bankfeeds._hooks import HookContext from codat_bankfeeds.models import errors, operations, shared from codat_bankfeeds.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class Transactions(BaseSDK): @@ -21,6 +21,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CreateBankTransactionsResponse]: r"""Create bank transactions @@ -37,6 +38,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -61,6 +63,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.create_bank_transactions, @@ -143,6 +146,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.CreateBankTransactionsResponse]: r"""Create bank transactions @@ -159,6 +163,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -183,6 +188,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.create_bank_transactions, @@ -265,6 +271,7 @@ def get_create_model( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOption]: r"""Get create bank transactions model @@ -280,6 +287,7 @@ def get_create_model( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -306,6 +314,7 @@ def get_create_model( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -378,6 +387,7 @@ async def get_create_model_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOption]: r"""Get create bank transactions model @@ -393,6 +403,7 @@ async def get_create_model_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -419,6 +430,7 @@ async def get_create_model_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -491,6 +503,7 @@ def get_create_operation( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOperation]: r"""Get create operation @@ -504,6 +517,7 @@ def get_create_operation( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -528,6 +542,7 @@ def get_create_operation( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -600,6 +615,7 @@ async def get_create_operation_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOperation]: r"""Get create operation @@ -613,6 +629,7 @@ async def get_create_operation_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -637,6 +654,7 @@ async def get_create_operation_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -709,6 +727,7 @@ def list_create_operations( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOperations]: r"""List create operations @@ -722,6 +741,7 @@ def list_create_operations( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,6 +766,7 @@ def list_create_operations( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -819,6 +840,7 @@ async def list_create_operations_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[shared.PushOperations]: r"""List create operations @@ -832,6 +854,7 @@ async def list_create_operations_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -856,6 +879,7 @@ async def list_create_operations_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, )