From 01402f9bb50d398e1a80c061d85fa883acc1c909 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 9 Feb 2026 13:59:28 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.709.1 --- .speakeasy/workflow.lock | 14 +- sync-for-payables/.gitignore | 6 + sync-for-payables/.speakeasy/gen.lock | 1772 +++++++++++++---- sync-for-payables/.speakeasy/gen.yaml | 36 +- sync-for-payables/README.md | 288 ++- sync-for-payables/RELEASES.md | 12 +- sync-for-payables/USAGE.md | 23 +- .../operations/createbillpaymentrequest.md | 14 +- .../downloadbillattachmentrequest.md | 12 +- .../operations/listbillattachmentsrequest.md | 10 +- .../models/operations/listcompaniesrequest.md | 13 +- .../operations/replacecompanyrequest.md | 9 + .../models/operations/updatebillrequest.md | 12 + .../models/operations/updatecompanyrequest.md | 8 +- .../operations/uploadbillattachmentrequest.md | 12 +- .../models/shared/accountmappingoption.md | 4 +- .../docs/models/shared/attachment.md | 4 +- .../docs/models/shared/bankaccount.md | 4 +- .../models/shared/bankaccountmappingoption.md | 2 +- .../models/shared/bankaccountprototype.md | 6 +- sync-for-payables/docs/models/shared/bill.md | 12 +- .../docs/models/shared/billlineitem.md | 9 +- .../docs/models/shared/billmappingoptions.md | 10 +- .../docs/models/shared/billpayment.md | 2 +- .../models/shared/billpaymentprototype.md | 4 +- .../docs/models/shared/billprototype.md | 12 +- .../shared/clientratelimitreachedwebhook.md | 16 - .../clientratelimitreachedwebhookdata.md | 9 - .../shared/clientratelimitresetwebhook.md | 16 - .../shared/clientratelimitresetwebhookdata.md | 11 - .../models/shared/clientratelimitwebhook.md | 4 +- .../shared/clientratelimitwebhookpayload.md | 2 +- .../docs/models/shared/companies.md | 4 +- .../docs/models/shared/company.md | 6 +- .../models/shared/companyupdaterequest.md | 10 + .../docs/models/shared/connection.md | 6 +- .../docs/models/shared/connections.md | 4 +- .../docs/models/shared/dataconnectionerror.md | 4 +- .../docs/models/shared/datatype.md | 11 + .../models/shared/paymentmappingoptions.md | 8 +- .../docs/models/shared/supplier.md | 24 +- .../docs/models/shared/supplierprototype.md | 20 +- .../docs/models/shared/trackingref.md | 10 + .../docs/sdks/bankaccounts/README.md | 57 +- .../docs/sdks/billpayments/README.md | 115 +- sync-for-payables/docs/sdks/bills/README.md | 538 ++++- .../docs/sdks/codatsyncpayables/README.md | 36 - .../docs/sdks/companies/README.md | 405 +++- .../docs/sdks/companyinformation/README.md | 18 +- .../docs/sdks/connections/README.md | 110 +- .../docs/sdks/suppliers/README.md | 199 +- sync-for-payables/poetry.lock | 442 ++-- sync-for-payables/poetry.toml | 1 + sync-for-payables/pylintrc | 10 +- sync-for-payables/pyproject.toml | 31 +- .../{prepare-readme.py => prepare_readme.py} | 13 +- sync-for-payables/scripts/publish.sh | 3 +- .../src/codat_sync_for_payables/__init__.py | 11 +- .../codat_sync_for_payables/_hooks/types.py | 25 +- .../src/codat_sync_for_payables/_version.py | 5 +- .../codat_sync_for_payables/bank_accounts.py | 99 +- .../src/codat_sync_for_payables/basesdk.py | 97 +- .../codat_sync_for_payables/bill_payments.py | 181 +- .../src/codat_sync_for_payables/bills.py | 797 +++++--- .../src/codat_sync_for_payables/companies.py | 751 ++++--- .../company_information.py | 99 +- .../codat_sync_for_payables/connections.py | 471 +++-- .../src/codat_sync_for_payables/httpclient.py | 41 + .../models/__init__.py | 3 + .../models/errors/__init__.py | 68 +- .../models/errors/codatsyncpayableserror.py | 30 + .../models/errors/errormessage.py | 31 +- .../models/errors/no_response_error.py | 17 + .../models/errors/responsevalidationerror.py | 27 + .../models/errors/sdkerror.py | 46 +- .../models/operations/__init__.py | 219 +- .../models/operations/create_bank_account.py | 19 +- .../models/operations/create_bill.py | 19 +- .../models/operations/create_bill_payment.py | 19 +- .../models/operations/create_connection.py | 35 +- .../models/operations/create_supplier.py | 19 +- .../operations/get_mapping_options_bills.py | 19 +- .../get_mapping_options_payments.py | 19 +- .../models/operations/list_bills.py | 19 +- .../models/operations/list_companies.py | 27 +- .../models/operations/list_connections.py | 19 +- .../models/operations/list_suppliers.py | 19 +- .../models/operations/replace_company.py | 54 + .../models/operations/unlink_connection.py | 35 +- .../models/operations/update_bill.py | 78 + .../models/operations/update_company.py | 29 +- .../operations/upload_bill_attachment.py | 19 +- .../models/shared/__init__.py | 331 ++- .../models/shared/accountmappingoption.py | 53 +- .../models/shared/address.py | 47 +- .../models/shared/attachment.py | 53 +- .../models/shared/attachmentupload.py | 5 +- .../models/shared/bankaccount.py | 57 +- .../models/shared/bankaccountmappingoption.py | 65 +- .../models/shared/bankaccountprototype.py | 35 +- .../models/shared/bill.py | 53 +- .../models/shared/billaccountref.py | 19 +- .../models/shared/billlineitem.py | 88 +- .../models/shared/billmappingoptions.py | 23 +- .../models/shared/billpayment.py | 44 +- .../models/shared/billpaymentprototype.py | 35 +- .../models/shared/billprototype.py | 35 +- .../models/shared/bills.py | 19 +- .../models/shared/billtaxrateref.py | 19 +- .../shared/clientratelimitreachedwebhook.py | 61 - .../clientratelimitreachedwebhookdata.py | 60 - .../shared/clientratelimitresetwebhook.py | 61 - .../shared/clientratelimitresetwebhookdata.py | 109 - .../models/shared/clientratelimitwebhook.py | 19 +- .../shared/clientratelimitwebhookpayload.py | 19 +- .../models/shared/codatfile.py | 19 +- .../models/shared/companies.py | 19 +- .../models/shared/company.py | 57 +- .../models/shared/companyinformation.py | 35 +- .../models/shared/companyreference.py | 35 +- .../models/shared/companyrequestbody.py | 19 +- .../models/shared/companyupdaterequest.py | 43 + .../models/shared/connection.py | 41 +- .../models/shared/connections.py | 19 +- .../models/shared/dataconnectionerror.py | 51 +- .../models/shared/errorvalidation.py | 35 +- .../models/shared/errorvalidationitem.py | 35 +- .../models/shared/halref.py | 19 +- .../models/shared/links.py | 19 +- .../models/shared/pagination.py | 19 +- .../models/shared/paymentmappingoptions.py | 24 +- .../models/shared/supplier.py | 75 +- .../models/shared/supplierprototype.py | 67 +- .../models/shared/supplierref.py | 35 +- .../models/shared/suppliers.py | 19 +- .../models/shared/taxratemappingoption.py | 44 +- .../models/shared/trackingref.py | 52 + .../src/codat_sync_for_payables/sdk.py | 141 +- .../sdkconfiguration.py | 29 +- .../src/codat_sync_for_payables/suppliers.py | 189 +- .../types/basemodel.py | 44 +- .../codat_sync_for_payables/utils/__init__.py | 196 +- .../utils/annotations.py | 40 +- .../utils/datetimes.py | 23 + .../codat_sync_for_payables/utils/enums.py | 150 +- .../utils/eventstreaming.py | 136 +- .../codat_sync_for_payables/utils/forms.py | 100 +- .../utils/queryparams.py | 16 +- .../utils/requestbodies.py | 6 +- .../codat_sync_for_payables/utils/retries.py | 74 +- .../codat_sync_for_payables/utils/security.py | 2 + .../utils/serializers.py | 70 +- .../utils/unmarshal_json_response.py | 38 + .../codat_sync_for_payables/utils/values.py | 5 +- 154 files changed, 7874 insertions(+), 3395 deletions(-) create mode 100644 sync-for-payables/docs/models/operations/replacecompanyrequest.md create mode 100644 sync-for-payables/docs/models/operations/updatebillrequest.md delete mode 100644 sync-for-payables/docs/models/shared/clientratelimitreachedwebhook.md delete mode 100644 sync-for-payables/docs/models/shared/clientratelimitreachedwebhookdata.md delete mode 100644 sync-for-payables/docs/models/shared/clientratelimitresetwebhook.md delete mode 100644 sync-for-payables/docs/models/shared/clientratelimitresetwebhookdata.md create mode 100644 sync-for-payables/docs/models/shared/companyupdaterequest.md create mode 100644 sync-for-payables/docs/models/shared/datatype.md create mode 100644 sync-for-payables/docs/models/shared/trackingref.md delete mode 100644 sync-for-payables/docs/sdks/codatsyncpayables/README.md rename sync-for-payables/scripts/{prepare-readme.py => prepare_readme.py} (71%) create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/__init__.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/errors/no_response_error.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/errors/responsevalidationerror.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/operations/replace_company.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/operations/update_bill.py delete mode 100644 sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhook.py delete mode 100644 sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhookdata.py delete mode 100644 sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhook.py delete mode 100644 sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhookdata.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/shared/companyupdaterequest.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/models/shared/trackingref.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/utils/datetimes.py create mode 100644 sync-for-payables/src/codat_sync_for_payables/utils/unmarshal_json_response.py diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d726788bd..1becf8d78 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.696.0 +speakeasyVersion: 1.709.1 sources: accounting-source: sourceNamespace: accounting-source @@ -84,11 +84,11 @@ sources: - prealpha sync-for-payables-source: sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:91db2475a2b22bd8d3aa4cc563979bf0c9c887c393c979537263a5f541ab8b04 - sourceBlobDigest: sha256:57b656eed2c5a98f97da8f59e196bb8052ead3cc7c87673cdf5e19c6badbb570 + sourceRevisionDigest: sha256:9bd9e36fdb60e3d73fe7cc209c24ce0325919a523acec3edd84ee2f26420bedc + sourceBlobDigest: sha256:59b5c9d3aa1a43fa4186c6ae1bf1108bf40d44d22f65ed6118b763574e0cf669 tags: - latest - - speakeasy-sdk-regen-1733826158 + - speakeasy-sdk-regen-1770645503 - 3.0.0 sync-for-payables-version-1-source: sourceNamespace: sync-for-payables-version-1-source @@ -166,10 +166,10 @@ targets: sync-for-payables-library: source: sync-for-payables-source sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:91db2475a2b22bd8d3aa4cc563979bf0c9c887c393c979537263a5f541ab8b04 - sourceBlobDigest: sha256:57b656eed2c5a98f97da8f59e196bb8052ead3cc7c87673cdf5e19c6badbb570 + sourceRevisionDigest: sha256:9bd9e36fdb60e3d73fe7cc209c24ce0325919a523acec3edd84ee2f26420bedc + sourceBlobDigest: sha256:59b5c9d3aa1a43fa4186c6ae1bf1108bf40d44d22f65ed6118b763574e0cf669 codeSamplesNamespace: sync-for-payables-source-python-code-samples - codeSamplesRevisionDigest: sha256:9a230d00f4713b828e0a51c12d169f4c326865409b7aedb7525060826c7d7ef1 + codeSamplesRevisionDigest: sha256:11e61ee9fcccdc977591687b180bc770563288e40fab86f70914cf7312df184d sync-for-payables-version-1-library: source: sync-for-payables-version-1-source sourceNamespace: sync-for-payables-version-1-source diff --git a/sync-for-payables/.gitignore b/sync-for-payables/.gitignore index 65eb1caeb..b88ec7ca7 100644 --- a/sync-for-payables/.gitignore +++ b/sync-for-payables/.gitignore @@ -1,3 +1,9 @@ +**/__pycache__/ +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.speakeasy/reports +.env +.env.local .venv/ venv/ src/*.egg-info/ diff --git a/sync-for-payables/.speakeasy/gen.lock b/sync-for-payables/.speakeasy/gen.lock index 1e094b675..cb06efb24 100644 --- a/sync-for-payables/.speakeasy/gen.lock +++ b/sync-for-payables/.speakeasy/gen.lock @@ -1,265 +1,918 @@ lockVersion: 2.0.0 id: 0722f07c-657c-4062-93f1-39ee3fe757d0 management: - docChecksum: 05c2a60eb0f4b40cda5e4a92d94e7b93 + docChecksum: 2c97e4172eda0b5a31c6dc31f428235d docVersion: 3.0.0 - speakeasyVersion: 1.453.8 - generationVersion: 2.474.15 - releaseVersion: 8.0.3 - configChecksum: 52f1dd427d39b22a834f77dd51ec7337 + speakeasyVersion: 1.709.1 + generationVersion: 2.812.2 + releaseVersion: 9.0.0 + configChecksum: 678339eae8c9d3fd396e8b997badc659 repoURL: https://github.com/codatio/client-sdk-python.git repoSubDirectory: sync-for-payables installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=sync-for-payables published: true +persistentEdits: + generation_id: 26ca609b-a663-4d2b-8693-a9ab4801007d + pristine_commit_hash: 7669a2d4e5e8745ff352d913c99a440e738e491e + pristine_tree_hash: 32756ec7019b491a6a5cd578646ac0b4db873843 features: python: additionalDependencies: 1.0.0 - constsAndDefaults: 1.0.5 - core: 5.6.11 + constsAndDefaults: 1.0.6 + core: 6.0.4 decimal: 1.0.0 defaultEnabledRetries: 0.2.0 - deprecations: 3.0.0 downloadStreams: 1.0.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 - examples: 3.0.0 - globalSecurity: 3.0.2 + examples: 3.0.2 + globalSecurity: 3.0.5 globalSecurityCallbacks: 1.0.0 - globalServerURLs: 3.0.0 + globalServerURLs: 3.2.0 methodArguments: 1.0.2 multipartFileContentType: 1.0.0 - nameOverrides: 3.0.0 - nullables: 1.0.0 - responseFormat: 1.0.1 - retries: 3.0.2 - sdkHooks: 1.0.0 + nameOverrides: 3.0.1 + nullables: 1.0.2 + responseFormat: 1.1.0 + retries: 3.0.3 + sdkHooks: 1.2.1 serverEventsSentinels: 0.1.0 uploadStreams: 1.0.0 webhooks: 2.0.0 -generatedFiles: - - .gitattributes - - .python-version - - .vscode/settings.json - - CONTRIBUTING.md - - USAGE.md - - docs/models/errors/errormessage.md - - docs/models/operations/createbankaccountrequest.md - - docs/models/operations/createbillpaymentrequest.md - - docs/models/operations/createbillrequest.md - - docs/models/operations/createconnectionrequest.md - - docs/models/operations/createconnectionrequestbody.md - - docs/models/operations/createsupplierrequest.md - - docs/models/operations/deletecompanyrequest.md - - docs/models/operations/deleteconnectionrequest.md - - docs/models/operations/downloadbillattachmentrequest.md - - docs/models/operations/getcompanyinformationrequest.md - - docs/models/operations/getcompanyrequest.md - - docs/models/operations/getconnectionrequest.md - - docs/models/operations/getmappingoptionsbillsrequest.md - - docs/models/operations/getmappingoptionspaymentsrequest.md - - docs/models/operations/listbillattachmentsrequest.md - - docs/models/operations/listbillsrequest.md - - docs/models/operations/listcompaniesrequest.md - - docs/models/operations/listconnectionsrequest.md - - docs/models/operations/listsuppliersrequest.md - - docs/models/operations/unlinkconnectionrequest.md - - docs/models/operations/unlinkconnectionupdateconnection.md - - docs/models/operations/updatecompanyrequest.md - - docs/models/operations/uploadbillattachmentrequest.md - - docs/models/shared/accountmappingoption.md - - docs/models/shared/accountstatus.md - - docs/models/shared/address.md - - docs/models/shared/addresstype.md - - docs/models/shared/attachment.md - - docs/models/shared/attachmentupload.md - - docs/models/shared/bankaccount.md - - docs/models/shared/bankaccountmappingoption.md - - docs/models/shared/bankaccountprototype.md - - docs/models/shared/bankaccountstatus.md - - docs/models/shared/bankaccounttype.md - - docs/models/shared/bill.md - - docs/models/shared/billaccountref.md - - docs/models/shared/billlineitem.md - - docs/models/shared/billmappingoptions.md - - docs/models/shared/billpayment.md - - docs/models/shared/billpaymentaccountref.md - - docs/models/shared/billpaymentprototype.md - - docs/models/shared/billprototype.md - - docs/models/shared/bills.md - - docs/models/shared/billstatus.md - - docs/models/shared/billtaxrateref.md - - docs/models/shared/clientratelimitreachedwebhook.md - - docs/models/shared/clientratelimitreachedwebhookdata.md - - docs/models/shared/clientratelimitresetwebhook.md - - docs/models/shared/clientratelimitresetwebhookdata.md - - docs/models/shared/clientratelimitwebhook.md - - docs/models/shared/clientratelimitwebhookpayload.md - - docs/models/shared/codatfile.md - - docs/models/shared/companies.md - - docs/models/shared/company.md - - docs/models/shared/companyinformation.md - - docs/models/shared/companyreference.md - - docs/models/shared/companyreferencelinks.md - - docs/models/shared/companyrequestbody.md - - docs/models/shared/connection.md - - docs/models/shared/connections.md - - docs/models/shared/dataconnectionerror.md - - docs/models/shared/dataconnectionstatus.md - - docs/models/shared/errorstatus.md - - docs/models/shared/errorvalidation.md - - docs/models/shared/errorvalidationitem.md - - docs/models/shared/halref.md - - docs/models/shared/links.md - - docs/models/shared/pagination.md - - docs/models/shared/paymentmappingoptions.md - - docs/models/shared/security.md - - docs/models/shared/sourcetype.md - - docs/models/shared/supplier.md - - docs/models/shared/supplierprototype.md - - docs/models/shared/supplierref.md - - docs/models/shared/suppliers.md - - docs/models/shared/supplierstatus.md - - docs/models/shared/taxratemappingoption.md - - docs/models/shared/taxratestatus.md - - docs/models/utils/retryconfig.md - - docs/sdks/bankaccounts/README.md - - docs/sdks/billpayments/README.md - - docs/sdks/bills/README.md - - docs/sdks/codatsyncpayables/README.md - - docs/sdks/companies/README.md - - docs/sdks/companyinformation/README.md - - docs/sdks/connections/README.md - - docs/sdks/suppliers/README.md - - poetry.toml - - py.typed - - pylintrc - - pyproject.toml - - scripts/prepare-readme.py - - scripts/publish.sh - - src/codat_sync_for_payables/__init__.py - - src/codat_sync_for_payables/_hooks/__init__.py - - src/codat_sync_for_payables/_hooks/sdkhooks.py - - src/codat_sync_for_payables/_hooks/types.py - - src/codat_sync_for_payables/_version.py - - src/codat_sync_for_payables/bank_accounts.py - - src/codat_sync_for_payables/basesdk.py - - src/codat_sync_for_payables/bill_payments.py - - src/codat_sync_for_payables/bills.py - - src/codat_sync_for_payables/companies.py - - src/codat_sync_for_payables/company_information.py - - src/codat_sync_for_payables/connections.py - - src/codat_sync_for_payables/httpclient.py - - src/codat_sync_for_payables/models/errors/__init__.py - - src/codat_sync_for_payables/models/errors/errormessage.py - - src/codat_sync_for_payables/models/errors/sdkerror.py - - src/codat_sync_for_payables/models/operations/__init__.py - - src/codat_sync_for_payables/models/operations/create_bank_account.py - - src/codat_sync_for_payables/models/operations/create_bill.py - - src/codat_sync_for_payables/models/operations/create_bill_payment.py - - src/codat_sync_for_payables/models/operations/create_connection.py - - src/codat_sync_for_payables/models/operations/create_supplier.py - - src/codat_sync_for_payables/models/operations/delete_company.py - - src/codat_sync_for_payables/models/operations/delete_connection.py - - src/codat_sync_for_payables/models/operations/download_bill_attachment.py - - src/codat_sync_for_payables/models/operations/get_company.py - - src/codat_sync_for_payables/models/operations/get_company_information.py - - src/codat_sync_for_payables/models/operations/get_connection.py - - src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py - - src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py - - src/codat_sync_for_payables/models/operations/list_bill_attachments.py - - src/codat_sync_for_payables/models/operations/list_bills.py - - src/codat_sync_for_payables/models/operations/list_companies.py - - src/codat_sync_for_payables/models/operations/list_connections.py - - src/codat_sync_for_payables/models/operations/list_suppliers.py - - src/codat_sync_for_payables/models/operations/unlink_connection.py - - src/codat_sync_for_payables/models/operations/update_company.py - - src/codat_sync_for_payables/models/operations/upload_bill_attachment.py - - src/codat_sync_for_payables/models/shared/__init__.py - - src/codat_sync_for_payables/models/shared/accountmappingoption.py - - src/codat_sync_for_payables/models/shared/accountstatus.py - - src/codat_sync_for_payables/models/shared/address.py - - src/codat_sync_for_payables/models/shared/addresstype.py - - src/codat_sync_for_payables/models/shared/attachment.py - - src/codat_sync_for_payables/models/shared/attachmentupload.py - - src/codat_sync_for_payables/models/shared/bankaccount.py - - src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py - - src/codat_sync_for_payables/models/shared/bankaccountprototype.py - - src/codat_sync_for_payables/models/shared/bankaccountstatus.py - - src/codat_sync_for_payables/models/shared/bankaccounttype.py - - src/codat_sync_for_payables/models/shared/bill.py - - src/codat_sync_for_payables/models/shared/billaccountref.py - - src/codat_sync_for_payables/models/shared/billlineitem.py - - src/codat_sync_for_payables/models/shared/billmappingoptions.py - - src/codat_sync_for_payables/models/shared/billpayment.py - - src/codat_sync_for_payables/models/shared/billpaymentaccountref.py - - src/codat_sync_for_payables/models/shared/billpaymentprototype.py - - src/codat_sync_for_payables/models/shared/billprototype.py - - src/codat_sync_for_payables/models/shared/bills.py - - src/codat_sync_for_payables/models/shared/billstatus.py - - src/codat_sync_for_payables/models/shared/billtaxrateref.py - - src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhook.py - - src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhookdata.py - - src/codat_sync_for_payables/models/shared/clientratelimitresetwebhook.py - - src/codat_sync_for_payables/models/shared/clientratelimitresetwebhookdata.py - - src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py - - src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py - - src/codat_sync_for_payables/models/shared/codatfile.py - - src/codat_sync_for_payables/models/shared/companies.py - - src/codat_sync_for_payables/models/shared/company.py - - src/codat_sync_for_payables/models/shared/companyinformation.py - - src/codat_sync_for_payables/models/shared/companyreference.py - - src/codat_sync_for_payables/models/shared/companyrequestbody.py - - src/codat_sync_for_payables/models/shared/connection.py - - src/codat_sync_for_payables/models/shared/connections.py - - src/codat_sync_for_payables/models/shared/dataconnectionerror.py - - src/codat_sync_for_payables/models/shared/dataconnectionstatus.py - - src/codat_sync_for_payables/models/shared/errorvalidation.py - - src/codat_sync_for_payables/models/shared/errorvalidationitem.py - - src/codat_sync_for_payables/models/shared/halref.py - - src/codat_sync_for_payables/models/shared/links.py - - src/codat_sync_for_payables/models/shared/pagination.py - - src/codat_sync_for_payables/models/shared/paymentmappingoptions.py - - src/codat_sync_for_payables/models/shared/security.py - - src/codat_sync_for_payables/models/shared/supplier.py - - src/codat_sync_for_payables/models/shared/supplierprototype.py - - src/codat_sync_for_payables/models/shared/supplierref.py - - src/codat_sync_for_payables/models/shared/suppliers.py - - src/codat_sync_for_payables/models/shared/supplierstatus.py - - src/codat_sync_for_payables/models/shared/taxratemappingoption.py - - src/codat_sync_for_payables/py.typed - - src/codat_sync_for_payables/sdk.py - - src/codat_sync_for_payables/sdkconfiguration.py - - src/codat_sync_for_payables/suppliers.py - - src/codat_sync_for_payables/types/__init__.py - - src/codat_sync_for_payables/types/basemodel.py - - src/codat_sync_for_payables/utils/__init__.py - - src/codat_sync_for_payables/utils/annotations.py - - src/codat_sync_for_payables/utils/enums.py - - src/codat_sync_for_payables/utils/eventstreaming.py - - src/codat_sync_for_payables/utils/forms.py - - src/codat_sync_for_payables/utils/headers.py - - src/codat_sync_for_payables/utils/logger.py - - src/codat_sync_for_payables/utils/metadata.py - - src/codat_sync_for_payables/utils/queryparams.py - - src/codat_sync_for_payables/utils/requestbodies.py - - src/codat_sync_for_payables/utils/retries.py - - src/codat_sync_for_payables/utils/security.py - - src/codat_sync_for_payables/utils/serializers.py - - src/codat_sync_for_payables/utils/url.py - - src/codat_sync_for_payables/utils/values.py +trackedFiles: + .gitattributes: + id: 24139dae6567 + last_write_checksum: sha1:53134de3ada576f37c22276901e1b5b6d85cd2da + pristine_git_object: 4d75d59008e4d8609876d263419a9dc56c8d6f3a + .vscode/settings.json: + id: 89aa447020cd + last_write_checksum: sha1:f84632c81029fcdda8c3b0c768d02b836fc80526 + pristine_git_object: 8d79f0abb72526f1fb34a4c03e5bba612c6ba2ae + USAGE.md: + id: 3aed33ce6e6f + last_write_checksum: sha1:6bd0130c1a114670ec032ed9d4cf93628fa58331 + pristine_git_object: 4e0078b54a923ec48fd5bb8554ed72bdda25bd2e + docs/models/errors/errormessage.md: + id: 4d5230d16c88 + last_write_checksum: sha1:a9546ebec55907d7617f759e13ce72dfd773780f + pristine_git_object: 752db00131a6d69cba5bea539db17e70272f10ec + docs/models/operations/createbankaccountrequest.md: + id: 02f431df4335 + last_write_checksum: sha1:d0ead6d2c8eeb7a7a03c57ae6c062ebbee580ea5 + pristine_git_object: 3a74ffd7c2bae855181452973151effed8b4b86c + docs/models/operations/createbillpaymentrequest.md: + id: 9b82b05e3e49 + last_write_checksum: sha1:c17c301063ff4f2d3ceb7d5e308afe26e0a7ede3 + pristine_git_object: d5bd37b70fb9d4209d47e700beb734fe7b3f6271 + docs/models/operations/createbillrequest.md: + id: dc1ab83db7c7 + last_write_checksum: sha1:a70c829df60d40df00cdfc951e1e1593f8d924a3 + pristine_git_object: 6b83a39bc6cb9f1ed4989bfd1556911af62a8c9c + docs/models/operations/createconnectionrequest.md: + id: e9d604e527c2 + last_write_checksum: sha1:937bf3f29921382a9078985b497b1b642d9daad4 + pristine_git_object: ff26e52b6cf31b82a3bd73b8fb47616f05b4dd94 + docs/models/operations/createconnectionrequestbody.md: + id: 8495a5169d38 + last_write_checksum: sha1:ffadef3b76218e7de44fa85abf4ebbeee34498c8 + pristine_git_object: 891314d08a8c421f5bbf7620adb2330f0989ca56 + docs/models/operations/createsupplierrequest.md: + id: 7cee9988969a + last_write_checksum: sha1:640a03619892845193c666dfc36d4b97b660c314 + pristine_git_object: b820d5d6fb0380adc965f5686803d71eddb7ff6a + docs/models/operations/deletecompanyrequest.md: + id: 9bc77c024acd + last_write_checksum: sha1:811626e298388a197f3f7fd5259323343b6df0bd + pristine_git_object: 338ee40e5c1fcf34581e351eb61ceaf43fa83e21 + docs/models/operations/deleteconnectionrequest.md: + id: 7524c534e204 + last_write_checksum: sha1:38374b09889ade73ae3ea9976586e56ad75cc13c + pristine_git_object: 9650dc387d5e9833a246e673b7f5b2b2f3b4bf27 + docs/models/operations/downloadbillattachmentrequest.md: + id: 92c230da8e87 + last_write_checksum: sha1:d34d9da922aaec6462f03a9f3fbfdf732ae6ac1b + pristine_git_object: 2df731fdb1049927a1138de551b6acc75ae362e8 + docs/models/operations/getcompanyinformationrequest.md: + id: 4ca694e4f794 + last_write_checksum: sha1:bde9316d964f63eae7eed77bed1ec68522d2d1df + pristine_git_object: 657eb5cde4fd34fd2b2c6abed9428f07f101cff1 + docs/models/operations/getcompanyrequest.md: + id: ebdeba1bae07 + last_write_checksum: sha1:6483770af67645c56f1c2c444154ccb545a93f56 + pristine_git_object: 240b811b65ffaad0a074a2e2bb184681031157a8 + docs/models/operations/getconnectionrequest.md: + id: ead07ee6aac0 + last_write_checksum: sha1:5264cca686dceade941ca0a5471d7366ea5f95c5 + pristine_git_object: 6e9f3d18b84f18e668276fbfcb4f955fb1261b1c + docs/models/operations/getmappingoptionsbillsrequest.md: + id: 111468aae7c9 + last_write_checksum: sha1:8562e984ac4be84a4b23e4121a9b8eded378a451 + pristine_git_object: 901f6cec75c2f37fe67f8541b3b5ac7e2d9dbdb6 + docs/models/operations/getmappingoptionspaymentsrequest.md: + id: ca7acfab16d2 + last_write_checksum: sha1:d4e2a9a013d87d31ac756827488e8482aa4e0e6c + pristine_git_object: 3ae09265f858f1255a74b6acbed3caa4b6caabd6 + docs/models/operations/listbillattachmentsrequest.md: + id: d9277e5e0ae2 + last_write_checksum: sha1:8e5ee31a91c14d8a9a8df0a5d8eb8d7a8e705349 + pristine_git_object: 2a271d2fc3039f795776aa96e96ba2af2c42258f + docs/models/operations/listbillsrequest.md: + id: d32116f86ced + last_write_checksum: sha1:49f956500fd862d4248299d78909faa8f5155e1f + pristine_git_object: cd5209d7e82a5b97955161cdefc4e69ec7cd0916 + docs/models/operations/listcompaniesrequest.md: + id: 4020e616e068 + last_write_checksum: sha1:d0315d2aff1ba567eb1c30ab309287e8ec5ab6e5 + pristine_git_object: 8617ea2817373306f7ba2a69980e57354014747d + docs/models/operations/listconnectionsrequest.md: + id: 8ba0b147f0cd + last_write_checksum: sha1:ad58141d3c6fde41f0c4eaded06fac5f5bf29db0 + pristine_git_object: 1d852c6cd9f5b137919e22967bb04576527aa034 + docs/models/operations/listsuppliersrequest.md: + id: 5639fa018695 + last_write_checksum: sha1:13e4513c542a78789d845fe1e53aeeb95e8e7d94 + pristine_git_object: faf0d748feaa8b4d8d3fce7a1abf65e7268c5e8f + docs/models/operations/replacecompanyrequest.md: + id: d8590cda3149 + last_write_checksum: sha1:f1d714c843fd365fe9f326d290b74467144e097e + pristine_git_object: 1de44d9823cd869b160bfacaf1b7dd62838bdab3 + docs/models/operations/unlinkconnectionrequest.md: + id: 9b4ac9e3b796 + last_write_checksum: sha1:830637c715275d1e6301462d7cbadb6dee81895c + pristine_git_object: 79d8b207206945c779bb970d76d00699b0bf0841 + docs/models/operations/unlinkconnectionupdateconnection.md: + id: 0cf08370c07c + last_write_checksum: sha1:67b74154047ab22efda9f8ab140190c84bd4f284 + pristine_git_object: 5a5f2911b77fc950faa35700eedf274f69a4937a + docs/models/operations/updatebillrequest.md: + id: 27458e67181d + last_write_checksum: sha1:cd0b68e12bebbe5f8e0cd801e02f59cdc10e3546 + pristine_git_object: 749e460bd93e0084fc513d16a492b63afbe2ca8d + docs/models/operations/updatecompanyrequest.md: + id: 8d0c2e6362d6 + last_write_checksum: sha1:be91cfd4b67e08879309ffcfe76805508161ad72 + pristine_git_object: d2d812198486c616edb02b5791f8f3a7511c7f0a + docs/models/operations/uploadbillattachmentrequest.md: + id: 0aa2c6974fce + last_write_checksum: sha1:7431c2098c566e0fa493c09a3d2fb951fdcef01b + pristine_git_object: 7b2ccd399322607626b2392cffaf7581fcf90abf + docs/models/shared/accountmappingoption.md: + id: 036fbc755697 + last_write_checksum: sha1:e81edfec8af98213da5908886f4310dab19ae1e8 + pristine_git_object: 1c1d6008832fcfb74b00b356eeebbb027378e417 + docs/models/shared/accountstatus.md: + id: 4cde87c0bb51 + last_write_checksum: sha1:02d874ca35623d94c0157ba9d2dd795d0ede877f + pristine_git_object: 25850a47c26263a7cbd0bb589f07a55bb0fb93fd + docs/models/shared/address.md: + id: 788f11abd93f + last_write_checksum: sha1:cf1330926875df173ba876a662b995a7a1e74d1b + pristine_git_object: 5772213eb7d02dfda9099f352a06e024e63a1f89 + docs/models/shared/addresstype.md: + id: 03af29105952 + last_write_checksum: sha1:572e6a019a91981ca3bd3ecb3f04579b2e0004d3 + pristine_git_object: 5de1e6e1a3d3a1454efd5f68e641bff5d3e78d44 + docs/models/shared/attachment.md: + id: 3e31336af04a + last_write_checksum: sha1:669d7ca89b320bee1ad17ccdf8fe3bd1142eeb7a + pristine_git_object: 129d601b30a44a95bed50c2cbfb27042596caa29 + docs/models/shared/attachmentupload.md: + id: 6d86ca5f45ce + last_write_checksum: sha1:c5d955cc17e8cf27f15812400ecff8c67862224b + pristine_git_object: 02d7ac41a576611cd15c7591d540d4da02f158e9 + docs/models/shared/bankaccount.md: + id: 33bf0def5f28 + last_write_checksum: sha1:f58ff49ac050b697f155bf6cf91ffeb30254a106 + pristine_git_object: 25fff9fdc410adc7b0b46e424ab91f442aa0cf70 + docs/models/shared/bankaccountmappingoption.md: + id: 47e07b18027f + last_write_checksum: sha1:fd38d9a2db578219b7a4e1610147003b4e74832b + pristine_git_object: e4a4d459bf29e246276b8830b01d5d3eda233c80 + docs/models/shared/bankaccountprototype.md: + id: 98ee9d73a8b6 + last_write_checksum: sha1:5cbaedbd2916373fab640f16316bfb4c64b1f6b6 + pristine_git_object: a16edf50bec68f8fa1069eb7654d0d7c452459be + docs/models/shared/bankaccountstatus.md: + id: 021a83bbf7b9 + last_write_checksum: sha1:fd78426a22650e15f139e399186d04ca2ea4ea11 + pristine_git_object: 86abe214ab650673bc547d47bf52f34c2fed86c8 + docs/models/shared/bankaccounttype.md: + id: 9b7d8afc1f13 + last_write_checksum: sha1:7d649798a5f314651af3ac2e77f3cf409822a464 + pristine_git_object: a995a4e524bdd3256b0050ede93802c91fbf53ce + docs/models/shared/bill.md: + id: 2d735f223ca0 + last_write_checksum: sha1:f2ff59c23bb2d515361eee2b7f01bd8c4e6c2b57 + pristine_git_object: 9989e1a3f34c6ac4e66de44d18afd9d026740b12 + docs/models/shared/billaccountref.md: + id: c288241a39d0 + last_write_checksum: sha1:683c096b385edaef7424b795cdcb03307801b544 + pristine_git_object: 77f0c8d0461eaac2e623a50d27b660a704012cdb + docs/models/shared/billlineitem.md: + id: fd60eabd8614 + last_write_checksum: sha1:c281624229a5b3ba0b538f2501a9d5dc41f4ee07 + pristine_git_object: 69d759c8107f044fa54fc8fa444e38dfebaab545 + docs/models/shared/billmappingoptions.md: + id: ef2d5efe57e9 + last_write_checksum: sha1:e9e820c4e07333f50c2ea7f72ff2b22c3a53b571 + pristine_git_object: e9979b159872bc9226728bb84ee7f86b9c6867d5 + docs/models/shared/billpayment.md: + id: 32e60120facb + last_write_checksum: sha1:32052cd746d5af7091734bc09d713023ed73b240 + pristine_git_object: 9ceaa2c30c930c0c9bc2783cb9bed88245c75d3d + docs/models/shared/billpaymentaccountref.md: + id: e93ec7632039 + last_write_checksum: sha1:0f9a168118861dd12c4284a600c25afa706f0346 + pristine_git_object: b8c1a431773ae5451e2307d3967322f5f26297d1 + docs/models/shared/billpaymentprototype.md: + id: 7fcb85e23653 + last_write_checksum: sha1:67e374300c8da74a96431bf766bcbd0fcef1eb6d + pristine_git_object: dee200ee054da327ed76e461906f29d836d5be06 + docs/models/shared/billprototype.md: + id: 6972cb5ca0e4 + last_write_checksum: sha1:465442ab3c90321046c2000c9666f008e8e528f8 + pristine_git_object: 1b924b241d88bafb43045ff364c2af3a776267eb + docs/models/shared/bills.md: + id: 64b709eca860 + last_write_checksum: sha1:1ba7890a73d99060392698da35de51d05b2e1172 + pristine_git_object: 58122acd20eec65770f8885149b8b0631671c97d + docs/models/shared/billstatus.md: + id: 0f98505d2835 + last_write_checksum: sha1:29d93aea2465786717c5b59c062a7d2e6455906b + pristine_git_object: 61bf740c222cb102b9825709e43a6b8a3a8e5fbe + docs/models/shared/billtaxrateref.md: + id: d83ee0d22ada + last_write_checksum: sha1:bbf08dc0016f96dfd9e6d60da991c20fdb680348 + pristine_git_object: 28d67e255cd6ec8036f7cae8b52fbd3402f2028b + docs/models/shared/clientratelimitwebhook.md: + id: b22baadb776e + last_write_checksum: sha1:ac83140fd86cd53811c6368c5d8055e1d5d07b6b + pristine_git_object: 686f8f82a9ee065a80e77232c14a689d411ed380 + docs/models/shared/clientratelimitwebhookpayload.md: + id: acee7ef96850 + last_write_checksum: sha1:a432a91dac42c55dd2dff7da3d7af5cf112c5414 + pristine_git_object: 52e2c78d219f5b49c2b31e4af8ca8a6d8c90d18e + docs/models/shared/codatfile.md: + id: 91427b129f50 + last_write_checksum: sha1:6960c7b2f193c1796bcb1568c4f94a395bc55e9e + pristine_git_object: 891a552ade04c1299535ea9d23d3320b772bc23a + docs/models/shared/companies.md: + id: 2572802991c0 + last_write_checksum: sha1:ff5198dc06cffa158b07d77abacdd95b26c48d93 + pristine_git_object: 6436dc2cd5d471fca420759f9d813591c15eaaf0 + docs/models/shared/company.md: + id: a20db760623e + last_write_checksum: sha1:c6b14cf68e30441da45a84b15b7f76876aa151b2 + pristine_git_object: 02b633fb47b8838f1f414081371549956a696be6 + docs/models/shared/companyinformation.md: + id: 90a8665c65f4 + last_write_checksum: sha1:b6bf4939cad18d16d504e59ba34fcfb07b23bbeb + pristine_git_object: 387fdc506937881e5fceb4d5dc76635dd7166a9c + docs/models/shared/companyreference.md: + id: 04b06c6e3636 + last_write_checksum: sha1:153d5a1155879769d8e278fce5daa8560dbb0de9 + pristine_git_object: bb9cd0dd4a4f80728f20f1c2b3032f846d5e559b + docs/models/shared/companyreferencelinks.md: + id: d56fc1d93399 + last_write_checksum: sha1:0dbd8353289b35519ca7e01742fb90ef1c79a31a + pristine_git_object: ee01fd3203f2bf056837004cc333f8216673c1a6 + docs/models/shared/companyrequestbody.md: + id: 9fdfac9f00ff + last_write_checksum: sha1:a40fc39b32add91f36c2a42e6acf40a3d2198163 + pristine_git_object: 3b85563a1216b1131d2779a86c98b2f0516fb385 + docs/models/shared/companyupdaterequest.md: + id: 66e1d94296e1 + last_write_checksum: sha1:cd73b073fb454be4fc61ca4f4b79beeb3b2b40a7 + pristine_git_object: 80229fd64c0eaf0ffef4e1d0ba9341329b9abb2e + docs/models/shared/connection.md: + id: 906ff4b2d85c + last_write_checksum: sha1:e6d72609fc62cc8cd246d411161e9d6d1a5c4c12 + pristine_git_object: 5bebcd785c886a0a9f2b9b8b61f760de4752482b + docs/models/shared/connections.md: + id: f1fe5197905a + last_write_checksum: sha1:6e8736ebbdff0646c9c18d147a23889b3bab9918 + pristine_git_object: ea48ba61ec4fcf433b15eafae9f3b083d7d30d67 + docs/models/shared/dataconnectionerror.md: + id: 0fcd3ffd993d + last_write_checksum: sha1:9025f8d646df24d0d1478b3b35ae2dc526a29491 + pristine_git_object: e381d128ee7df286c9fd54b4c932daf5ffeae586 + docs/models/shared/dataconnectionstatus.md: + id: 4703bf7d9519 + last_write_checksum: sha1:8ae1df338192f7af309a68358a7c6f4782181e70 + pristine_git_object: 4e79f5d5a49ea486f8c200c95d6a3e96c462b055 + docs/models/shared/datatype.md: + id: b71835d2a72b + last_write_checksum: sha1:823b4f90ed6b0ebe9807648b58feb6071cbbd0d9 + pristine_git_object: 1eef426e28199930c27127bb98a887edafab8a04 + docs/models/shared/errorstatus.md: + id: 080dc9ade2a1 + last_write_checksum: sha1:c834679da809f9e78d098bac835d4f7a50f366e0 + pristine_git_object: 02c0ec3d937eb4f4f3eb91cce15adacf83e689e8 + docs/models/shared/errorvalidation.md: + id: 16c1cb223d2f + last_write_checksum: sha1:95c0612deeeffbcdad88e43e6ac3b9c5a27dbc5b + pristine_git_object: 122badd9dc677268354300580e2cf4a816648b75 + docs/models/shared/errorvalidationitem.md: + id: 387d0284dfc7 + last_write_checksum: sha1:9b65cc3e6aa3f0d5a402144850337bf43dc151a2 + pristine_git_object: fca2ef14a61187257e94508739301789fe95ca75 + docs/models/shared/halref.md: + id: 6419816ff8a5 + last_write_checksum: sha1:3351eecf720075f09f46151fdb5cadb941a45d2c + pristine_git_object: 94c6476ffb09fbcb1b7b417dcd7a1c1448db767b + docs/models/shared/links.md: + id: 62457336618a + last_write_checksum: sha1:469bff1e8741bb49ee7746d9be6b068cc30577d8 + pristine_git_object: 6bbcdd92abcf2fdf2b0623da26cb56fca680ef02 + docs/models/shared/pagination.md: + id: 327a2bd39678 + last_write_checksum: sha1:810523abda7fcb7f1e1837ecd00c24f196578dee + pristine_git_object: efde183b272cf6ce2e9c28d7ec2af86096a8b45e + docs/models/shared/paymentmappingoptions.md: + id: 0c146e112cc3 + last_write_checksum: sha1:85d2142524d6eb7be85069de9072a9bbc0b567be + pristine_git_object: b8085c1e505008bf9d8cf0462c33ca2d19a2a7ad + docs/models/shared/security.md: + id: 3035c5c37727 + last_write_checksum: sha1:ad8f2bb99d7b8a122835078105808dca5b211113 + pristine_git_object: 2b68bd0e737786201357cb36c00787f0689e6bbf + docs/models/shared/sourcetype.md: + id: 89991911fb97 + last_write_checksum: sha1:d51207165a69ba6f7a95db1068d52a3a487a9eb8 + pristine_git_object: 2daec8ef3f42428cf294b01a5c06796dfa5d8d60 + docs/models/shared/supplier.md: + id: f468b19e04fe + last_write_checksum: sha1:66a864e4850aa023fd52d01b43185bd794a2059c + pristine_git_object: 3465e1473594035899e495da7a6b8959fbd97c57 + docs/models/shared/supplierprototype.md: + id: f434164de830 + last_write_checksum: sha1:b900f499596fa04de7dfda606162657642a4f91f + pristine_git_object: 789dcb3faa6d188f76bd62c6cebc945cbf1642c7 + docs/models/shared/supplierref.md: + id: 1831afb296b1 + last_write_checksum: sha1:25464f7ba38b5bfaa5696255c3f80b3b9e5b087a + pristine_git_object: 9ac54781a0eacdba39416a2176955ac123bc5345 + docs/models/shared/suppliers.md: + id: 7bbf53a9940c + last_write_checksum: sha1:604da31895c9ace2baad2dba97f7566b3fa481c1 + pristine_git_object: e7cd1343801e1c25ff6cf95a2bcca9264f97b293 + docs/models/shared/supplierstatus.md: + id: fb4ad50793c3 + last_write_checksum: sha1:45be7e03ec068a7a45068a4b937a32fd461ca801 + pristine_git_object: 0374ea9e014e0f0e866fc79ac80390c5d8e30a3e + docs/models/shared/taxratemappingoption.md: + id: 63a29f7a5231 + last_write_checksum: sha1:fff2669dd4bfa5695ff0a290df48fa86a0125572 + pristine_git_object: 3d41d03650c3ff989ae4378d1fcc176a1d84ee3e + docs/models/shared/taxratestatus.md: + id: 893cf5a95186 + last_write_checksum: sha1:ecceeada1e1953415a39fd5730679db722f7eae9 + pristine_git_object: dbdebfe1bf0e07750105584dc9bb5e524a2ce880 + docs/models/shared/trackingref.md: + id: 2ec0eb719b40 + last_write_checksum: sha1:fef3b2a768fd1120032dfac0081ab82c840a699f + pristine_git_object: dd66c64691534f087a6adcf80ccb8288495afde4 + docs/models/utils/retryconfig.md: + id: 4343ac43161c + last_write_checksum: sha1:562c0f21e308ad10c27f85f75704c15592c6929d + pristine_git_object: 69dd549ec7f5f885101d08dd502e25748183aebf + docs/sdks/bankaccounts/README.md: + id: 510ffee224ea + last_write_checksum: sha1:1f506a4a2b5de2da35ea97685f6f36ff540fe53c + pristine_git_object: 821d9513a7dc760ec4e83c3c1ad3492b48430d51 + docs/sdks/billpayments/README.md: + id: 9436cf9c44bd + last_write_checksum: sha1:09e3a33311fcdfd4b697eeb2594c8748b5f3cfbc + pristine_git_object: f047b0862415ac30e7b1995641c4deccdbb72a8f + docs/sdks/bills/README.md: + id: 2a9c97966ab7 + last_write_checksum: sha1:d496d673c61d57b4df2eba3e6915e3615d521907 + pristine_git_object: 41ba038a59dc4302a22cc944881e447b64ce6192 + docs/sdks/companies/README.md: + id: 67e8a49afa67 + last_write_checksum: sha1:cd12a044e2f22c856ae6d9cb60ce51d0b2b243a9 + pristine_git_object: 11511bc79bc23d784965f8d9e3ab7d7f23157b86 + docs/sdks/companyinformation/README.md: + id: 319c7ed51023 + last_write_checksum: sha1:481bac9926be1d469491366a9cf3a54061707e53 + pristine_git_object: 80ce6cb107b71562a4392e645404b556c2db8219 + docs/sdks/connections/README.md: + id: 3ef8931411ea + last_write_checksum: sha1:9cf1016255cc1f2af8d01e45a50dfc508d3281d6 + pristine_git_object: 9dce0e2b9388d83ab5d1cf0622575d0eb2f6bd8c + docs/sdks/suppliers/README.md: + id: 85867190cd79 + last_write_checksum: sha1:b98a17a2c565250a04c5395dae3400b29d722949 + pristine_git_object: f0c1eb59a7f0d3cf30cbb8f0280dd4333901b97a + poetry.toml: + id: a81ade82122a + last_write_checksum: sha1:2242305e29dc6921bdf5b200aea5d4bf67830230 + pristine_git_object: cd3492ac9dc870fdcf23dbd94fd1d40cc753cc8e + py.typed: + id: 258c3ed47ae4 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + pylintrc: + id: 7ce8b9f946e6 + last_write_checksum: sha1:0e10638ea7d22a917f716f609a4c05ca0cd18e91 + pristine_git_object: ba6a998b82e6e5fce3f37f2c3a73b345395d952c + pyproject.toml: + id: 5d07e7d72637 + last_write_checksum: sha1:bf00d1414a4457943c9712941b375948d08f1c48 + pristine_git_object: bcc8837b0b3c780e3e00441a33ad01367ceb7b4f + scripts/prepare_readme.py: + id: e0c5957a6035 + last_write_checksum: sha1:d4b43d576372b8e73925ed9d58899b58d467046e + pristine_git_object: dcc17f2c0382c62850600fe53ed0c2307d37d546 + scripts/publish.sh: + id: fe273b08f514 + last_write_checksum: sha1:b31bafc19c15ab5ea925fdf8d5d4adce2b115a63 + pristine_git_object: 2a3ead70ccc6228cbae1c5c8a319b1399f3804ea + src/codat_sync_for_payables/__init__.py: + id: d37565e7a299 + last_write_checksum: sha1:da077c0bdfcef64a4a5aea91a17292f72fa2b088 + pristine_git_object: 833c68cd526fe34aab2b7e7c45f974f7f4b9e120 + src/codat_sync_for_payables/_hooks/__init__.py: + id: ecdc2078be05 + last_write_checksum: sha1:e3111289afd28ad557c21d9e2f918caabfb7037d + pristine_git_object: 2ee66cdd592fe41731c24ddd407c8ca31c50aec1 + src/codat_sync_for_payables/_hooks/sdkhooks.py: + id: d1b2be05cafa + last_write_checksum: sha1:12c5b8996603ad9a70785fbd98ac54abc4b07dea + pristine_git_object: 6bc2f2e337f4b0d9412015ed72ff76eeced66ae2 + src/codat_sync_for_payables/_hooks/types.py: + id: 2c8c60b7bea8 + last_write_checksum: sha1:cd79ed18d372dae4489b31df1edde9a50dc8681f + pristine_git_object: 4c4a0dfe5d3f88de010120b7cc131799fe918073 + src/codat_sync_for_payables/_version.py: + id: e4b8c113880b + last_write_checksum: sha1:72b92007c8b1e5259040dc2b9b7659257bec1bd5 + pristine_git_object: 2ce03c4917bb9a7b74cacaa68162fc60cb1f0acc + src/codat_sync_for_payables/bank_accounts.py: + id: bffbddbd7457 + last_write_checksum: sha1:c7f1bbdc7a6720380b42146299cc8408dce74fa9 + pristine_git_object: bed160dd6d2bf4438271b78f8773684212bfaffa + src/codat_sync_for_payables/basesdk.py: + id: 1b28cb884887 + last_write_checksum: sha1:44d6d2050de98db82d088dad3f14c99b6209d605 + pristine_git_object: 0ba2366ceb7e99695f1110300ba2bf04ba9d7f7c + src/codat_sync_for_payables/bill_payments.py: + id: 0da608e0b7a7 + last_write_checksum: sha1:705dc78fa7788a9f8dfed0bf41a9decde8b338b7 + pristine_git_object: 9818c8963e8485e22020a00bd3af53bb4d576df5 + src/codat_sync_for_payables/bills.py: + id: aa53d7af4704 + last_write_checksum: sha1:953aa21951a8457d2e08c651a7c4dee0cd37c806 + pristine_git_object: 517497d5c842dbbc8b19cadb57aaf72870509753 + src/codat_sync_for_payables/companies.py: + id: 5ace7f193226 + last_write_checksum: sha1:ce8451c746fb15bcbd9bf41e95c69a6324f78e7b + pristine_git_object: 0dbe0548ab462577e5d856a261d551e911535a0f + src/codat_sync_for_payables/company_information.py: + id: 3fd5cdae8aa4 + last_write_checksum: sha1:ba1d4ca14b50cb5c50a70069c18c64293646b1c4 + pristine_git_object: ccf258f53ee03555eac00b2ac28bf43da5513c43 + src/codat_sync_for_payables/connections.py: + id: 01f416a3fe00 + last_write_checksum: sha1:0f79cb9cfea646156f694806a2d3b9e5042b0f9a + pristine_git_object: e2e3103e8f2ec84ffcea6a197bd49d99e88290f6 + src/codat_sync_for_payables/httpclient.py: + id: e600b8855c02 + last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 + pristine_git_object: 89560b566073785535643e694c112bedbd3db13d + src/codat_sync_for_payables/models/__init__.py: + id: 56ba957bb3ac + last_write_checksum: sha1:fd931d5c2d58b5f9189cc897e038d6d78e362dab + pristine_git_object: 726fc5eb391035492b4bea383d91cb7e23da04d3 + src/codat_sync_for_payables/models/errors/__init__.py: + id: a3dd5e74e4bf + last_write_checksum: sha1:5bc3f8ec8d4990c5f106acd4f6fdad40c5edbf85 + pristine_git_object: 759000d594143ac10940385c0186c560f95ae090 + src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py: + id: 1a07d5f66013 + last_write_checksum: sha1:be24859871d2ae5385e6b8a55149dc0cf3c05879 + pristine_git_object: eb8a5afe0e08965283791f9afa935b6c172981d0 + src/codat_sync_for_payables/models/errors/errormessage.py: + id: f850a22de337 + last_write_checksum: sha1:d55c2903ae80d4f291e60371434ce369ea8eb870 + pristine_git_object: 5e15ab9511923b3e3c12d08f14e8ebc203272bdb + src/codat_sync_for_payables/models/errors/no_response_error.py: + id: 2fdc4d7737bf + last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f + pristine_git_object: 1deab64bc43e1e65bf3c412d326a4032ce342366 + src/codat_sync_for_payables/models/errors/responsevalidationerror.py: + id: f9fce42ac3ff + last_write_checksum: sha1:054ac2f7fbd1900ae92e21faa5f86f454f498682 + pristine_git_object: d6e2f035e9d0eab17ad0923265439969f7f799ef + src/codat_sync_for_payables/models/errors/sdkerror.py: + id: de4745b803c1 + last_write_checksum: sha1:f76359ce296129d3f23831fdb48eeec94b43d2a5 + pristine_git_object: a23569a5be2897d55022d05088dc89f18bffc84c + src/codat_sync_for_payables/models/operations/__init__.py: + id: 70f0b6c286f6 + last_write_checksum: sha1:6f085d0a14260763879448888ab4869f60e713c1 + pristine_git_object: ce074504100cf0e0f66933a98614e8e19f9ab095 + src/codat_sync_for_payables/models/operations/create_bank_account.py: + id: 4525b9326fa6 + last_write_checksum: sha1:4750440c7ec503581525eacccf2dcae7c35d1bae + pristine_git_object: 46a2d30489b35bc4714487aed2dc92224f5af1b5 + src/codat_sync_for_payables/models/operations/create_bill.py: + id: 99105a8f3d7e + last_write_checksum: sha1:66e9e22db95786832c811140e7ec0c70b5539306 + pristine_git_object: 2be21bb53238e9ed9b14163e9c0de2f5671cac0d + src/codat_sync_for_payables/models/operations/create_bill_payment.py: + id: bf7aea17d3b3 + last_write_checksum: sha1:139049a42d8357ca9742c6ebe30a93482266ee5f + pristine_git_object: 0ff27fc4e2d88cfbd0b6241952a1a5f2f7a10515 + src/codat_sync_for_payables/models/operations/create_connection.py: + id: a701a9b9763c + last_write_checksum: sha1:b219a6e09df13411fd19ce271f872a162a2a83b9 + pristine_git_object: b5a1fc96e81f86c9771c19ea5e520062e827ae88 + src/codat_sync_for_payables/models/operations/create_supplier.py: + id: 0090ebf63f3b + last_write_checksum: sha1:764878ace0b71e514013e4d50a0d2b2e1024e82c + pristine_git_object: bf1ea7f0892baff0794546eb5eda5fcf5c77b534 + src/codat_sync_for_payables/models/operations/delete_company.py: + id: 77b581e97ded + last_write_checksum: sha1:5bac319a2b0b8f3ac743a35716767b02666c5a55 + pristine_git_object: efb24dca644ffd2e807cbcdee86976ab51ab1ff5 + src/codat_sync_for_payables/models/operations/delete_connection.py: + id: dd6618164664 + last_write_checksum: sha1:1e4c580e12ebf0e4d5d4074a7dfb43662c81998e + pristine_git_object: cdaa556cdc35f08a29da2ad062bd0d62583f68b6 + src/codat_sync_for_payables/models/operations/download_bill_attachment.py: + id: 2b32e3e50f3f + last_write_checksum: sha1:d71c718924b138c14fd9296659dc4e933031863e + pristine_git_object: c22442f7c8703108d8205c91f2d887cf9ea093c5 + src/codat_sync_for_payables/models/operations/get_company.py: + id: 50a6c6dbf91d + last_write_checksum: sha1:9c546c564a9840d46bb2a286011098c4307931e7 + pristine_git_object: 67ba39ebb1f701417a06ebcff59d197a250ff92f + src/codat_sync_for_payables/models/operations/get_company_information.py: + id: b36e4a3195b1 + last_write_checksum: sha1:26e05475523ba2985600a6918ca565a76ae20c7b + pristine_git_object: 6844e678997a74312f35ff2080fe31ccb6ff185b + src/codat_sync_for_payables/models/operations/get_connection.py: + id: f0aca8a05d74 + last_write_checksum: sha1:9e727f477ded727cedfe496d67ef61f85d245f37 + pristine_git_object: 3dee0e6e12d4e4e45db51649aa91fe1f1ab2d511 + src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py: + id: d667f4268283 + last_write_checksum: sha1:44b2fbe718a8b0669affc679c206c7c740283ab9 + pristine_git_object: 98de06231476a72399edf713e84d7a3f1d4dae28 + src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py: + id: ae4fecc1f648 + last_write_checksum: sha1:f12a4808116ad28cbe0fd38a6352c754127800fd + pristine_git_object: ebd62e46374d947f5dec4999d83c491aa70d5468 + src/codat_sync_for_payables/models/operations/list_bill_attachments.py: + id: 1c43f8cab2f3 + last_write_checksum: sha1:e054dc28384ca0532701d08cfc6a3476074f045b + pristine_git_object: 077e7104aa5caa70cbb00242cc991653363df0cb + src/codat_sync_for_payables/models/operations/list_bills.py: + id: 35912db3ca34 + last_write_checksum: sha1:4a9a55f0e03aa6be610708ce25c0aa2f3f176a2d + pristine_git_object: 08602e4b80bbbdc67863972fbbbbaab4a8c95682 + src/codat_sync_for_payables/models/operations/list_companies.py: + id: 74a9ee83bc93 + last_write_checksum: sha1:519aced0ff1a3d27570da509fa9d586e3fc1ea96 + pristine_git_object: 443b275ade4e6989ad5feded83fb857e00abec74 + src/codat_sync_for_payables/models/operations/list_connections.py: + id: 4a0b8926f5ce + last_write_checksum: sha1:82e72af131da5768e04e011d68d1087dc5061d8b + pristine_git_object: 7b0f6c50460786f70252873e60158b93b73c1911 + src/codat_sync_for_payables/models/operations/list_suppliers.py: + id: cc76bd3ac323 + last_write_checksum: sha1:cc52de3796fd2c3b966b98d82cb76a44ee42d17b + pristine_git_object: c2d6d5397879c6e1faacefc732409565f4840f2b + src/codat_sync_for_payables/models/operations/replace_company.py: + id: 01092190cace + last_write_checksum: sha1:7a64e9bdcbb973863fdf45a75a379357472a3b15 + pristine_git_object: b9bf9a37a063bcc56fa8c5dc2f103e2ccd947acd + src/codat_sync_for_payables/models/operations/unlink_connection.py: + id: f82efd60b973 + last_write_checksum: sha1:a2d3a6159258d157e923a7f4e44eadca5427c624 + pristine_git_object: d4e3261e779ba3486d6236961c356d4ce8972316 + src/codat_sync_for_payables/models/operations/update_bill.py: + id: 90a1490b17ed + last_write_checksum: sha1:323cfb153dfc6de5a70f0346c89a347f00142a6c + pristine_git_object: eada756836f689385112fe3c6abc353cd745733f + src/codat_sync_for_payables/models/operations/update_company.py: + id: 339eed3aa3c6 + last_write_checksum: sha1:8ee00f29a74bcf701016f1ee70d76f3f3539519d + pristine_git_object: 707e4d029583e3c8759416d7d3a4fc54909e985c + src/codat_sync_for_payables/models/operations/upload_bill_attachment.py: + id: 2927ff42c4c4 + last_write_checksum: sha1:40e2b5ce6f320b5cb4c7d85cdf9972bffafcd5e5 + pristine_git_object: 8fdc88788172fee4bd97b87acebac239df0bb97a + src/codat_sync_for_payables/models/shared/__init__.py: + id: 6972bb31b96d + last_write_checksum: sha1:00755dd767e9e85147d66f140348608c3d62691c + pristine_git_object: 096b152f8e892a5094becb15cbde9e24cc8a4897 + src/codat_sync_for_payables/models/shared/accountmappingoption.py: + id: e4677bacb499 + last_write_checksum: sha1:3258ad9d7329fc53c7c6a2f899e7b2bac4311017 + pristine_git_object: 9452401d9f41b79a05cd47948a135239de2c8648 + src/codat_sync_for_payables/models/shared/accountstatus.py: + id: b6f182ad7817 + last_write_checksum: sha1:cfaae21d693d501014a9494c09374150bdad41c4 + pristine_git_object: 5f3a1eff95ed42ede68dbb0eb7a4c5dab436c2fb + src/codat_sync_for_payables/models/shared/address.py: + id: faeec6e0f48a + last_write_checksum: sha1:818394b6495637c7bd7ac7e69de4d7b3a7207f83 + pristine_git_object: bd9a6331f4b3e7cd0a572d21b8372dc274a397f8 + src/codat_sync_for_payables/models/shared/addresstype.py: + id: 19266012cf06 + last_write_checksum: sha1:4d9bc1d12623aaafe7c9846e024aa21aaf4f1993 + pristine_git_object: 05cc759d845b07db4e5610b47cb01063b884c616 + src/codat_sync_for_payables/models/shared/attachment.py: + id: 3d02a33627d2 + last_write_checksum: sha1:76988a172db20fa619033364c0f82339ec24854c + pristine_git_object: 5b3431359513b8ed998ef531aa0186b1fa367525 + src/codat_sync_for_payables/models/shared/attachmentupload.py: + id: 55929cc18c9a + last_write_checksum: sha1:343c737a3c707363de8493bb3016adea6fcec1a1 + pristine_git_object: b53e491ed1a340d19cb381554184708e7665d41d + src/codat_sync_for_payables/models/shared/bankaccount.py: + id: e665dfd66dba + last_write_checksum: sha1:d1d08b703c5647e36eb2904836f4d45d2d8b9cbb + pristine_git_object: fc5c124a0c8f8ca86ed00897bd85fefa1d0f20c4 + src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py: + id: 5c0dcc75e914 + last_write_checksum: sha1:97f4415c7f8942b102c6a43796c23e10dcfb3ce4 + pristine_git_object: c1a0b741253b7284569ef8f08df77ea4c70e76e6 + src/codat_sync_for_payables/models/shared/bankaccountprototype.py: + id: 64d8fb7eda62 + last_write_checksum: sha1:d2b7c54f046f8355a9104f4830d05b522721d39d + pristine_git_object: b24e6b7f6be6f1e0f6c39a7dd5eb99140d31c892 + src/codat_sync_for_payables/models/shared/bankaccountstatus.py: + id: 4c95c6bee724 + last_write_checksum: sha1:9231807b4addd286d92ef679f69757b96b8ea24b + pristine_git_object: 7db2675192e70e8c226f4091816adfa98f7cdf0c + src/codat_sync_for_payables/models/shared/bankaccounttype.py: + id: 7a88387c793d + last_write_checksum: sha1:962bfe403dfc28aa87dc64e00771b5a45c3905b3 + pristine_git_object: 9eecbae47cec78320d4a451e1c9bcc3ebaaa48c6 + src/codat_sync_for_payables/models/shared/bill.py: + id: cabb1e64030e + last_write_checksum: sha1:0e5b77185e592e88d9b169a2ec9adad4afab52a2 + pristine_git_object: 0bfde2a06dea8cb88dde9e10a7863843a304546e + src/codat_sync_for_payables/models/shared/billaccountref.py: + id: 412568e0a90d + last_write_checksum: sha1:ad24a0acccb37c5923ade2685b9635b12e9d178a + pristine_git_object: 4b7ee1f2ceae68dcc3a53540f11b2454d97005de + src/codat_sync_for_payables/models/shared/billlineitem.py: + id: f56d6d3a6fec + last_write_checksum: sha1:9c8e4ee713b25bdad84b98468cc1466f032215f2 + pristine_git_object: 3c497ec630d67bf2a6e60b0c993fba29dd22bfc3 + src/codat_sync_for_payables/models/shared/billmappingoptions.py: + id: aa86d07aa6f8 + last_write_checksum: sha1:f37f6977c323b9a49a798a6f65c955db70ffb82e + pristine_git_object: 3a4201bde6ae45df1bc5fedf6690e2f1ce02c200 + src/codat_sync_for_payables/models/shared/billpayment.py: + id: 3a75c5fee756 + last_write_checksum: sha1:1925d854655bcd0af581895a53cf2053b77682f4 + pristine_git_object: 6e49d8d46d29323bb6598d1e00e5733bb1ed6b5c + src/codat_sync_for_payables/models/shared/billpaymentaccountref.py: + id: 734ac9a03d8a + last_write_checksum: sha1:d98bde7ae1af1bd16841975d1f87a3804056412d + pristine_git_object: 1f0115564a983236e929218bd8bb1e0f4b1256fb + src/codat_sync_for_payables/models/shared/billpaymentprototype.py: + id: 9de5b7f9bd13 + last_write_checksum: sha1:48a29e7347d7b3cbc43db8446fcd4458f6d706f1 + pristine_git_object: 249d545e65930aa419000058511fe0e6deea8997 + src/codat_sync_for_payables/models/shared/billprototype.py: + id: 32e5a78c3c18 + last_write_checksum: sha1:6827a1fddf811db8980e717e974dd7d512a4650c + pristine_git_object: 06e4da1c205fc6fc488209edb696bd0809891626 + src/codat_sync_for_payables/models/shared/bills.py: + id: 3290a493e4d6 + last_write_checksum: sha1:bfc11655e7e069af836ecb383d60fd0c00bfd0dc + pristine_git_object: f70b0ae7e8f526f34cab3ffbe007043e33a1bb8f + src/codat_sync_for_payables/models/shared/billstatus.py: + id: 3f201be3863a + last_write_checksum: sha1:6acdf0f006ed8e7b9c76195eddaa7cb09ac5b6f2 + pristine_git_object: fcd1b5e91d8a8a37c4cbd7b1244bc6368750f218 + src/codat_sync_for_payables/models/shared/billtaxrateref.py: + id: f309bc18729f + last_write_checksum: sha1:a485a18a58002830ab67bf8ecde4e1e1e9321bb5 + pristine_git_object: d78556c2be2ea101f6b8980915f85cfbfe378ae3 + src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py: + id: 689400e4cd03 + last_write_checksum: sha1:8fb1961d4fcb2d49d39fecf47f6885ddf972516a + pristine_git_object: d0ba137f7b7d7b9a1bf05b3f712e65dccc0b193c + src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py: + id: 0ad79ee918ad + last_write_checksum: sha1:589b3838e9ef7be96e5799316f5a7afb222098d7 + pristine_git_object: 7231884f89a4d29a0a72e7b933eea22e2753f692 + src/codat_sync_for_payables/models/shared/codatfile.py: + id: f9604dae6b8c + last_write_checksum: sha1:fa4d1a990a132ed6dc97d775c944dc3978dfae8f + pristine_git_object: 0dd6f13328b62683a2b40235e6b7c753978f0d2a + src/codat_sync_for_payables/models/shared/companies.py: + id: f09e61bdb80f + last_write_checksum: sha1:4a9a19453e66b722ad408336124c45d364b3b26c + pristine_git_object: d8e8333437683971b23a27737e6006cf56625fda + src/codat_sync_for_payables/models/shared/company.py: + id: 5a28ec5e8ee4 + last_write_checksum: sha1:7aaf457448ab6884bf0ce648e271b804e0bd1417 + pristine_git_object: 79700c99db73f77fe413e3ad835fc1dcd15891ef + src/codat_sync_for_payables/models/shared/companyinformation.py: + id: 6afe4824533c + last_write_checksum: sha1:280b4c617e1e164e668dcf68f3f6eb392284913a + pristine_git_object: 31e5af9bd67e9c120954c9760b50166cb4d7f6b4 + src/codat_sync_for_payables/models/shared/companyreference.py: + id: d74ae4f4438e + last_write_checksum: sha1:bc00dbf7993e87a2bb07efe8fc063ebfd3d3be51 + pristine_git_object: e76bb64c374e4fc67dda5249232cf22cf6d9122d + src/codat_sync_for_payables/models/shared/companyrequestbody.py: + id: 4136bb038290 + last_write_checksum: sha1:a8d91978e4670dd0dd485b94b153d3abf5f6eade + pristine_git_object: ba0413dabe3ddc1ce883f8cec1511af8782499d1 + src/codat_sync_for_payables/models/shared/companyupdaterequest.py: + id: 5a93243b1892 + last_write_checksum: sha1:9130462040edc27aa6d40ed4dc748b70ab59379a + pristine_git_object: 46e89fef67e95c4c595e68c2db002dc4ab520b11 + src/codat_sync_for_payables/models/shared/connection.py: + id: 8ce8180ca8b0 + last_write_checksum: sha1:02576db0f088813ae5938aaf192ecb00eda91f4e + pristine_git_object: 9ebfccc2c32c7fce179b36df9614d63cc7ee3e88 + src/codat_sync_for_payables/models/shared/connections.py: + id: 2646a209fbb8 + last_write_checksum: sha1:dd4bb8ef70d8e9d082dc7343ef0b8f3db36ffeb0 + pristine_git_object: 2e1df73d5e2266556834cd054b2546fe1a812472 + src/codat_sync_for_payables/models/shared/dataconnectionerror.py: + id: 14e59669ba9a + last_write_checksum: sha1:80ceb083756614d7007969218ae05f72544aadc4 + pristine_git_object: a875b724a88259864067f2e86072eeaae6041171 + src/codat_sync_for_payables/models/shared/dataconnectionstatus.py: + id: bcaf92975c32 + last_write_checksum: sha1:7acc81f8f37f266c26a45828d3b5bf2cb63c3b5d + pristine_git_object: a97f7be301fae66aed392cc85bbec15fa366e2aa + src/codat_sync_for_payables/models/shared/errorvalidation.py: + id: 6977a6a7b249 + last_write_checksum: sha1:c0de9c8da912b5ba301c66433ad452697726bc6e + pristine_git_object: 4b5f24f6c8f88d69e4a1ff23618b662dac559013 + src/codat_sync_for_payables/models/shared/errorvalidationitem.py: + id: 173355e5b55d + last_write_checksum: sha1:ec4ab9840505d58eb1435d0b95c14b07128056d7 + pristine_git_object: 0722479ccfe13553a9d3873be34b60656b5cdf2e + src/codat_sync_for_payables/models/shared/halref.py: + id: 532c60632649 + last_write_checksum: sha1:b2dc44eed9d319a32d02c66bda1d04b61b791a52 + pristine_git_object: 3633c6fa9051b4ff917cd70f97daa222af713c5d + src/codat_sync_for_payables/models/shared/links.py: + id: 13ee5bbb9db5 + last_write_checksum: sha1:f233812fe506946a59db9333b0678c2877d9e529 + pristine_git_object: 76e148720d7bfba2bedc869374301033f6583337 + src/codat_sync_for_payables/models/shared/pagination.py: + id: d5bc974bdb7d + last_write_checksum: sha1:bea4c13d26f293c5ba7e5fe9d987c90c0575f069 + pristine_git_object: ebd4d9d33a4f42aa3068c40c9c4e5de2369f04fc + src/codat_sync_for_payables/models/shared/paymentmappingoptions.py: + id: 99539a6db928 + last_write_checksum: sha1:b09f9ea2fd1fc5a800d4d50680d2982b41eb2c0f + pristine_git_object: e84f5a096efc20f39db5836556454b54604008a9 + src/codat_sync_for_payables/models/shared/security.py: + id: 883a7abd2f0c + last_write_checksum: sha1:b0458c9c1f6970202910888bebc547e35514e722 + pristine_git_object: 33927c43a80956cfb8eb45ac850a60f3389542ef + src/codat_sync_for_payables/models/shared/supplier.py: + id: 30f1b1bf4292 + last_write_checksum: sha1:63c1f5e94601f99e7f9f2e6f1f6d5fd7ed404679 + pristine_git_object: 16bb52a8b3bcac8097f081a3707e41a9a476fa75 + src/codat_sync_for_payables/models/shared/supplierprototype.py: + id: ba52e495b022 + last_write_checksum: sha1:2ab9e9fe49b38605ef18cab0bb6be306c2de8060 + pristine_git_object: 248e452a625a2f640b40eee2af1106b7510ea237 + src/codat_sync_for_payables/models/shared/supplierref.py: + id: e54006e90d54 + last_write_checksum: sha1:b538799b98d557da971efd4ac9d0689fec8bc39d + pristine_git_object: bef54f97c786a782360fa081bb7d7cde5a375257 + src/codat_sync_for_payables/models/shared/suppliers.py: + id: f87c0164ec82 + last_write_checksum: sha1:239ed884c33cb087646a7dc06527f8d6a283f35e + pristine_git_object: 8cd43943f671e7f9568826760c57ddeb0d74744d + src/codat_sync_for_payables/models/shared/supplierstatus.py: + id: bd32a169fd45 + last_write_checksum: sha1:40fbb3969f650a2e9e44d161449b2657ec71afd6 + pristine_git_object: 0f77858378e92bc4a21c9a82ea0b496b8211230d + src/codat_sync_for_payables/models/shared/taxratemappingoption.py: + id: 10e31d5cebf5 + last_write_checksum: sha1:20e84414a880a8cf63378fceff08430e64371d66 + pristine_git_object: ffc4c9033a4c7a93722b4c37defb6fc50f3f9e64 + src/codat_sync_for_payables/models/shared/trackingref.py: + id: 7065b1aa899a + last_write_checksum: sha1:b01eb094f18c3f2674e155e010cd04b5eaa83ae7 + pristine_git_object: 640672745c98538ce9a6ea6aa205719cd51594d0 + src/codat_sync_for_payables/py.typed: + id: 7a7b03c9ffd7 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + src/codat_sync_for_payables/sdk.py: + id: 13da5a8039c6 + last_write_checksum: sha1:0a8cb3a5e7e442c5b499eec54f3d1f8700efac49 + pristine_git_object: 19182eedccab9d48f09622a7ea84ca067814d605 + src/codat_sync_for_payables/sdkconfiguration.py: + id: 044ad0fd5a07 + last_write_checksum: sha1:04312be47d6b76e345a2a63e80a7c6215e0c8a52 + pristine_git_object: 49269e53b7e7d876fee7cc040430f49c79990734 + src/codat_sync_for_payables/suppliers.py: + id: 8e23d8bbbb4e + last_write_checksum: sha1:103d8f0ed0021c1cd04df9aedd095f85e8acae39 + pristine_git_object: fc8e95a552d5963e508ac01cf5c31fd36f38c462 + src/codat_sync_for_payables/types/__init__.py: + id: 36f0e2eb152f + last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed + pristine_git_object: fc76fe0c5505e29859b5d2bb707d48fd27661b8c + src/codat_sync_for_payables/types/basemodel.py: + id: 667dff5631eb + last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 + pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee + src/codat_sync_for_payables/utils/__init__.py: + id: 385b9de7dfb1 + last_write_checksum: sha1:a1f6ae620fb6a3ccc30e99b427e49a0c8be463af + pristine_git_object: 15394a08a7e30033d319e44dd5734664ddb587e5 + src/codat_sync_for_payables/utils/annotations.py: + id: 199c1954e61b + last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc + pristine_git_object: 12e0aa4f1151bb52474cc02e88397329b90703f6 + src/codat_sync_for_payables/utils/datetimes.py: + id: 171f23462723 + last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341 + pristine_git_object: a6c52cd61bbe2d459046c940ce5e8c469f2f0664 + src/codat_sync_for_payables/utils/enums.py: + id: 8fea592b7493 + last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d + pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 + src/codat_sync_for_payables/utils/eventstreaming.py: + id: e199330f499e + last_write_checksum: sha1:ffa870a25a7e4e2015bfd7a467ccd3aa1de97f0e + pristine_git_object: f2052fc22d9fd6c663ba3dce019fe234ca37108b + src/codat_sync_for_payables/utils/forms.py: + id: c8b2e1537bcd + last_write_checksum: sha1:15fa7e9ab1611e062a9984cf06cb20969713d295 + pristine_git_object: f961e76beaf0a8b1fe0dda44754a74eebd3608e7 + src/codat_sync_for_payables/utils/headers.py: + id: ff40ec647e98 + last_write_checksum: sha1:7c6df233ee006332b566a8afa9ce9a245941d935 + pristine_git_object: 37864cbbbc40d1a47112bbfdd3ba79568fc8818a + src/codat_sync_for_payables/utils/logger.py: + id: 8392818c1be2 + last_write_checksum: sha1:f3fdb154a3f09b8cc43d74c7e9c02f899f8086e4 + pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 + src/codat_sync_for_payables/utils/metadata.py: + id: 279791e309e3 + last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 + pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d + src/codat_sync_for_payables/utils/queryparams.py: + id: 7fab68be229a + last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 + pristine_git_object: c04e0db82b68eca041f2cb2614d748fbac80fd41 + src/codat_sync_for_payables/utils/requestbodies.py: + id: c47ad4a91d5f + last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 + pristine_git_object: 1de32b6d26f46590232f398fdba6ce0072f1659c + src/codat_sync_for_payables/utils/retries.py: + id: e5ae3a416299 + last_write_checksum: sha1:5b97ac4f59357d70c2529975d50364c88bcad607 + pristine_git_object: 88a91b10cd2076b4a2c6cff2ac6bfaa5e3c5ad13 + src/codat_sync_for_payables/utils/security.py: + id: 90581f8feeee + last_write_checksum: sha1:435dd8b180cefcd733e635b9fa45512da091d9c0 + pristine_git_object: 17996bd54b8624009802fbbdf30bcb4225b8dfed + src/codat_sync_for_payables/utils/serializers.py: + id: aa9163915e56 + last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 + pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 + src/codat_sync_for_payables/utils/unmarshal_json_response.py: + id: ed38d0c2bb4d + last_write_checksum: sha1:38941bbf58b0ef166d94fd0f7d79b1962bedf5c3 + pristine_git_object: 0394c9ff42fa85617c00581ca88a964baa142cdf + src/codat_sync_for_payables/utils/url.py: + id: c0bcd317d401 + last_write_checksum: sha1:6479961baa90432ca25626f8e40a7bbc32e73b41 + pristine_git_object: c78ccbae426ce6d385709d97ce0b1c2813ea2418 + src/codat_sync_for_payables/utils/values.py: + id: 7b55e25505a2 + last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 + pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 examples: list-companies: - "": + speakeasy-default-list-companies: parameters: query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}]}]}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} One company: parameters: query: @@ -267,9 +920,10 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} + application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} List of Companies: parameters: query: @@ -277,9 +931,10 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} + application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "products": ["spend-insights", "lending", "payables-v2"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["lending", "spend-insights", "payables"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} Malformed query: parameters: query: @@ -287,9 +942,12 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: query: @@ -297,45 +955,53 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-company: With no description: requestBody: - application/json: {"name": "Technicalium", "description": "Requested early access to the new financing scheme."} + application/json: {"name": "Technicalium"} responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} With a description: requestBody: application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} With a tag: requestBody: application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} Malformed query: requestBody: application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-company: + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + replace-company: Update name: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" requestBody: - application/json: {"name": "New Name", "description": "Requested early access to the new financing scheme."} + application/json: {"name": "New Name"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": {} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} Update description: parameters: path: @@ -344,8 +1010,11 @@ examples: application/json: {"name": "Same name", "description": "Additional documents required"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": {} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: @@ -355,22 +1024,73 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-company: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-replace-company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} + responses: + "200": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} + update-company: + Update tags: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"tags": {"refrence": "new reference"}} + responses: + "200": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} + Update name: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "New Name"} + responses: + "200": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company: - Simple company: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-update-company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} + delete-company: Unauthorized: parameters: path: @@ -378,22 +1098,50 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-delete-company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {} + "500": + application/json: {} + get-company: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": []} Parent multi-entity company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} Subsidiary multi-entity company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} + application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} list-connections: - "": + speakeasy-default-list-connections: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" @@ -404,8 +1152,11 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}]}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} Connections: parameters: path: @@ -430,6 +1181,8 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: path: @@ -442,6 +1195,8 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-connection: Connection: parameters: @@ -451,7 +1206,7 @@ examples: application/json: {"platformKey": "gbol"} responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}]} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} Unauthorized: parameters: path: @@ -461,6 +1216,8 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} get-connection: Connection: parameters: @@ -469,7 +1226,7 @@ examples: connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}]} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} Unauthorized: parameters: path: @@ -478,6 +1235,8 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} delete-connection: Unauthorized: parameters: @@ -487,6 +1246,18 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-delete-connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {} + "500": + application/json: {} unlink-connection: Example: parameters: @@ -497,8 +1268,11 @@ examples: application/json: {"status": "Unlinked"} responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: @@ -507,6 +1281,20 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-unlink-connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + "401": + application/json: {} + "500": + application/json: {} get-company-information: Company information: parameters: @@ -524,8 +1312,10 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} get-mapping-options-bills: - "": + speakeasy-default-get-mapping-options-bills: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" @@ -535,8 +1325,11 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"accounts": [], "taxRates": []} - "400": {} + application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "610", "name": "Accounts Payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515"}]} + "400": + application/json: {} + "500": + application/json: {} Mapping options: parameters: path: @@ -547,7 +1340,7 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "879-i", "name": "Accounts payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515", "name": "VAT @ 20%", "code": "VAT20", "effectiveTaxRate": 20, "totalTaxRate": 20, "status": "Active"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} + application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "879-i", "name": "Accounts payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00.000Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515", "name": "VAT @ 20%", "code": "VAT20", "effectiveTaxRate": 20, "totalTaxRate": 20, "status": "Active"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} Malformed query: parameters: path: @@ -559,6 +1352,8 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} list-bills: Status (open): parameters: @@ -570,8 +1365,11 @@ examples: query: "status=Open" responses: "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "USD", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Status (partially paid): parameters: path: @@ -582,8 +1380,11 @@ examples: query: "status=PartiallyPaid" responses: "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "EUR", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Source modified date: parameters: path: @@ -594,8 +1395,11 @@ examples: query: "sourceModifiedDate>2023-12-15T00:00:00.000Z" responses: "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "USD", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "EUR", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Status (open) & source modified date: parameters: path: @@ -606,8 +1410,11 @@ examples: query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open" responses: "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "USD", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Status (partially paid) & source modified date: parameters: path: @@ -618,8 +1425,11 @@ examples: query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid" responses: "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "EUR", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Bills: parameters: path: @@ -629,7 +1439,7 @@ examples: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" responses: "200": - application/json: {"results": [{"id": "18", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": "1,", "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Open", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "22", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Paid", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} + application/json: {"results": [{"id": "18", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Open", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "22", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Paid", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} Malformed query: parameters: path: @@ -640,6 +1450,8 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: path: @@ -650,70 +1462,116 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-bill: Create bill: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}}], "status": "Open"} + application/json: {"reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} responses: "201": - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "USD", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": {} + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} Created bill: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "EUR", "status": "Open"} + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open"} responses: "201": - application/json: {"id": "bill-1029932", "reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}}], "status": "Open", "totalAmount": 7267.2, "amountDue": 7267.2, "sourceModifiedDate": "2022-10-23T00:00:00Z"} + application/json: {"id": "bill-1029932", "reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7267.2, "amountDue": 7267.2} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "EUR", "status": "Open"} + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open"} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - upload-bill-attachment: + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + update-bill: + Update bill: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "200": + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} + Updated bill: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "200": + application/json: {"id": "bill-1029932", "reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7800, "amountDue": 7800} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + upload-bill-attachment: Attachment metadata: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" responses: "201": application/json: {"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} list-bill-attachments: - Info: + Success: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" responses: "200": - application/json: {"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"} + application/json: [{"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "20cfd269-2f0f-44ef-a28c-7b5f725cf1aa", "name": "another_receipt.png", "contentType": "image/png", "dateCreated": "2022-10-24T00:00:00.000Z", "fileSize": 98, "includeWhenSent": true, "sourceModifiedDate": "2022-05-27T12:38:10Z"}] Unauthorized: parameters: path: @@ -723,28 +1581,37 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Attachments: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + download-bill-attachment: + Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: - "200": - application/json: [{"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "20cfd269-2f0f-44ef-a28c-7b5f725cf1aa", "name": "another_receipt.png", "contentType": "image/png", "dateCreated": "2022-10-24T00:00:00.000Z", "fileSize": 98, "includeWhenSent": true, "sourceModifiedDate": "2022-05-27T12:38:10Z"}] - download-bill-attachment: - Unauthorized: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-download-bill-attachment: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: + "200": + application/octet-stream: "x-file: example.file" "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + application/json: {} + "500": + application/json: {} get-mapping-options-payments: - "": + speakeasy-default-get-mapping-options-payments: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" @@ -754,8 +1621,11 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Mapping options: parameters: path: @@ -766,7 +1636,7 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "accountNumber": "12345678", "nominalCode": "1234567", "sortCode": "123456", "currency": "GBP", "status": "Active", "accountType": "Debit", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} + application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "accountNumber": "12345678", "nominalCode": "1234567", "sortCode": "123456", "currency": "GBP", "status": "Active", "accountType": "Debit", "sourceModifiedDate": "2022-10-23T00:00:00.000Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} Malformed query: parameters: path: @@ -778,27 +1648,30 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-bill-payment: Bill payment example: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" - header: {} + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" requestBody: application/json: {"amount": 22, "date": "2022-10-23T00:00:00.000Z", "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": "7bda9f44sr56"}, "currencyRate": 1} responses: "201": application/json: {"amount": 22, "date": "2022-10-23T00:00:00.000Z", "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": "9e32cbf8-e7d5-4d4d-a593-08d550682aab"}, "currencyRate": 1} - "400": {} + "400": + application/json: {} + "500": + application/json: {} Bill payment: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "7110701885" - header: {} + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" requestBody: application/json: {"amount": 1329.54, "date": "2022-10-23T00:00:00Z", "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": ""}} responses: @@ -809,13 +1682,14 @@ examples: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" - header: {} + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" requestBody: application/json: {"amount": 1329.54, "date": "2022-10-23T00:00:00Z", "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": ""}} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} list-suppliers: Source modified date: parameters: @@ -828,7 +1702,10 @@ examples: responses: "200": application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + "400": + application/json: {} + "500": + application/json: {} Status (active): parameters: path: @@ -840,7 +1717,10 @@ examples: responses: "200": application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + "400": + application/json: {} + "500": + application/json: {} Status (archived): parameters: path: @@ -852,7 +1732,10 @@ examples: responses: "200": application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + "400": + application/json: {} + "500": + application/json: {} Status (active) & source modified date: parameters: path: @@ -864,7 +1747,10 @@ examples: responses: "200": application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + "400": + application/json: {} + "500": + application/json: {} Status (archived) & source modified date: parameters: path: @@ -876,7 +1762,10 @@ examples: responses: "200": application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": {} + "400": + application/json: {} + "500": + application/json: {} Suppliers: parameters: path: @@ -897,6 +1786,8 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: path: @@ -907,67 +1798,282 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-supplier: Suppliers: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: application/json: {"supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GBR", "postalCode": "EC1N 7TE"}], "status": "Active", "defaultCurrency": "GBP"} responses: "201": - application/json: {"id": "sup-10933920", "supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + application/json: {"id": "sup-10933920", "supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "status": "Active", "defaultCurrency": "GBP"} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"supplierName": "", "phone": "(877) 492-8687", "status": "Active"} + application/json: {"supplierName": "", "phone": "+44 25691 154789", "status": "Unknown"} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-bank-account: Bank account example: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: application/json: {"nominalCode": "22", "name": "Plutus - Payables - Bank Account 12", "accountType": "Debit", "accountNumber": "0120 0440", "sortCode": "50-50-50", "currency": "GBP"} responses: "201": - application/json: {"currency": "USD", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": {} + application/json: {"currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"name": "", "accountType": "Credit", "accountNumber": "", "currency": "GBP"} + application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - client.rateLimit.reached: - Reached: - requestBody: - application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "client.rateLimit.reached", "generatedDate": "2024-09-01T00:00:00Z", "payload": {"dailyQuota": 12000, "quotaRemaining": 0, "expiryDate": "2024-09-01T12:14:14Z"}} - client.rateLimit.reset: - Reset: - requestBody: - application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "client.rateLimit.reset", "generatedDate": "2024-09-01T00:00:00Z", "payload": {"dailyQuota": 12000, "quotaRemaining": 11993, "expiryDate": "2024-09-01T23:59:99Z"}} - Client rate limit reached: - speakeasy-default-client-rate-limit-reached: - requestBody: - application/json: {"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "ClientName": "Bank of Dave", "RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "RuleType": "Rate Limit Reached", "AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e", "Message": "The current daily rate limit quota of 1000 requests for bae71d36-ff47-420a-b4a6-f8c9ddf41140 has been reached.", "Data": {"DailyQuota": 1000, "ExpiresUtc": "2022-10-23T00:00:00Z"}} - Client rate limit reset: - speakeasy-default-client-rate-limit-reset: + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-create-bank-account: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" requestBody: - application/json: {"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "ClientName": "Bank of Dave", "RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "RuleType": "Rate Limit Reset", "AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e", "Message": "The current daily rate limit quota for client 30e0f9d2-52c0-4c9f-a806-bcd98a3bcd7e has been reset to 1000 requests.", "Data": {"QuotaRemaining": 1000, "ResetReason": "The quota was reset because it is a new day.", "DailyQuota": 1000, "ExpiresUtc": "2022-10-23T00:00:00Z"}} + application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} + responses: + "201": + application/json: {"currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} +examplesVersion: 1.0.2 generatedTests: {} +generatedFiles: + - .gitattributes + - .python-version + - .vscode/settings.json + - CONTRIBUTING.md + - USAGE.md + - docs/models/errors/errormessage.md + - docs/models/operations/createbankaccountrequest.md + - docs/models/operations/createbillpaymentrequest.md + - docs/models/operations/createbillrequest.md + - docs/models/operations/createconnectionrequest.md + - docs/models/operations/createconnectionrequestbody.md + - docs/models/operations/createsupplierrequest.md + - docs/models/operations/deletecompanyrequest.md + - docs/models/operations/deleteconnectionrequest.md + - docs/models/operations/downloadbillattachmentrequest.md + - docs/models/operations/getcompanyinformationrequest.md + - docs/models/operations/getcompanyrequest.md + - docs/models/operations/getconnectionrequest.md + - docs/models/operations/getmappingoptionsbillsrequest.md + - docs/models/operations/getmappingoptionspaymentsrequest.md + - docs/models/operations/listbillattachmentsrequest.md + - docs/models/operations/listbillsrequest.md + - docs/models/operations/listcompaniesrequest.md + - docs/models/operations/listconnectionsrequest.md + - docs/models/operations/listsuppliersrequest.md + - docs/models/operations/unlinkconnectionrequest.md + - docs/models/operations/unlinkconnectionupdateconnection.md + - docs/models/operations/updatecompanyrequest.md + - docs/models/operations/uploadbillattachmentrequest.md + - docs/models/shared/accountmappingoption.md + - docs/models/shared/accountstatus.md + - docs/models/shared/address.md + - docs/models/shared/addresstype.md + - docs/models/shared/attachment.md + - docs/models/shared/attachmentupload.md + - docs/models/shared/bankaccount.md + - docs/models/shared/bankaccountmappingoption.md + - docs/models/shared/bankaccountprototype.md + - docs/models/shared/bankaccountstatus.md + - docs/models/shared/bankaccounttype.md + - docs/models/shared/bill.md + - docs/models/shared/billaccountref.md + - docs/models/shared/billlineitem.md + - docs/models/shared/billmappingoptions.md + - docs/models/shared/billpayment.md + - docs/models/shared/billpaymentaccountref.md + - docs/models/shared/billpaymentprototype.md + - docs/models/shared/billprototype.md + - docs/models/shared/bills.md + - docs/models/shared/billstatus.md + - docs/models/shared/billtaxrateref.md + - docs/models/shared/clientratelimitreachedwebhook.md + - docs/models/shared/clientratelimitreachedwebhookdata.md + - docs/models/shared/clientratelimitresetwebhook.md + - docs/models/shared/clientratelimitresetwebhookdata.md + - docs/models/shared/clientratelimitwebhook.md + - docs/models/shared/clientratelimitwebhookpayload.md + - docs/models/shared/codatfile.md + - docs/models/shared/companies.md + - docs/models/shared/company.md + - docs/models/shared/companyinformation.md + - docs/models/shared/companyreference.md + - docs/models/shared/companyreferencelinks.md + - docs/models/shared/companyrequestbody.md + - docs/models/shared/connection.md + - docs/models/shared/connections.md + - docs/models/shared/dataconnectionerror.md + - docs/models/shared/dataconnectionstatus.md + - docs/models/shared/errorstatus.md + - docs/models/shared/errorvalidation.md + - docs/models/shared/errorvalidationitem.md + - docs/models/shared/halref.md + - docs/models/shared/links.md + - docs/models/shared/pagination.md + - docs/models/shared/paymentmappingoptions.md + - docs/models/shared/security.md + - docs/models/shared/sourcetype.md + - docs/models/shared/supplier.md + - docs/models/shared/supplierprototype.md + - docs/models/shared/supplierref.md + - docs/models/shared/suppliers.md + - docs/models/shared/supplierstatus.md + - docs/models/shared/taxratemappingoption.md + - docs/models/shared/taxratestatus.md + - docs/models/utils/retryconfig.md + - docs/sdks/bankaccounts/README.md + - docs/sdks/billpayments/README.md + - docs/sdks/bills/README.md + - docs/sdks/codatsyncpayables/README.md + - docs/sdks/companies/README.md + - docs/sdks/companyinformation/README.md + - docs/sdks/connections/README.md + - docs/sdks/suppliers/README.md + - poetry.toml + - py.typed + - pylintrc + - pyproject.toml + - scripts/prepare-readme.py + - scripts/publish.sh + - src/codat_sync_for_payables/__init__.py + - src/codat_sync_for_payables/_hooks/__init__.py + - src/codat_sync_for_payables/_hooks/sdkhooks.py + - src/codat_sync_for_payables/_hooks/types.py + - src/codat_sync_for_payables/_version.py + - src/codat_sync_for_payables/bank_accounts.py + - src/codat_sync_for_payables/basesdk.py + - src/codat_sync_for_payables/bill_payments.py + - src/codat_sync_for_payables/bills.py + - src/codat_sync_for_payables/companies.py + - src/codat_sync_for_payables/company_information.py + - src/codat_sync_for_payables/connections.py + - src/codat_sync_for_payables/httpclient.py + - src/codat_sync_for_payables/models/errors/__init__.py + - src/codat_sync_for_payables/models/errors/errormessage.py + - src/codat_sync_for_payables/models/errors/sdkerror.py + - src/codat_sync_for_payables/models/operations/__init__.py + - src/codat_sync_for_payables/models/operations/create_bank_account.py + - src/codat_sync_for_payables/models/operations/create_bill.py + - src/codat_sync_for_payables/models/operations/create_bill_payment.py + - src/codat_sync_for_payables/models/operations/create_connection.py + - src/codat_sync_for_payables/models/operations/create_supplier.py + - src/codat_sync_for_payables/models/operations/delete_company.py + - src/codat_sync_for_payables/models/operations/delete_connection.py + - src/codat_sync_for_payables/models/operations/download_bill_attachment.py + - src/codat_sync_for_payables/models/operations/get_company.py + - src/codat_sync_for_payables/models/operations/get_company_information.py + - src/codat_sync_for_payables/models/operations/get_connection.py + - src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py + - src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py + - src/codat_sync_for_payables/models/operations/list_bill_attachments.py + - src/codat_sync_for_payables/models/operations/list_bills.py + - src/codat_sync_for_payables/models/operations/list_companies.py + - src/codat_sync_for_payables/models/operations/list_connections.py + - src/codat_sync_for_payables/models/operations/list_suppliers.py + - src/codat_sync_for_payables/models/operations/unlink_connection.py + - src/codat_sync_for_payables/models/operations/update_company.py + - src/codat_sync_for_payables/models/operations/upload_bill_attachment.py + - src/codat_sync_for_payables/models/shared/__init__.py + - src/codat_sync_for_payables/models/shared/accountmappingoption.py + - src/codat_sync_for_payables/models/shared/accountstatus.py + - src/codat_sync_for_payables/models/shared/address.py + - src/codat_sync_for_payables/models/shared/addresstype.py + - src/codat_sync_for_payables/models/shared/attachment.py + - src/codat_sync_for_payables/models/shared/attachmentupload.py + - src/codat_sync_for_payables/models/shared/bankaccount.py + - src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py + - src/codat_sync_for_payables/models/shared/bankaccountprototype.py + - src/codat_sync_for_payables/models/shared/bankaccountstatus.py + - src/codat_sync_for_payables/models/shared/bankaccounttype.py + - src/codat_sync_for_payables/models/shared/bill.py + - src/codat_sync_for_payables/models/shared/billaccountref.py + - src/codat_sync_for_payables/models/shared/billlineitem.py + - src/codat_sync_for_payables/models/shared/billmappingoptions.py + - src/codat_sync_for_payables/models/shared/billpayment.py + - src/codat_sync_for_payables/models/shared/billpaymentaccountref.py + - src/codat_sync_for_payables/models/shared/billpaymentprototype.py + - src/codat_sync_for_payables/models/shared/billprototype.py + - src/codat_sync_for_payables/models/shared/bills.py + - src/codat_sync_for_payables/models/shared/billstatus.py + - src/codat_sync_for_payables/models/shared/billtaxrateref.py + - src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhook.py + - src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhookdata.py + - src/codat_sync_for_payables/models/shared/clientratelimitresetwebhook.py + - src/codat_sync_for_payables/models/shared/clientratelimitresetwebhookdata.py + - src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py + - src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py + - src/codat_sync_for_payables/models/shared/codatfile.py + - src/codat_sync_for_payables/models/shared/companies.py + - src/codat_sync_for_payables/models/shared/company.py + - src/codat_sync_for_payables/models/shared/companyinformation.py + - src/codat_sync_for_payables/models/shared/companyreference.py + - src/codat_sync_for_payables/models/shared/companyrequestbody.py + - src/codat_sync_for_payables/models/shared/connection.py + - src/codat_sync_for_payables/models/shared/connections.py + - src/codat_sync_for_payables/models/shared/dataconnectionerror.py + - src/codat_sync_for_payables/models/shared/dataconnectionstatus.py + - src/codat_sync_for_payables/models/shared/errorvalidation.py + - src/codat_sync_for_payables/models/shared/errorvalidationitem.py + - src/codat_sync_for_payables/models/shared/halref.py + - src/codat_sync_for_payables/models/shared/links.py + - src/codat_sync_for_payables/models/shared/pagination.py + - src/codat_sync_for_payables/models/shared/paymentmappingoptions.py + - src/codat_sync_for_payables/models/shared/security.py + - src/codat_sync_for_payables/models/shared/supplier.py + - src/codat_sync_for_payables/models/shared/supplierprototype.py + - src/codat_sync_for_payables/models/shared/supplierref.py + - src/codat_sync_for_payables/models/shared/suppliers.py + - src/codat_sync_for_payables/models/shared/supplierstatus.py + - src/codat_sync_for_payables/models/shared/taxratemappingoption.py + - src/codat_sync_for_payables/py.typed + - src/codat_sync_for_payables/sdk.py + - src/codat_sync_for_payables/sdkconfiguration.py + - src/codat_sync_for_payables/suppliers.py + - src/codat_sync_for_payables/types/__init__.py + - src/codat_sync_for_payables/types/basemodel.py + - src/codat_sync_for_payables/utils/__init__.py + - src/codat_sync_for_payables/utils/annotations.py + - src/codat_sync_for_payables/utils/enums.py + - src/codat_sync_for_payables/utils/eventstreaming.py + - src/codat_sync_for_payables/utils/forms.py + - src/codat_sync_for_payables/utils/headers.py + - src/codat_sync_for_payables/utils/logger.py + - src/codat_sync_for_payables/utils/metadata.py + - src/codat_sync_for_payables/utils/queryparams.py + - src/codat_sync_for_payables/utils/requestbodies.py + - src/codat_sync_for_payables/utils/retries.py + - src/codat_sync_for_payables/utils/security.py + - src/codat_sync_for_payables/utils/serializers.py + - src/codat_sync_for_payables/utils/url.py + - src/codat_sync_for_payables/utils/values.py diff --git a/sync-for-payables/.speakeasy/gen.yaml b/sync-for-payables/.speakeasy/gen.yaml index 6b039eb51..f8dc7f675 100644 --- a/sync-for-payables/.speakeasy/gen.yaml +++ b/sync-for-payables/.speakeasy/gen.yaml @@ -4,31 +4,53 @@ generation: maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor useClassNamesForArrayFields: true fixes: - nameResolutionDec2023: false + nameResolutionFeb2025: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false + securityFeb2025: false + sharedErrorComponentsApr2025: false + sharedNestedComponentsJan2026: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + versioningStrategy: automatic + persistentEdits: {} + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false python: - version: 8.0.3 + version: 9.0.0 additionalDependencies: dev: {} main: {} + allowedRedefinedBuiltins: + - id + - object + asyncMode: both author: Codat authors: - Speakeasy + baseErrorName: CodatSyncPayablesError clientServerStatusCodesAsErrors: true + constFieldCasing: upper defaultErrorName: SDKError description: Streamline your customers' accounts payable workflow. + enableCustomCodeRegions: false enumFormat: enum fixFlags: responseRequiredSep2024: true flattenGlobalSecurity: false flattenRequests: false flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: false imports: option: openapi paths: @@ -37,10 +59,20 @@ python: operations: models/operations shared: models/shared webhooks: models/webhooks + inferUnionDiscriminators: true inputModelSuffix: input + license: "" maxMethodParams: 0 methodArguments: infer-optional-args + moduleName: "" + multipartArrayFormat: legacy outputModelSuffix: output + packageManager: poetry packageName: codat-sync-for-payables + preApplyUnionDiscriminators: false + pytestFilterWarnings: [] + pytestTimeout: 0 responseFormat: flat + sseFlatResponse: false templateVersion: v2 + useAsyncHooks: false diff --git a/sync-for-payables/README.md b/sync-for-payables/README.md index b326be4f3..5e8e8b3d0 100644 --- a/sync-for-payables/README.md +++ b/sync-for-payables/README.md @@ -7,7 +7,20 @@ Streamline your customers' accounts payable workflow. ## SDK Installation -The SDK can be installed with either *pip* or *poetry* package managers. +> [!NOTE] +> **Python version upgrade policy** +> +> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated. + +The SDK can be installed with *uv*, *pip*, or *poetry* package managers. + +### uv + +*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities. + +```bash +uv add codat-sync-for-payables +``` ### PIP @@ -24,6 +37,37 @@ pip install codat-sync-for-payables ```bash poetry add codat-sync-for-payables ``` + +### Shell and script usage with `uv` + +You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so: + +```shell +uvx --from codat-sync-for-payables python +``` + +It's also possible to write a standalone Python script without needing to set up a whole project like so: + +```python +#!/usr/bin/env -S uv run --script +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "codat-sync-for-payables", +# ] +# /// + +from codat_sync_for_payables import CodatSyncPayables + +sdk = CodatSyncPayables( + # SDK arguments +) + +# Rest of script here... +``` + +Once that is saved to a file, you can run it with `uv run script.py` where +`script.py` can be replaced with the actual file name. ## Example Usage @@ -35,44 +79,51 @@ poetry add codat-sync-for-payables ```python # Synchronous Example from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: -with CodatSyncPayables() as codat_sync_payables: - codat_sync_payables.client_rate_limit_reached(request={ - "id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - "event_type": "client.rateLimit.reached", - "generated_date": "2024-09-01T00:00:00Z", - "payload": { - "daily_quota": 12000, - "quota_remaining": 0, - "expiry_date": "2024-09-01T12:14:14Z", - }, + res = codat_sync_payables.companies.list(request={ + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - # Use the SDK ... + # Handle response + print(res) ```
-The same SDK client can also be used to make asychronous requests by importing asyncio. +The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared async def main(): - async with CodatSyncPayables() as codat_sync_payables: - await codat_sync_payables.client_rate_limit_reached_async(request={ - "id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - "event_type": "client.rateLimit.reached", - "generated_date": "2024-09-01T00:00:00Z", - "payload": { - "daily_quota": 12000, - "quota_remaining": 0, - "expiry_date": "2024-09-01T12:14:14Z", - }, + + async with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as codat_sync_payables: + + res = await codat_sync_payables.companies.list_async(request={ + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - # Use the SDK ... + # Handle response + print(res) asyncio.run(main()) ``` @@ -84,38 +135,39 @@ asyncio.run(main())
Available methods -### [bank_accounts](docs/sdks/bankaccounts/README.md) +### [BankAccounts](docs/sdks/bankaccounts/README.md) * [create](docs/sdks/bankaccounts/README.md#create) - Create bank account -### [bill_payments](docs/sdks/billpayments/README.md) +### [BillPayments](docs/sdks/billpayments/README.md) * [get_payment_options](docs/sdks/billpayments/README.md#get_payment_options) - Get payment mapping options * [create](docs/sdks/billpayments/README.md#create) - Create bill payment -### [bills](docs/sdks/bills/README.md) +### [Bills](docs/sdks/bills/README.md) * [get_bill_options](docs/sdks/bills/README.md#get_bill_options) - Get bill mapping options * [list](docs/sdks/bills/README.md#list) - List bills * [create](docs/sdks/bills/README.md#create) - Create bill +* [update](docs/sdks/bills/README.md#update) - Update bill * [upload_attachment](docs/sdks/bills/README.md#upload_attachment) - Upload bill attachment * [list_attachments](docs/sdks/bills/README.md#list_attachments) - List bill attachments * [download_attachment](docs/sdks/bills/README.md#download_attachment) - Download bill attachment - -### [companies](docs/sdks/companies/README.md) +### [Companies](docs/sdks/companies/README.md) * [list](docs/sdks/companies/README.md#list) - List companies * [create](docs/sdks/companies/README.md#create) - Create company +* [replace](docs/sdks/companies/README.md#replace) - Replace company * [update](docs/sdks/companies/README.md#update) - Update company * [delete](docs/sdks/companies/README.md#delete) - Delete a company * [get](docs/sdks/companies/README.md#get) - Get company -### [company_information](docs/sdks/companyinformation/README.md) +### [CompanyInformation](docs/sdks/companyinformation/README.md) * [get](docs/sdks/companyinformation/README.md#get) - Get company information -### [connections](docs/sdks/connections/README.md) +### [Connections](docs/sdks/connections/README.md) * [list](docs/sdks/connections/README.md#list) - List connections * [create](docs/sdks/connections/README.md#create) - Create connection @@ -123,7 +175,7 @@ asyncio.run(main()) * [delete](docs/sdks/connections/README.md#delete) - Delete connection * [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection -### [suppliers](docs/sdks/suppliers/README.md) +### [Suppliers](docs/sdks/suppliers/README.md) * [list](docs/sdks/suppliers/README.md#list) - List suppliers * [create](docs/sdks/suppliers/README.md#create) - Create supplier @@ -134,11 +186,11 @@ asyncio.run(main()) ## Summary -Bill pay kit: The API reference for the Bill Pay kit. +Bill pay (synchronous solution): The API reference for the synchronous Bill Pay solution. -The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. +The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. -[Explore product](https://docs.codat.io/payables/bill-pay-kit) | [See OpenAPI spec](https://github.com/codatio/oas) +[Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations @@ -148,7 +200,9 @@ The bill pay kit is an API and a set of supporting tools designed to integrate a | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | +| Sage Intacct | Yes | | Xero | Yes | +| Zoho Books | Yes | --- @@ -182,6 +236,7 @@ The bill pay kit is an API and a set of supporting tools designed to integrate a * [Server Selection](#server-selection) * [Custom HTTP Client](#custom-http-client) * [Authentication](#authentication) + * [Resource Management](#resource-management) * [Debugging](#debugging) * [Support](#support) @@ -211,20 +266,21 @@ Certain SDK methods accept file objects as part of a request body or multi-part from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bills.upload_attachment(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bill_id": "EILBDVJVNUAGVKRQ", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -240,22 +296,22 @@ from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared from codat_sync_for_payables.utils import BackoffStrategy, RetryConfig + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -265,22 +321,22 @@ from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared from codat_sync_for_payables.utils import BackoffStrategy, RetryConfig + with CodatSyncPayables( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -288,30 +344,23 @@ with CodatSyncPayables( ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. - -By default, an API error will raise a errors.SDKError exception, which has the following properties: - -| Property | Type | Description | -|-----------------|------------------|-----------------------| -| `.status_code` | *int* | The HTTP status code | -| `.message` | *str* | The error message | -| `.raw_response` | *httpx.Response* | The raw HTTP response | -| `.body` | *str* | The response content | +[`CodatSyncPayablesError`](./src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py) is the base class for all HTTP error responses. It has the following properties: -When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions: - -| Error Type | Status Code | Content Type | -| ------------------- | -------------------------------------- | ---------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Property | Type | Description | +| ------------------ | ---------------- | --------------------------------------------------------------------------------------- | +| `err.message` | `str` | Error message | +| `err.status_code` | `int` | HTTP response status code eg `404` | +| `err.headers` | `httpx.Headers` | HTTP response headers | +| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. | +| `err.raw_response` | `httpx.Response` | Raw HTTP response | +| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). | ### Example - ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import errors, shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", @@ -319,24 +368,53 @@ with CodatSyncPayables( ) as codat_sync_payables: res = None try: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass - - except errors.ErrorMessage as e: - # handle e.data: errors.ErrorMessageData - raise(e) - except errors.SDKError as e: - # handle exception - raise(e) + # Handle response + print(res) + + + except errors.CodatSyncPayablesError as e: + # The base class for HTTP error responses + print(e.message) + print(e.status_code) + print(e.body) + print(e.headers) + print(e.raw_response) + + # Depending on the method different errors may be thrown + if isinstance(e, errors.ErrorMessage): + print(e.data.status_code) # Optional[int] + print(e.data.service) # Optional[str] + print(e.data.error) # Optional[str] + print(e.data.correlation_id) # Optional[str] + print(e.data.validation) # OptionalNullable[shared.ErrorValidation] ``` + +### Error Classes +**Primary errors:** +* [`CodatSyncPayablesError`](./src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py): The base class for HTTP error responses. + * [`ErrorMessage`](./src/codat_sync_for_payables/models/errors/errormessage.py): Your `query` parameter was not correctly formed. + +
Less common errors (5) + +
+ +**Network errors:** +* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors. + * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server. + * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out. + + +**Inherit from [`CodatSyncPayablesError`](./src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py)**: +* [`ResponseValidationError`](./src/codat_sync_for_payables/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. + +
@@ -344,27 +422,27 @@ with CodatSyncPayables( ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: +The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( server_url="https://api.codat.io", security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -466,25 +544,57 @@ You can set the security parameters through the `security` optional parameter wh from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` + +## Resource Management + +The `CodatSyncPayables` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application. + +[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared +def main(): + + with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as codat_sync_payables: + # Rest of application here... + + +# Or when using async: +async def amain(): + + async with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as codat_sync_payables: + # Rest of application here... +``` + + ## Debugging diff --git a/sync-for-payables/RELEASES.md b/sync-for-payables/RELEASES.md index f464ecac6..950edf12c 100644 --- a/sync-for-payables/RELEASES.md +++ b/sync-for-payables/RELEASES.md @@ -78,4 +78,14 @@ Based on: ### Generated - [python v8.0.3] sync-for-payables ### Releases -- [PyPI v8.0.3] https://pypi.org/project/codat-sync-for-payables/8.0.3 - sync-for-payables \ No newline at end of file +- [PyPI v8.0.3] https://pypi.org/project/codat-sync-for-payables/8.0.3 - sync-for-payables + +## 2026-02-09 13:57:58 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.709.1 (2.812.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v9.0.0] sync-for-payables +### Releases +- [PyPI v9.0.0] https://pypi.org/project/codat-sync-for-payables/9.0.0 - sync-for-payables \ No newline at end of file diff --git a/sync-for-payables/USAGE.md b/sync-for-payables/USAGE.md index a3df314a8..4e0078b54 100644 --- a/sync-for-payables/USAGE.md +++ b/sync-for-payables/USAGE.md @@ -4,26 +4,27 @@ from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ```
-The same SDK client can also be used to make asychronous requests by importing asyncio. +The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio @@ -31,21 +32,21 @@ from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared async def main(): + async with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = await codat_sync_payables.companies.list_async(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + # Handle response + print(res) asyncio.run(main()) ``` diff --git a/sync-for-payables/docs/models/operations/createbillpaymentrequest.md b/sync-for-payables/docs/models/operations/createbillpaymentrequest.md index 653913bcc..d5bd37b70 100644 --- a/sync-for-payables/docs/models/operations/createbillpaymentrequest.md +++ b/sync-for-payables/docs/models/operations/createbillpaymentrequest.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | -| `bill_payment_prototype` | [Optional[shared.BillPaymentPrototype]](../../models/shared/billpaymentprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +| `bill_payment_prototype` | [Optional[shared.BillPaymentPrototype]](../../models/shared/billpaymentprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md b/sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md index 947d1e4bf..2df731fdb 100644 --- a/sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md +++ b/sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `attachment_id` | *str* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `attachment_id` | *str* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillattachmentsrequest.md b/sync-for-payables/docs/models/operations/listbillattachmentsrequest.md index c2b960e31..2a271d2fc 100644 --- a/sync-for-payables/docs/models/operations/listbillattachmentsrequest.md +++ b/sync-for-payables/docs/models/operations/listbillattachmentsrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listcompaniesrequest.md b/sync-for-payables/docs/models/operations/listcompaniesrequest.md index d0f262cbd..8617ea281 100644 --- a/sync-for-payables/docs/models/operations/listcompaniesrequest.md +++ b/sync-for-payables/docs/models/operations/listcompaniesrequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `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 | -| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `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/sync-for-payables/docs/models/operations/replacecompanyrequest.md b/sync-for-payables/docs/models/operations/replacecompanyrequest.md new file mode 100644 index 000000000..1de44d982 --- /dev/null +++ b/sync-for-payables/docs/models/operations/replacecompanyrequest.md @@ -0,0 +1,9 @@ +# ReplaceCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `company_request_body` | [Optional[shared.CompanyRequestBody]](../../models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatebillrequest.md b/sync-for-payables/docs/models/operations/updatebillrequest.md new file mode 100644 index 000000000..749e460bd --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatebillrequest.md @@ -0,0 +1,12 @@ +# UpdateBillRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +| `bill_prototype` | [Optional[shared.BillPrototype]](../../models/shared/billprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatecompanyrequest.md b/sync-for-payables/docs/models/operations/updatecompanyrequest.md index 8ee99180f..d2d812198 100644 --- a/sync-for-payables/docs/models/operations/updatecompanyrequest.md +++ b/sync-for-payables/docs/models/operations/updatecompanyrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `company_request_body` | [Optional[shared.CompanyRequestBody]](../../models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `company_update_request` | [Optional[shared.CompanyUpdateRequest]](../../models/shared/companyupdaterequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md b/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md index 37e393217..7b2ccd399 100644 --- a/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md +++ b/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `attachment_upload` | [Optional[shared.AttachmentUpload]](../../models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `attachment_upload` | [Optional[shared.AttachmentUpload]](../../models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/accountmappingoption.md b/sync-for-payables/docs/models/shared/accountmappingoption.md index b04ac5177..1c1d60088 100644 --- a/sync-for-payables/docs/models/shared/accountmappingoption.md +++ b/sync-for-payables/docs/models/shared/accountmappingoption.md @@ -9,6 +9,6 @@ | `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the account. | Accounts Payable | | `type` | *OptionalNullable[str]* | :heavy_minus_sign: | Type of account. | Liability | -| `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 | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `status` | [Optional[shared.AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | The current status of the account. | Active | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/attachment.md b/sync-for-payables/docs/models/shared/attachment.md index d1aaf1306..129d601b3 100644 --- a/sync-for-payables/docs/models/shared/attachment.md +++ b/sync-for-payables/docs/models/shared/attachment.md @@ -25,7 +25,7 @@ | `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting software. | | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the attachment file. | | | `content_type` | *OptionalNullable[str]* | :heavy_minus_sign: | File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.

Supported file types vary per platform. | | -| `date_created` | *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 | +| `date_created` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `file_size` | *OptionalNullable[int]* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | | `include_when_sent` | *Optional[bool]* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/bankaccount.md b/sync-for-payables/docs/models/shared/bankaccount.md index fff4281b4..25fff9fdc 100644 --- a/sync-for-payables/docs/models/shared/bankaccount.md +++ b/sync-for-payables/docs/models/shared/bankaccount.md @@ -11,6 +11,6 @@ | `account_type` | [Optional[shared.BankAccountType]](../../models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `account_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. | | | `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `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 | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `status` | [Optional[shared.BankAccountStatus]](../../models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/bankaccountmappingoption.md b/sync-for-payables/docs/models/shared/bankaccountmappingoption.md index 75cce1c24..e4a4d459b 100644 --- a/sync-for-payables/docs/models/shared/bankaccountmappingoption.md +++ b/sync-for-payables/docs/models/shared/bankaccountmappingoption.md @@ -13,4 +13,4 @@ | `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | The bank account's base currency. | | | `status` | [Optional[shared.BankAccountStatus]](../../models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | | `account_type` | [Optional[shared.BankAccountType]](../../models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/bankaccountprototype.md b/sync-for-payables/docs/models/shared/bankaccountprototype.md index 2501adbbd..a16edf50b 100644 --- a/sync-for-payables/docs/models/shared/bankaccountprototype.md +++ b/sync-for-payables/docs/models/shared/bankaccountprototype.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | | `name` | *Nullable[str]* | :heavy_check_mark: | Name of the bank account in the accounting software. | | | `account_type` | [shared.BankAccountType](../../models/shared/bankaccounttype.md) | :heavy_check_mark: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `account_number` | *Nullable[str]* | :heavy_check_mark: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. | | -| `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 | -| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | \ No newline at end of file +| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/bill.md b/sync-for-payables/docs/models/shared/bill.md index 4a726f32a..9989e1a3f 100644 --- a/sync-for-payables/docs/models/shared/bill.md +++ b/sync-for-payables/docs/models/shared/bill.md @@ -7,15 +7,15 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `supplier_ref` | [shared.SupplierRef](../../models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `issue_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `due_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `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 | -| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | | `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | | `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `supplier_ref` | [shared.SupplierRef](../../models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | +| `issue_date` | *str* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `due_date` | *str* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | | `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | +| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | | `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the bill, including tax. | | | `amount_due` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding on the bill. | | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billlineitem.md b/sync-for-payables/docs/models/shared/billlineitem.md index a59429885..69d759c81 100644 --- a/sync-for-payables/docs/models/shared/billlineitem.md +++ b/sync-for-payables/docs/models/shared/billlineitem.md @@ -5,10 +5,11 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `unit_amount` | *Decimal* | :heavy_check_mark: | Unit price of the goods or service. | -| `quantity` | *Decimal* | :heavy_check_mark: | Number of units of goods or services received. | -| `account_ref` | [shared.BillAccountRef](../../models/shared/billaccountref.md) | :heavy_check_mark: | Reference to the account to which the line item is linked. | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly name of the goods or services received. | +| `unit_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Unit price of the goods or service. | +| `quantity` | *Optional[Decimal]* | :heavy_minus_sign: | Number of units of goods or services received. | | `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of tax applied to the line item. | +| `account_ref` | [Optional[shared.BillAccountRef]](../../models/shared/billaccountref.md) | :heavy_minus_sign: | Reference to the account to which the line item is linked. | | `total_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Total amount of the line, including tax. | -| `tax_rate_ref` | [Optional[shared.BillTaxRateRef]](../../models/shared/billtaxrateref.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | \ No newline at end of file +| `tax_rate_ref` | [Optional[shared.BillTaxRateRef]](../../models/shared/billtaxrateref.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | +| `tracking_refs` | List[[shared.TrackingRef](../../models/shared/trackingref.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billmappingoptions.md b/sync-for-payables/docs/models/shared/billmappingoptions.md index 87c9f57a9..e9979b159 100644 --- a/sync-for-payables/docs/models/shared/billmappingoptions.md +++ b/sync-for-payables/docs/models/shared/billmappingoptions.md @@ -5,8 +5,8 @@ The bill mapping options for a company's accounting software. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `accounts` | List[[shared.AccountMappingOption](../../models/shared/accountmappingoption.md)] | :heavy_minus_sign: | N/A | -| `tax_rates` | List[[shared.TaxRateMappingOption](../../models/shared/taxratemappingoption.md)] | :heavy_minus_sign: | N/A | -| `pagination` | [Optional[shared.Pagination]](../../models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `accounts` | List[[Nullable[shared.AccountMappingOption]](../../models/shared/accountmappingoption.md)] | :heavy_minus_sign: | N/A | +| `tax_rates` | List[[shared.TaxRateMappingOption](../../models/shared/taxratemappingoption.md)] | :heavy_minus_sign: | N/A | +| `pagination` | [Optional[shared.Pagination]](../../models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpayment.md b/sync-for-payables/docs/models/shared/billpayment.md index 24849d839..9ceaa2c30 100644 --- a/sync-for-payables/docs/models/shared/billpayment.md +++ b/sync-for-payables/docs/models/shared/billpayment.md @@ -7,7 +7,7 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting software. | | | `amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the payment in the bill currency. | 1329.54 | -| `date_` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `date_` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | | `account_ref` | [Optional[shared.BillPaymentAccountRef]](../../models/shared/billpaymentaccountref.md) | :heavy_minus_sign: | Reference to the bank account / credit card which you are using to pay the bill. | | | `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpaymentprototype.md b/sync-for-payables/docs/models/shared/billpaymentprototype.md index 949edfe96..dee200ee0 100644 --- a/sync-for-payables/docs/models/shared/billpaymentprototype.md +++ b/sync-for-payables/docs/models/shared/billpaymentprototype.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `amount` | *Decimal* | :heavy_check_mark: | Amount of the payment in the bill currency. | 1329.54 | -| `date_` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `account_ref` | [shared.BillPaymentAccountRef](../../models/shared/billpaymentaccountref.md) | :heavy_check_mark: | Reference to the bank account / credit card which you are using to pay the bill. | | +| `date_` | *str* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `account_ref` | [shared.BillPaymentAccountRef](../../models/shared/billpaymentaccountref.md) | :heavy_check_mark: | Reference to the bank account / credit card which you are using to pay the bill. | | | `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billprototype.md b/sync-for-payables/docs/models/shared/billprototype.md index 5e68bf6a7..1b924b241 100644 --- a/sync-for-payables/docs/models/shared/billprototype.md +++ b/sync-for-payables/docs/models/shared/billprototype.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `supplier_ref` | [shared.SupplierRef](../../models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `issue_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `due_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `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 | -| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | | `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `supplier_ref` | [shared.SupplierRef](../../models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | +| `issue_date` | *str* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `due_date` | *str* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | -| `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | \ No newline at end of file +| `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | +| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/clientratelimitreachedwebhook.md b/sync-for-payables/docs/models/shared/clientratelimitreachedwebhook.md deleted file mode 100644 index 4ebcb4a09..000000000 --- a/sync-for-payables/docs/models/shared/clientratelimitreachedwebhook.md +++ /dev/null @@ -1,16 +0,0 @@ -# ClientRateLimitReachedWebhook - -Webhook request body for a client that has reached their rate limit. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | -| ~~`rule_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | -| `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | -| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | -| `data` | [Optional[shared.ClientRateLimitReachedWebhookData]](../../models/shared/clientratelimitreachedwebhookdata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/clientratelimitreachedwebhookdata.md b/sync-for-payables/docs/models/shared/clientratelimitreachedwebhookdata.md deleted file mode 100644 index bab6ec72f..000000000 --- a/sync-for-payables/docs/models/shared/clientratelimitreachedwebhookdata.md +++ /dev/null @@ -1,9 +0,0 @@ -# ClientRateLimitReachedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | -| `expires_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/clientratelimitresetwebhook.md b/sync-for-payables/docs/models/shared/clientratelimitresetwebhook.md deleted file mode 100644 index 27b096317..000000000 --- a/sync-for-payables/docs/models/shared/clientratelimitresetwebhook.md +++ /dev/null @@ -1,16 +0,0 @@ -# ClientRateLimitResetWebhook - -Webhook request body for a client that has had their rate limit reset. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | -| ~~`rule_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | -| `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | -| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | -| `data` | [Optional[shared.ClientRateLimitResetWebhookData]](../../models/shared/clientratelimitresetwebhookdata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/clientratelimitresetwebhookdata.md b/sync-for-payables/docs/models/shared/clientratelimitresetwebhookdata.md deleted file mode 100644 index 1f7c3b56e..000000000 --- a/sync-for-payables/docs/models/shared/clientratelimitresetwebhookdata.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClientRateLimitResetWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `quota_remaining` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `reset_reason` | *Optional[str]* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | -| `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | -| `expires_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/clientratelimitwebhook.md b/sync-for-payables/docs/models/shared/clientratelimitwebhook.md index 6b719bbcb..686f8f82a 100644 --- a/sync-for-payables/docs/models/shared/clientratelimitwebhook.md +++ b/sync-for-payables/docs/models/shared/clientratelimitwebhook.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | client.rateLimit.reset | -| `generated_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 | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | +| `generated_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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `payload` | [Optional[shared.ClientRateLimitWebhookPayload]](../../models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/clientratelimitwebhookpayload.md b/sync-for-payables/docs/models/shared/clientratelimitwebhookpayload.md index fe976f75c..52e2c78d2 100644 --- a/sync-for-payables/docs/models/shared/clientratelimitwebhookpayload.md +++ b/sync-for-payables/docs/models/shared/clientratelimitwebhookpayload.md @@ -7,4 +7,4 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | | `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `expiry_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 | \ No newline at end of file +| `expiry_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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/companies.md b/sync-for-payables/docs/models/shared/companies.md index e20255422..6436dc2cd 100644 --- a/sync-for-payables/docs/models/shared/companies.md +++ b/sync-for-payables/docs/models/shared/companies.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `results` | List[[shared.Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | | | `page_number` | *int* | :heavy_check_mark: | Current page number. | | | `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | | `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | -| `results` | List[[shared.Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/company.md b/sync-for-payables/docs/models/shared/company.md index 501de4a5a..02b633fb4 100644 --- a/sync-for-payables/docs/models/shared/company.md +++ b/sync-for-payables/docs/models/shared/company.md @@ -13,10 +13,10 @@ When you create a company, you can specify a `name` and we will automatically ge | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `name` | *str* | :heavy_check_mark: | The name of the company | Codat Ltd. | -| `redirect` | *str* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | | `description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `last_sync` | *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 | -| `created` | *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 | +| `redirect` | *str* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | +| `last_sync` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `created` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `created_by_user_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `products` | List[*str*] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | | `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | diff --git a/sync-for-payables/docs/models/shared/companyupdaterequest.md b/sync-for-payables/docs/models/shared/companyupdaterequest.md new file mode 100644 index 000000000..80229fd64 --- /dev/null +++ b/sync-for-payables/docs/models/shared/companyupdaterequest.md @@ -0,0 +1,10 @@ +# CompanyUpdateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | +| `description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/connection.md b/sync-for-payables/docs/models/shared/connection.md index e4b303afe..5bebcd785 100644 --- a/sync-for-payables/docs/models/shared/connection.md +++ b/sync-for-payables/docs/models/shared/connection.md @@ -24,7 +24,7 @@ Before you can use a data connection to pull or push data, the company must gran | `platform_name` | *str* | :heavy_check_mark: | Name of integration connected to company. | | | `link_url` | *str* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | | `status` | [shared.DataConnectionStatus](../../models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `created` | *str* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `last_sync` | *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 | +| `last_sync` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `created` | *str* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `data_connection_errors` | List[[shared.DataConnectionError](../../models/shared/dataconnectionerror.md)] | :heavy_minus_sign: | N/A | | -| `connection_info` | Dict[str, *str*] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `connection_info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/connections.md b/sync-for-payables/docs/models/shared/connections.md index c46f06c8b..ea48ba61e 100644 --- a/sync-for-payables/docs/models/shared/connections.md +++ b/sync-for-payables/docs/models/shared/connections.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `results` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | | `page_number` | *int* | :heavy_check_mark: | Current page number. | | | `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | | `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | -| `results` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/dataconnectionerror.md b/sync-for-payables/docs/models/shared/dataconnectionerror.md index 32a286044..e381d128e 100644 --- a/sync-for-payables/docs/models/shared/dataconnectionerror.md +++ b/sync-for-payables/docs/models/shared/dataconnectionerror.md @@ -8,6 +8,6 @@ | `status_code` | *Optional[str]* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | | `status_text` | *Optional[str]* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | | `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about a error returned by Codat. | | -| `errored_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `errored_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `status` | [OptionalNullable[shared.ErrorStatus]](../../models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | -| `resolved_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `resolved_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/datatype.md b/sync-for-payables/docs/models/shared/datatype.md new file mode 100644 index 000000000..1eef426e2 --- /dev/null +++ b/sync-for-payables/docs/models/shared/datatype.md @@ -0,0 +1,11 @@ +# DataType + +The type of the linked reference. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `TRACKING_CATEGORIES` | trackingCategories | +| `CUSTOMERS` | customers | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/paymentmappingoptions.md b/sync-for-payables/docs/models/shared/paymentmappingoptions.md index 9a75848b1..b8085c1e5 100644 --- a/sync-for-payables/docs/models/shared/paymentmappingoptions.md +++ b/sync-for-payables/docs/models/shared/paymentmappingoptions.md @@ -5,7 +5,7 @@ Gets the bill payments mapping options for a company's accounting software ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `bank_accounts` | List[[shared.BankAccountMappingOption](../../models/shared/bankaccountmappingoption.md)] | :heavy_minus_sign: | N/A | -| `pagination` | [Optional[shared.Pagination]](../../models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `bank_accounts` | List[[Nullable[shared.BankAccountMappingOption]](../../models/shared/bankaccountmappingoption.md)] | :heavy_minus_sign: | N/A | +| `pagination` | [Optional[shared.Pagination]](../../models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/supplier.md b/sync-for-payables/docs/models/shared/supplier.md index d6ed6d8d3..3465e1473 100644 --- a/sync-for-payables/docs/models/shared/supplier.md +++ b/sync-for-payables/docs/models/shared/supplier.md @@ -8,15 +8,15 @@ Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | -| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `status` | [Optional[shared.SupplierStatus]](../../models/shared/supplierstatus.md) | :heavy_minus_sign: | Status of the supplier. | | -| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding against the supplier. | | -| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `status` | [Optional[shared.SupplierStatus]](../../models/shared/supplierstatus.md) | :heavy_minus_sign: | Status of the supplier. | | +| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding against the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/supplierprototype.md b/sync-for-payables/docs/models/shared/supplierprototype.md index 2e549e1b4..789dcb3fa 100644 --- a/sync-for-payables/docs/models/shared/supplierprototype.md +++ b/sync-for-payables/docs/models/shared/supplierprototype.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `supplier_name` | *str* | :heavy_check_mark: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding against the supplier. | | -| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `supplier_name` | *str* | :heavy_check_mark: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding against the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/trackingref.md b/sync-for-payables/docs/models/shared/trackingref.md new file mode 100644 index 000000000..dd66c6469 --- /dev/null +++ b/sync-for-payables/docs/models/shared/trackingref.md @@ -0,0 +1,10 @@ +# TrackingRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the linked tracking category or the unique identifier of the linked customer. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | The type of the linked reference. | trackingCategories | +| `is_billable` | *Optional[bool]* | :heavy_minus_sign: | If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/bankaccounts/README.md b/sync-for-payables/docs/sdks/bankaccounts/README.md index f7cf9633b..821d9513a 100644 --- a/sync-for-payables/docs/sdks/bankaccounts/README.md +++ b/sync-for-payables/docs/sdks/bankaccounts/README.md @@ -1,5 +1,4 @@ # BankAccounts -(*bank_accounts*) ## Overview @@ -11,37 +10,68 @@ Create a bank account for a given company's connection. ## create -The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. - +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. + [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. -### Example Usage +### Example Usage: Bank account example + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bank_accounts.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "bank_account_prototype": { + "nominal_code": "22", "name": "Plutus - Payables - Bank Account 12", "account_type": shared.BankAccountType.DEBIT, "account_number": "0120 0440", - "currency": "GBP", - "nominal_code": "22", "sort_code": "50-50-50", + "currency": "GBP", + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Malformed query + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bank_accounts.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bank_account_prototype": { + "name": "", + "account_type": shared.BankAccountType.DEBIT, + "account_number": "", + "currency": "GBP", }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -58,7 +88,8 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/billpayments/README.md b/sync-for-payables/docs/sdks/billpayments/README.md index d2c988581..f047b0862 100644 --- a/sync-for-payables/docs/sdks/billpayments/README.md +++ b/sync-for-payables/docs/sdks/billpayments/README.md @@ -1,5 +1,4 @@ # BillPayments -(*bill_payments*) ## Overview @@ -12,23 +11,26 @@ Get, create, and update Bill payments. ## get_payment_options -Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID. - -By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - +Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID. + +By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. + Mapping options are a set of bank accounts used to configure the SMB's payables integration. ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bill_payments.get_payment_options(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -36,9 +38,8 @@ with CodatSyncPayables( "status_query": "status=Archived", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -55,10 +56,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -66,36 +68,104 @@ The *Create bill payment* endpoint creates a new [bill payment](https://docs.cod [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. -### Example Usage +### Example Usage: Bill payment + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared from decimal import Decimal + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bill_payments.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bill_id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", + "bill_payment_prototype": { + "amount": Decimal("1329.54"), + "date_": "2022-10-23T00:00:00Z", + "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + "account_ref": { + "id": "", + }, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Bill payment example + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared +from decimal import Decimal + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bill_payments.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "bill_payment_prototype": { "amount": Decimal("22"), "date_": "2022-10-23T00:00:00.000Z", + "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "account_ref": { "id": "7bda9f44sr56", }, - "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "currency_rate": Decimal("1"), }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: Malformed query + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared +from decimal import Decimal + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bill_payments.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", + "bill_payment_prototype": { + "amount": Decimal("1329.54"), + "date_": "2022-10-23T00:00:00Z", + "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + "account_ref": { + "id": "", + }, + }, + }) + + # Handle response + print(res) ``` @@ -112,7 +182,8 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/bills/README.md b/sync-for-payables/docs/sdks/bills/README.md index 1c6e9177e..41ba038a5 100644 --- a/sync-for-payables/docs/sdks/bills/README.md +++ b/sync-for-payables/docs/sdks/bills/README.md @@ -1,5 +1,4 @@ # Bills -(*bills*) ## Overview @@ -10,6 +9,7 @@ Get, create, and update Bills. * [get_bill_options](#get_bill_options) - Get bill mapping options * [list](#list) - List bills * [create](#create) - Create bill +* [update](#update) - Update bill * [upload_attachment](#upload_attachment) - Upload bill attachment * [list_attachments](#list_attachments) - List bill attachments * [download_attachment](#download_attachment) - Download bill attachment @@ -24,15 +24,18 @@ Mapping options are a set of accounts and tax rates used to configure the SMB's ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bills.get_bill_options(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -40,9 +43,8 @@ with CodatSyncPayables( "status_query": "status=Archived", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -59,10 +61,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -72,17 +75,69 @@ The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-f By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. -### Example Usage +### Example Usage: Bills + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + + res = codat_sync_payables.bills.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }) + + # Handle response + print(res) + +``` +### Example Usage: Source modified date + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }) + + # Handle response + print(res) + +``` +### Example Usage: Status (open) + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + res = codat_sync_payables.bills.list(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -90,9 +145,83 @@ with CodatSyncPayables( "query": "status=Open", }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: Status (open) & source modified date + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", + }) + + # Handle response + print(res) + +``` +### Example Usage: Status (partially paid) + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "status=PartiallyPaid", + }) + + # Handle response + print(res) + +``` +### Example Usage: Status (partially paid) & source modified date + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", + }) + + # Handle response + print(res) ``` @@ -109,10 +238,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -120,22 +250,26 @@ The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-p [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. -### Example Usage +### Example Usage: Create bill + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared from decimal import Decimal + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bills.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "bill_prototype": { + "reference": "bill_b8qmmj4ksf1suax", "supplier_ref": { "id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplier_name": "DIISR - Small Business Services", @@ -143,56 +277,134 @@ with CodatSyncPayables( "issue_date": "2023-04-23T00:00:00", "due_date": "2023-04-23T00:00:00", "currency": "GBP", - "status": shared.BillStatus.OPEN, - "reference": "bill_b8qmmj4ksf1suax", "currency_rate": Decimal("1"), "line_items": [ { + "description": "Half day training - Microsoft Office", "unit_amount": Decimal("1800"), "quantity": Decimal("1"), + "tax_amount": Decimal("360"), "account_ref": { "id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", }, - "description": "Half day training - Microsoft Office", - "tax_amount": Decimal("360"), "total_amount": Decimal("2160"), "tax_rate_ref": { "id": "INPUT2", }, }, { + "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unit_amount": Decimal("4000"), "quantity": Decimal("1"), + "tax_amount": Decimal("800"), "account_ref": { "id": "f96c9458-d724-47bf-8f74-a9d5726465ce", }, - "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", - "tax_amount": Decimal("800"), "total_amount": Decimal("4800"), "tax_rate_ref": { "id": "INPUT2", }, }, { + "description": "Stationery charges", "unit_amount": Decimal("32"), "quantity": Decimal("8"), + "tax_amount": Decimal("51.2"), "account_ref": { "id": "cba6527d-f102-4538-b421-e483233e9d5a", }, - "description": "Stationery charges", - "tax_amount": Decimal("51.2"), "total_amount": Decimal("307.2"), "tax_rate_ref": { "id": "INPUT2", }, + "tracking_refs": [ + { + "id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + "data_type": shared.DataType.TRACKING_CATEGORIES, + }, + ], + }, + ], + "status": shared.BillStatus.OPEN, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Created bill + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_prototype": { + "supplier_ref": { + "id": "", + }, + "issue_date": "2022-10-23T00:00:00Z", + "due_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + "line_items": [ + { + "tracking_refs": None, }, ], + "status": shared.BillStatus.OPEN, }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: Malformed query + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_prototype": { + "supplier_ref": { + "id": "", + }, + "issue_date": "2022-10-23T00:00:00Z", + "due_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + "line_items": [ + { + "tracking_refs": None, + }, + ], + "status": shared.BillStatus.OPEN, + }, + }) + + # Handle response + print(res) ``` @@ -209,37 +421,234 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | +| Oracle NetSuite | No | +| Sage Intacct | No | +| Zoho Books | No | + + +### Example Usage: Malformed query + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", + "bill_prototype": { + "supplier_ref": { + "id": "", + }, + "issue_date": "2022-10-23T00:00:00Z", + "due_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + "line_items": [ + { + "tracking_refs": [ + { + "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", + "data_type": shared.DataType.TRACKING_CATEGORIES, + }, + ], + }, + ], + "status": shared.BillStatus.OPEN, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Update bill + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared +from decimal import Decimal + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", + "bill_prototype": { + "reference": "bill_updated_ref", + "supplier_ref": { + "id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", + }, + "issue_date": "2023-04-23T00:00:00", + "due_date": "2023-05-23T00:00:00", + "currency": "GBP", + "currency_rate": Decimal("1"), + "line_items": [ + { + "description": "Updated line item - Microsoft Office training", + "unit_amount": Decimal("2000"), + "quantity": Decimal("1"), + "tax_amount": Decimal("400"), + "account_ref": { + "id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + "total_amount": Decimal("2400"), + "tax_rate_ref": { + "id": "INPUT2", + }, + }, + { + "description": "Desktop/network support via email & phone - updated rate", + "unit_amount": Decimal("4500"), + "quantity": Decimal("1"), + "tax_amount": Decimal("900"), + "account_ref": { + "id": "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + "total_amount": Decimal("5400"), + "tax_rate_ref": { + "id": "INPUT2", + }, + "tracking_refs": [ + { + "id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + "data_type": shared.DataType.TRACKING_CATEGORIES, + }, + ], + }, + ], + "status": shared.BillStatus.OPEN, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Updated bill + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.bills.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", + "bill_prototype": { + "supplier_ref": { + "id": "", + }, + "issue_date": "2022-10-23T00:00:00Z", + "due_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + "line_items": [ + { + "tracking_refs": [ + { + "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", + "data_type": shared.DataType.TRACKING_CATEGORIES, + }, + ], + }, + ], + "status": shared.BillStatus.OPEN, + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.UpdateBillRequest](../../models/operations/updatebillrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[shared.Bill](../../models/shared/bill.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## upload_attachment -The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. - +The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bills.upload_attachment(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bill_id": "EILBDVJVNUAGVKRQ", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -256,37 +665,40 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list_attachments -The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. - +The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bills.list_attachments(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bill_id": "EILBDVJVNUAGVKRQ", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -303,10 +715,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## download_attachment @@ -319,25 +732,27 @@ Check out our [coverage explorer](https://knowledge.codat.io/supported-features/ ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.bills.download_attachment(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bill_id": "EILBDVJVNUAGVKRQ", + "bill_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", "attachment_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -350,11 +765,12 @@ with CodatSyncPayables( ### Response -**[httpx.Response](../../models/.md)** +**[httpx.Response](../../models/data.md)** ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/codatsyncpayables/README.md b/sync-for-payables/docs/sdks/codatsyncpayables/README.md deleted file mode 100644 index 48d6c7553..000000000 --- a/sync-for-payables/docs/sdks/codatsyncpayables/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# CodatSyncPayables SDK - -## Overview - -Bill pay kit: The API reference for the Bill Pay kit. - -The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. - -[Explore product](https://docs.codat.io/payables/bill-pay-kit) | [See OpenAPI spec](https://github.com/codatio/oas) - ---- -## Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Oracle NetSuite | Yes | -| Xero | Yes | - ---- - -## Endpoints - -| Endpoints | Description | -| :- |:- | -| Companies | Create and manage your SMB users' companies. | -| Connections | Create new and manage existing data connections for a company. | -| Company information | View company profile from the source platform. | -| Bills | Get, create, and update Bills. | -| Bill payments | Get, create, and update Bill payments. | -| Suppliers | Get, create, and update Suppliers. | -| Bank accounts | Create a bank account for a given company's connection. | - - -### Available Operations diff --git a/sync-for-payables/docs/sdks/companies/README.md b/sync-for-payables/docs/sdks/companies/README.md index ea7130cf3..11511bc79 100644 --- a/sync-for-payables/docs/sdks/companies/README.md +++ b/sync-for-payables/docs/sdks/companies/README.md @@ -1,5 +1,4 @@ # Companies -(*companies*) ## Overview @@ -9,6 +8,7 @@ Create and manage your SMB users' companies. * [list](#list) - List companies * [create](#create) - Create company +* [replace](#replace) - Replace company * [update](#update) - Update company * [delete](#delete) - Delete a company * [get](#get) - Get company @@ -20,27 +20,65 @@ Create and manage your SMB users' companies. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. -### Example Usage +## 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: List of Companies + + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.list(request={ - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: One company + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.list(request={ + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + "order_by": "-modifiedDate", + "tags": "region=uk && team=invoice-finance", + }) + + # Handle response + print(res) ``` @@ -57,10 +95,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -71,25 +110,95 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. -### Example Usage +### Example Usage: Malformed query + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + + res = codat_sync_payables.companies.create(request={ + "name": "Bank of Dave", + "description": "Requested early access to the new financing scheme.", + }) + + # Handle response + print(res) + +``` +### Example Usage: With a description + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + res = codat_sync_payables.companies.create(request={ "name": "Technicalium", + "description": "Technology services, including web and app design and development", + }) + + # Handle response + print(res) + +``` +### Example Usage: With a tag + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.create(request={ + "name": "Bank of Dave", "description": "Requested early access to the new financing scheme.", }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: With no description + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.create(request={ + "name": "Technicalium", + }) + + # Handle response + print(res) ``` @@ -106,40 +215,200 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | -## update +## replace -Use the *Update company* endpoint to update both the name and description of the company. +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. -### Example Usage +### Example Usage: Unauthorized + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: - res = codat_sync_payables.companies.update(request={ + + res = codat_sync_payables.companies.replace(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_request_body": { + "name": "Bank of Dave", + "description": "Requested early access to the new financing scheme.", + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Update description + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.replace(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_request_body": { + "name": "Same name", + "description": "Additional documents required", + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Update name + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.replace(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "company_request_body": { "name": "New Name", + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `request` | [operations.ReplaceCompanyRequest](../../models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[shared.Company](../../models/shared/company.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Use the *Update company* endpoint to update the name, description, or tags of the company. + +The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + +### Example Usage: Unauthorized + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_update_request": { + "name": "Bank of Dave", "description": "Requested early access to the new financing scheme.", }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: Update name + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_update_request": { + "name": "New Name", + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Update tags + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_update_request": { + "tags": { + "refrence": "new reference", + }, + }, + }) + + # Handle response + print(res) ``` @@ -156,10 +425,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -171,15 +441,18 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + codat_sync_payables.companies.delete(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) @@ -197,10 +470,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -210,24 +484,70 @@ A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) repres Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. -### Example Usage +### Example Usage: Parent multi-entity company + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + # Handle response + print(res) + +``` +### Example Usage: Simple company + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.companies.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + # Handle response + print(res) + +``` +### Example Usage: Subsidiary multi-entity company + + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.companies.get(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -244,7 +564,8 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/companyinformation/README.md b/sync-for-payables/docs/sdks/companyinformation/README.md index 849449efc..80ce6cb10 100644 --- a/sync-for-payables/docs/sdks/companyinformation/README.md +++ b/sync-for-payables/docs/sdks/companyinformation/README.md @@ -1,5 +1,4 @@ # CompanyInformation -(*company_information*) ## Overview @@ -17,23 +16,25 @@ Use the *Get company information* endpoint to return information about the compa ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.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 + # Handle response + print(res) ``` @@ -50,7 +51,8 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/connections/README.md b/sync-for-payables/docs/sdks/connections/README.md index 6f6488c73..9dce0e2b9 100644 --- a/sync-for-payables/docs/sdks/connections/README.md +++ b/sync-for-payables/docs/sdks/connections/README.md @@ -1,5 +1,4 @@ # Connections -(*connections*) ## Overview @@ -19,26 +18,26 @@ Create new and manage existing data connections for a company. ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.connections.list(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "page": 1, - "page_size": 100, "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", "order_by": "-modifiedDate", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -55,10 +54,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -66,17 +66,45 @@ with CodatSyncPayables( Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. -### Example Usage +### Example Usage: Connection + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.connections.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": { + "platform_key": "gbol", + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Unauthorized + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.connections.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "request_body": { @@ -84,9 +112,8 @@ with CodatSyncPayables( }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -103,10 +130,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -114,23 +142,25 @@ with CodatSyncPayables( ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.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 + # Handle response + print(res) ``` @@ -147,10 +177,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -159,15 +190,18 @@ This operation is not reversible. The end user would need to reauthorize a new d ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + codat_sync_payables.connections.delete(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -186,10 +220,11 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## unlink @@ -197,15 +232,18 @@ with CodatSyncPayables( ### Example Usage + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.connections.unlink(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -214,9 +252,8 @@ with CodatSyncPayables( }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -233,7 +270,8 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/suppliers/README.md b/sync-for-payables/docs/sdks/suppliers/README.md index e00893a0d..f0c1eb59a 100644 --- a/sync-for-payables/docs/sdks/suppliers/README.md +++ b/sync-for-payables/docs/sdks/suppliers/README.md @@ -1,5 +1,4 @@ # Suppliers -(*suppliers*) ## Overview @@ -20,17 +19,20 @@ By default, this endpoint returns a list of active and archived suppliers. You c For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. -### Example Usage +### Example Usage: Source modified date + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.suppliers.list(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", @@ -38,9 +40,132 @@ with CodatSyncPayables( "query": "sourceModifiedDate>2023-12-15T00:00:00.000Z", }) - if res is not None: - # handle response - pass + # Handle response + print(res) + +``` +### Example Usage: Status (active) + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.suppliers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "status=Active", + }) + + # Handle response + print(res) + +``` +### Example Usage: Status (active) & source modified date + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.suppliers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", + }) + + # Handle response + print(res) + +``` +### Example Usage: Status (archived) + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.suppliers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "status=Archived", + }) + + # Handle response + print(res) + +``` +### Example Usage: Status (archived) & source modified date + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.suppliers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + "query": "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", + }) + + # Handle response + print(res) + +``` +### Example Usage: Suppliers + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.suppliers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "continuation_token": "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }) + + # Handle response + print(res) ``` @@ -57,35 +182,66 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create -The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. +The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + +### Example Usage: Malformed query + + +```python +from codat_sync_for_payables import CodatSyncPayables +from codat_sync_for_payables.models import shared + + +with CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as codat_sync_payables: + + res = codat_sync_payables.suppliers.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "supplier_prototype": { + "supplier_name": "", + "phone": "+44 25691 154789", + "status": shared.SupplierStatus.UNKNOWN, + }, + }) + # Handle response + print(res) -### Example Usage +``` +### Example Usage: Suppliers + ```python from codat_sync_for_payables import CodatSyncPayables from codat_sync_for_payables.models import shared + with CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) as codat_sync_payables: + res = codat_sync_payables.suppliers.create(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "supplier_prototype": { "supplier_name": "Greggs", - "status": shared.SupplierStatus.ACTIVE, "contact_name": "Greg Greggs", "email_address": "greg@greggs.com", "phone": "+44 (0)1223 322410", @@ -100,13 +256,13 @@ with CodatSyncPayables( "postal_code": "EC1N 7TE", }, ], + "status": shared.SupplierStatus.ACTIVE, "default_currency": "GBP", }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -123,7 +279,8 @@ with CodatSyncPayables( ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/poetry.lock b/sync-for-payables/poetry.lock index 659bfc3b1..8e2a212db 100644 --- a/sync-for-payables/poetry.lock +++ b/sync-for-payables/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,20 +6,19 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "anyio" version = "4.5.2" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, @@ -33,7 +32,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] trio = ["trio (>=0.26.1)"] [[package]] @@ -42,6 +41,7 @@ version = "3.2.4" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, @@ -56,6 +56,7 @@ version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, @@ -67,6 +68,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -78,6 +81,7 @@ version = "0.3.9" description = "serialize all of Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, @@ -87,26 +91,14 @@ files = [ graph = ["objgraph (>=1.7.2)"] profile = ["gprof2dot (>=2022.7.29)"] -[[package]] -name = "eval-type-backport" -version = "0.2.0" -description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." -optional = false -python-versions = ">=3.8" -files = [ - {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, - {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, -] - -[package.extras] -tests = ["pytest"] - [[package]] name = "exceptiongroup" version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main"] +markers = "python_version == \"3.10\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -117,29 +109,31 @@ test = ["pytest (>=6)"] [[package]] name = "h11" -version = "0.14.0" +version = "0.16.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, - {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, ] [[package]] name = "httpcore" -version = "1.0.6" +version = "1.0.9" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, - {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, ] [package.dependencies] certifi = "*" -h11 = ">=0.13,<0.15" +h11 = ">=0.16" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] @@ -153,6 +147,7 @@ version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, @@ -165,7 +160,7 @@ httpcore = "==1.*" idna = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -177,6 +172,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -191,6 +187,7 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -199,23 +196,13 @@ files = [ [package.extras] colors = ["colorama (>=0.4.6)"] -[[package]] -name = "jsonpath-python" -version = "1.0.6" -description = "A more powerful JSONPath implementation in modern python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, - {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, -] - [[package]] name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -223,49 +210,50 @@ files = [ [[package]] name = "mypy" -version = "1.13.0" +version = "1.15.0" description = "Optional static typing for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["dev"] files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, + {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, + {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, + {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, + {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, + {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, + {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, + {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, + {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, + {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, + {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, + {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, + {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, ] [package.dependencies] -mypy-extensions = ">=1.0.0" +mypy_extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" +typing_extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] @@ -280,17 +268,31 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] +[[package]] +name = "nodeenv" +version = "1.10.0" +description = "Node.js virtual environment builder" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +files = [ + {file = "nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827"}, + {file = "nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb"}, +] + [[package]] name = "platformdirs" version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -303,131 +305,133 @@ type = ["mypy (>=1.11.2)"] [[package]] name = "pydantic" -version = "2.10.3" +version = "2.11.10" description = "Data validation using Python type hints" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, - {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, + {file = "pydantic-2.11.10-py3-none-any.whl", hash = "sha256:802a655709d49bd004c31e865ef37da30b540786a46bfce02333e0e24b5fe29a"}, + {file = "pydantic-2.11.10.tar.gz", hash = "sha256:dc280f0982fbda6c38fada4e476dc0a4f3aeaf9c6ad4c28df68a666ec3c61423"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.27.1" +pydantic-core = "2.33.2" typing-extensions = ">=4.12.2" +typing-inspection = ">=0.4.0" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" -version = "2.27.1" +version = "2.33.2" description = "Core functionality for Pydantic validation and serialization" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a"}, - {file = "pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:121ceb0e822f79163dd4699e4c54f5ad38b157084d97b34de8b232bcaad70278"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4603137322c18eaf2e06a4495f426aa8d8388940f3c457e7548145011bb68e05"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a33cd6ad9017bbeaa9ed78a2e0752c5e250eafb9534f308e7a5f7849b0b1bfb4"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15cc53a3179ba0fcefe1e3ae50beb2784dede4003ad2dfd24f81bba4b23a454f"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45d9c5eb9273aa50999ad6adc6be5e0ecea7e09dbd0d31bd0c65a55a2592ca08"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8bf7b66ce12a2ac52d16f776b31d16d91033150266eb796967a7e4621707e4f6"}, - {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:655d7dd86f26cb15ce8a431036f66ce0318648f8853d709b4167786ec2fa4807"}, - {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5556470f1a2157031e676f776c2bc20acd34c1990ca5f7e56f1ebf938b9ab57c"}, - {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f69ed81ab24d5a3bd93861c8c4436f54afdf8e8cc421562b0c7504cf3be58206"}, - {file = "pydantic_core-2.27.1-cp310-none-win32.whl", hash = "sha256:f5a823165e6d04ccea61a9f0576f345f8ce40ed533013580e087bd4d7442b52c"}, - {file = "pydantic_core-2.27.1-cp310-none-win_amd64.whl", hash = "sha256:57866a76e0b3823e0b56692d1a0bf722bffb324839bb5b7226a7dbd6c9a40b17"}, - {file = "pydantic_core-2.27.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ac3b20653bdbe160febbea8aa6c079d3df19310d50ac314911ed8cc4eb7f8cb8"}, - {file = "pydantic_core-2.27.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a5a8e19d7c707c4cadb8c18f5f60c843052ae83c20fa7d44f41594c644a1d330"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f7059ca8d64fea7f238994c97d91f75965216bcbe5f695bb44f354893f11d52"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bed0f8a0eeea9fb72937ba118f9db0cb7e90773462af7962d382445f3005e5a4"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3cb37038123447cf0f3ea4c74751f6a9d7afef0eb71aa07bf5f652b5e6a132c"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84286494f6c5d05243456e04223d5a9417d7f443c3b76065e75001beb26f88de"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acc07b2cfc5b835444b44a9956846b578d27beeacd4b52e45489e93276241025"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fefee876e07a6e9aad7a8c8c9f85b0cdbe7df52b8a9552307b09050f7512c7e"}, - {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:258c57abf1188926c774a4c94dd29237e77eda19462e5bb901d88adcab6af919"}, - {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:35c14ac45fcfdf7167ca76cc80b2001205a8d5d16d80524e13508371fb8cdd9c"}, - {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1b26e1dff225c31897696cab7d4f0a315d4c0d9e8666dbffdb28216f3b17fdc"}, - {file = "pydantic_core-2.27.1-cp311-none-win32.whl", hash = "sha256:2cdf7d86886bc6982354862204ae3b2f7f96f21a3eb0ba5ca0ac42c7b38598b9"}, - {file = "pydantic_core-2.27.1-cp311-none-win_amd64.whl", hash = "sha256:3af385b0cee8df3746c3f406f38bcbfdc9041b5c2d5ce3e5fc6637256e60bbc5"}, - {file = "pydantic_core-2.27.1-cp311-none-win_arm64.whl", hash = "sha256:81f2ec23ddc1b476ff96563f2e8d723830b06dceae348ce02914a37cb4e74b89"}, - {file = "pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f"}, - {file = "pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089"}, - {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381"}, - {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb"}, - {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae"}, - {file = "pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c"}, - {file = "pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16"}, - {file = "pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e"}, - {file = "pydantic_core-2.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f216dbce0e60e4d03e0c4353c7023b202d95cbaeff12e5fd2e82ea0a66905073"}, - {file = "pydantic_core-2.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a2e02889071850bbfd36b56fd6bc98945e23670773bc7a76657e90e6b6603c08"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42b0e23f119b2b456d07ca91b307ae167cc3f6c846a7b169fca5326e32fdc6cf"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:764be71193f87d460a03f1f7385a82e226639732214b402f9aa61f0d025f0737"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c00666a3bd2f84920a4e94434f5974d7bbc57e461318d6bb34ce9cdbbc1f6b2"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccaa88b24eebc0f849ce0a4d09e8a408ec5a94afff395eb69baf868f5183107"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c65af9088ac534313e1963443d0ec360bb2b9cba6c2909478d22c2e363d98a51"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206b5cf6f0c513baffaeae7bd817717140770c74528f3e4c3e1cec7871ddd61a"}, - {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:062f60e512fc7fff8b8a9d680ff0ddaaef0193dba9fa83e679c0c5f5fbd018bc"}, - {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a0697803ed7d4af5e4c1adf1670af078f8fcab7a86350e969f454daf598c4960"}, - {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:58ca98a950171f3151c603aeea9303ef6c235f692fe555e883591103da709b23"}, - {file = "pydantic_core-2.27.1-cp313-none-win32.whl", hash = "sha256:8065914ff79f7eab1599bd80406681f0ad08f8e47c880f17b416c9f8f7a26d05"}, - {file = "pydantic_core-2.27.1-cp313-none-win_amd64.whl", hash = "sha256:ba630d5e3db74c79300d9a5bdaaf6200172b107f263c98a0539eeecb857b2337"}, - {file = "pydantic_core-2.27.1-cp313-none-win_arm64.whl", hash = "sha256:45cf8588c066860b623cd11c4ba687f8d7175d5f7ef65f7129df8a394c502de5"}, - {file = "pydantic_core-2.27.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:5897bec80a09b4084aee23f9b73a9477a46c3304ad1d2d07acca19723fb1de62"}, - {file = "pydantic_core-2.27.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d0165ab2914379bd56908c02294ed8405c252250668ebcb438a55494c69f44ab"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b9af86e1d8e4cfc82c2022bfaa6f459381a50b94a29e95dcdda8442d6d83864"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f6c8a66741c5f5447e047ab0ba7a1c61d1e95580d64bce852e3df1f895c4067"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a42d6a8156ff78981f8aa56eb6394114e0dedb217cf8b729f438f643608cbcd"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64c65f40b4cd8b0e049a8edde07e38b476da7e3aaebe63287c899d2cff253fa5"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdcf339322a3fae5cbd504edcefddd5a50d9ee00d968696846f089b4432cf78"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf99c8404f008750c846cb4ac4667b798a9f7de673ff719d705d9b2d6de49c5f"}, - {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8f1edcea27918d748c7e5e4d917297b2a0ab80cad10f86631e488b7cddf76a36"}, - {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:159cac0a3d096f79ab6a44d77a961917219707e2a130739c64d4dd46281f5c2a"}, - {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:029d9757eb621cc6e1848fa0b0310310de7301057f623985698ed7ebb014391b"}, - {file = "pydantic_core-2.27.1-cp38-none-win32.whl", hash = "sha256:a28af0695a45f7060e6f9b7092558a928a28553366519f64083c63a44f70e618"}, - {file = "pydantic_core-2.27.1-cp38-none-win_amd64.whl", hash = "sha256:2d4567c850905d5eaaed2f7a404e61012a51caf288292e016360aa2b96ff38d4"}, - {file = "pydantic_core-2.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e9386266798d64eeb19dd3677051f5705bf873e98e15897ddb7d76f477131967"}, - {file = "pydantic_core-2.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4228b5b646caa73f119b1ae756216b59cc6e2267201c27d3912b592c5e323b60"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3dfe500de26c52abe0477dde16192ac39c98f05bf2d80e76102d394bd13854"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aee66be87825cdf72ac64cb03ad4c15ffef4143dbf5c113f64a5ff4f81477bf9"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b748c44bb9f53031c8cbc99a8a061bc181c1000c60a30f55393b6e9c45cc5bd"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ca038c7f6a0afd0b2448941b6ef9d5e1949e999f9e5517692eb6da58e9d44be"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e0bd57539da59a3e4671b90a502da9a28c72322a4f17866ba3ac63a82c4498e"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ac6c2c45c847bbf8f91930d88716a0fb924b51e0c6dad329b793d670ec5db792"}, - {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b94d4ba43739bbe8b0ce4262bcc3b7b9f31459ad120fb595627eaeb7f9b9ca01"}, - {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:00e6424f4b26fe82d44577b4c842d7df97c20be6439e8e685d0d715feceb9fb9"}, - {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:38de0a70160dd97540335b7ad3a74571b24f1dc3ed33f815f0880682e6880131"}, - {file = "pydantic_core-2.27.1-cp39-none-win32.whl", hash = "sha256:7ccebf51efc61634f6c2344da73e366c75e735960b5654b63d7e6f69a5885fa3"}, - {file = "pydantic_core-2.27.1-cp39-none-win_amd64.whl", hash = "sha256:a57847b090d7892f123726202b7daa20df6694cbd583b67a592e856bff603d6c"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3fa80ac2bd5856580e242dbc202db873c60a01b20309c8319b5c5986fbe53ce6"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d950caa237bb1954f1b8c9227b5065ba6875ac9771bb8ec790d956a699b78676"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e4216e64d203e39c62df627aa882f02a2438d18a5f21d7f721621f7a5d3611d"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:02a3d637bd387c41d46b002f0e49c52642281edacd2740e5a42f7017feea3f2c"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:161c27ccce13b6b0c8689418da3885d3220ed2eae2ea5e9b2f7f3d48f1d52c27"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:19910754e4cc9c63bc1c7f6d73aa1cfee82f42007e407c0f413695c2f7ed777f"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:e173486019cc283dc9778315fa29a363579372fe67045e971e89b6365cc035ed"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:af52d26579b308921b73b956153066481f064875140ccd1dfd4e77db89dbb12f"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:981fb88516bd1ae8b0cbbd2034678a39dedc98752f264ac9bc5839d3923fa04c"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5fde892e6c697ce3e30c61b239330fc5d569a71fefd4eb6512fc6caec9dd9e2f"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:816f5aa087094099fff7edabb5e01cc370eb21aa1a1d44fe2d2aefdfb5599b31"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c10c309e18e443ddb108f0ef64e8729363adbfd92d6d57beec680f6261556f3"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98476c98b02c8e9b2eec76ac4156fd006628b1b2d0ef27e548ffa978393fd154"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3027001c28434e7ca5a6e1e527487051136aa81803ac812be51802150d880dd"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:7699b1df36a48169cdebda7ab5a2bac265204003f153b4bd17276153d997670a"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1c39b07d90be6b48968ddc8c19e7585052088fd7ec8d568bb31ff64c70ae3c97"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:46ccfe3032b3915586e469d4972973f893c0a2bb65669194a5bdea9bacc088c2"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:62ba45e21cf6571d7f716d903b5b7b6d2617e2d5d67c0923dc47b9d41369f840"}, - {file = "pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235"}, + {file = "pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8"}, + {file = "pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a"}, + {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac"}, + {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a"}, + {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b"}, + {file = "pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22"}, + {file = "pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640"}, + {file = "pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7"}, + {file = "pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e"}, + {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d"}, + {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30"}, + {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf"}, + {file = "pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51"}, + {file = "pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab"}, + {file = "pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65"}, + {file = "pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc"}, + {file = "pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b"}, + {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1"}, + {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6"}, + {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea"}, + {file = "pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290"}, + {file = "pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2"}, + {file = "pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab"}, + {file = "pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f"}, + {file = "pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56"}, + {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5"}, + {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e"}, + {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162"}, + {file = "pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849"}, + {file = "pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9"}, + {file = "pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9"}, + {file = "pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac"}, + {file = "pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5"}, + {file = "pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9"}, + {file = "pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d"}, + {file = "pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a"}, + {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782"}, + {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9"}, + {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e"}, + {file = "pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9"}, + {file = "pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27"}, + {file = "pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc"}, ] [package.dependencies] @@ -439,6 +443,7 @@ version = "3.2.3" description = "python code static checker" optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, @@ -450,43 +455,38 @@ colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.6", markers = "python_version == \"3.11\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" platformdirs = ">=2.2.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} [package.extras] spelling = ["pyenchant (>=3.2,<4.0)"] testutils = ["gitpython (>3)"] [[package]] -name = "python-dateutil" -version = "2.8.2" -description = "Extensions to the standard Python datetime module" +name = "pyright" +version = "1.1.398" +description = "Command line wrapper for pyright" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +python-versions = ">=3.7" +groups = ["dev"] files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, + {file = "pyright-1.1.398-py3-none-any.whl", hash = "sha256:0a70bfd007d9ea7de1cf9740e1ad1a40a122592cfe22a3f6791b06162ad08753"}, + {file = "pyright-1.1.398.tar.gz", hash = "sha256:357a13edd9be8082dc73be51190913e475fa41a6efb6ec0d4b7aab3bc11638d8"}, ] [package.dependencies] -six = ">=1.5" +nodeenv = ">=1.6.0" +typing-extensions = ">=4.1" -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] +[package.extras] +all = ["nodejs-wheel-binaries", "twine (>=3.4.1)"] +dev = ["twine (>=3.4.1)"] +nodejs = ["nodejs-wheel-binaries"] [[package]] name = "sniffio" @@ -494,6 +494,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -505,6 +506,8 @@ version = "2.0.2" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, @@ -516,49 +519,40 @@ version = "0.13.2" description = "Style preserving TOML library" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, ] -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20241003" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -files = [ - {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"}, - {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"}, -] - [[package]] name = "typing-extensions" version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] -name = "typing-inspect" -version = "0.9.0" -description = "Runtime inspection utilities for typing module." +name = "typing-inspection" +version = "0.4.2" +description = "Runtime typing introspection tools" optional = false -python-versions = "*" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, - {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, + {file = "typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7"}, + {file = "typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464"}, ] [package.dependencies] -mypy-extensions = ">=0.3.0" -typing-extensions = ">=3.7.4" +typing-extensions = ">=4.12.0" [metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "231d09484040ca8e2e4ea801ceedb0b672113dd483caa7cb13d217c3e92d7655" +lock-version = "2.1" +python-versions = ">=3.10" +content-hash = "f6a8355b7012376d6650030a1b23aaf67653ed8ccc9eae2880ccb8d9a23e3d6b" diff --git a/sync-for-payables/poetry.toml b/sync-for-payables/poetry.toml index ab1033bd3..cd3492ac9 100644 --- a/sync-for-payables/poetry.toml +++ b/sync-for-payables/poetry.toml @@ -1,2 +1,3 @@ + [virtualenvs] in-project = true diff --git a/sync-for-payables/pylintrc b/sync-for-payables/pylintrc index 508003862..ba6a998b8 100644 --- a/sync-for-payables/pylintrc +++ b/sync-for-payables/pylintrc @@ -89,7 +89,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.8 +py-version=3.10 # Discover python modules and packages in the file system subtree. recursive=no @@ -454,7 +454,11 @@ disable=raw-checker-failed, bare-except, broad-exception-caught, fixme, - relative-beyond-top-level + relative-beyond-top-level, + consider-using-with, + wildcard-import, + unused-wildcard-import, + too-many-return-statements # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -655,4 +659,4 @@ init-import=no # List of qualified module names which can have objects that can redefine # builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/sync-for-payables/pyproject.toml b/sync-for-payables/pyproject.toml index ff6792b79..bcc8837b0 100644 --- a/sync-for-payables/pyproject.toml +++ b/sync-for-payables/pyproject.toml @@ -1,9 +1,18 @@ -[tool.poetry] + +[project] name = "codat-sync-for-payables" -version = "8.0.3" +version = "9.0.0" description = "Streamline your customers' accounts payable workflow." -authors = ["Speakeasy",] +authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" +requires-python = ">=3.10" +dependencies = [ + "httpcore >=1.0.9", + "httpx >=0.28.1", + "pydantic >=2.11.2", +] + +[tool.poetry] repository = "https://github.com/codatio/client-sdk-python.git" packages = [ { include = "codat_sync_for_payables", from = "src" } @@ -16,29 +25,23 @@ include = ["py.typed", "src/codat_sync_for_payables/py.typed"] [virtualenvs] in-project = true -[tool.poetry.dependencies] -python = "^3.8" -eval-type-backport = "^0.2.0" -httpx = "^0.28.1" -jsonpath-python = "^1.0.6" -pydantic = "~2.10.3" -python-dateutil = "^2.8.2" -typing-inspect = "^0.9.0" - [tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" +mypy = "==1.15.0" pylint = "==3.2.3" -types-python-dateutil = "^2.9.0.20240316" +pyright = "==1.1.398" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" pythonpath = ["src"] [tool.mypy] disable_error_code = "misc" +explicit_package_bases = true +mypy_path = "src" [[tool.mypy.overrides]] module = "typing_inspect" diff --git a/sync-for-payables/scripts/prepare-readme.py b/sync-for-payables/scripts/prepare_readme.py similarity index 71% rename from sync-for-payables/scripts/prepare-readme.py rename to sync-for-payables/scripts/prepare_readme.py index 7c07cddd7..dcc17f2c0 100644 --- a/sync-for-payables/scripts/prepare-readme.py +++ b/sync-for-payables/scripts/prepare_readme.py @@ -4,30 +4,35 @@ import shutil try: - with open("README.md", "r") as rh: + with open("README.md", "r", encoding="utf-8") as rh: readme_contents = rh.read() GITHUB_URL = "https://github.com/codatio/client-sdk-python.git" GITHUB_URL = ( GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL ) + REPO_SUBDIR = "sync-for-payables" + # Ensure the subdirectory has a trailing slash + if not REPO_SUBDIR.endswith("/"): + REPO_SUBDIR += "/" # links on PyPI should have absolute URLs readme_contents = re.sub( r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", lambda m: m.group(1) + GITHUB_URL + "/blob/master/" + + REPO_SUBDIR + m.group(2) + m.group(3), readme_contents, ) - with open("README-PYPI.md", "w") as wh: + with open("README-PYPI.md", "w", encoding="utf-8") as wh: wh.write(readme_contents) except Exception as e: try: print("Failed to rewrite README.md to README-PYPI.md, copying original instead") print(e) shutil.copyfile("README.md", "README-PYPI.md") - except Exception as e: + except Exception as ie: print("Failed to copy README.md to README-PYPI.md") - print(e) + print(ie) diff --git a/sync-for-payables/scripts/publish.sh b/sync-for-payables/scripts/publish.sh index ab45b1f94..2a3ead70c 100755 --- a/sync-for-payables/scripts/publish.sh +++ b/sync-for-payables/scripts/publish.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash - export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} -poetry run python scripts/prepare-readme.py +poetry run python scripts/prepare_readme.py poetry publish --build --skip-existing diff --git a/sync-for-payables/src/codat_sync_for_payables/__init__.py b/sync-for-payables/src/codat_sync_for_payables/__init__.py index 5c3491793..833c68cd5 100644 --- a/sync-for-payables/src/codat_sync_for_payables/__init__.py +++ b/sync-for-payables/src/codat_sync_for_payables/__init__.py @@ -1,8 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._version import __title__, __version__ +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) from .sdk import * from .sdkconfiguration import * VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/sync-for-payables/src/codat_sync_for_payables/_hooks/types.py b/sync-for-payables/src/codat_sync_for_payables/_hooks/types.py index 3ab046986..4c4a0dfe5 100644 --- a/sync-for-payables/src/codat_sync_for_payables/_hooks/types.py +++ b/sync-for-payables/src/codat_sync_for_payables/_hooks/types.py @@ -2,21 +2,28 @@ from abc import ABC, abstractmethod from codat_sync_for_payables.httpclient import HttpClient +from codat_sync_for_payables.sdkconfiguration import SDKConfiguration import httpx from typing import Any, Callable, List, Optional, Tuple, Union class HookContext: + config: SDKConfiguration + base_url: str operation_id: str oauth2_scopes: Optional[List[str]] = None security_source: Optional[Union[Any, Callable[[], Any]]] = None def __init__( self, + config: SDKConfiguration, + base_url: str, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]], ): + self.config = config + self.base_url = base_url self.operation_id = operation_id self.oauth2_scopes = oauth2_scopes self.security_source = security_source @@ -25,21 +32,33 @@ def __init__( class BeforeRequestContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) class AfterSuccessContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) class AfterErrorContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) diff --git a/sync-for-payables/src/codat_sync_for_payables/_version.py b/sync-for-payables/src/codat_sync_for_payables/_version.py index d80e0bea7..2ce03c491 100644 --- a/sync-for-payables/src/codat_sync_for_payables/_version.py +++ b/sync-for-payables/src/codat_sync_for_payables/_version.py @@ -3,7 +3,10 @@ import importlib.metadata __title__: str = "codat-sync-for-payables" -__version__: str = "8.0.3" +__version__: str = "9.0.0" +__openapi_doc_version__: str = "3.0.0" +__gen_version__: str = "2.812.2" +__user_agent__: str = "speakeasy-sdk/python 9.0.0 2.812.2 3.0.0 codat-sync-for-payables" try: if __package__ is not None: diff --git a/sync-for-payables/src/codat_sync_for_payables/bank_accounts.py b/sync-for-payables/src/codat_sync_for_payables/bank_accounts.py index 60055333d..bed160dd6 100644 --- a/sync-for-payables/src/codat_sync_for_payables/bank_accounts.py +++ b/sync-for-payables/src/codat_sync_for_payables/bank_accounts.py @@ -5,7 +5,10 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast class BankAccounts(BaseSDK): @@ -21,6 +24,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, ) -> shared.BankAccount: r"""Create bank account @@ -32,6 +36,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 @@ -40,12 +45,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateBankAccountRequest) request = cast(operations.CreateBankAccountRequest, request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bankAccounts", base_url=base_url, @@ -56,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.bank_account_prototype, @@ -64,6 +72,7 @@ def create( "json", Optional[shared.BankAccountPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -81,8 +90,10 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-bank-account", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -101,30 +112,25 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.BankAccount) + return unmarshal_json_response(shared.BankAccount, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -136,6 +142,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, ) -> shared.BankAccount: r"""Create bank account @@ -147,6 +154,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 @@ -155,12 +163,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateBankAccountRequest) request = cast(operations.CreateBankAccountRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bankAccounts", base_url=base_url, @@ -171,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.bank_account_prototype, @@ -179,6 +190,7 @@ async def create_async( "json", Optional[shared.BankAccountPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -196,8 +208,10 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-bank-account", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -216,27 +230,22 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.BankAccount) + return unmarshal_json_response(shared.BankAccount, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/sync-for-payables/src/codat_sync_for_payables/basesdk.py b/sync-for-payables/src/codat_sync_for_payables/basesdk.py index c46df5304..0ba2366ce 100644 --- a/sync-for-payables/src/codat_sync_for_payables/basesdk.py +++ b/sync-for-payables/src/codat_sync_for_payables/basesdk.py @@ -12,19 +12,30 @@ RetryConfig, SerializedRequestBody, get_body_content, + run_sync_in_thread, ) import httpx -from typing import Callable, List, Optional, Tuple +from typing import Callable, List, Mapping, Optional, Tuple from urllib.parse import parse_qs, urlparse class BaseSDK: sdk_configuration: SDKConfiguration + parent_ref: Optional[object] = None + """ + Reference to the root SDK instance, if any. This will prevent it from + being garbage collected while there are active streams. + """ - def __init__(self, sdk_config: SDKConfiguration) -> None: + def __init__( + self, + sdk_config: SDKConfiguration, + parent_ref: Optional[object] = None, + ) -> None: self.sdk_configuration = sdk_config + self.parent_ref = parent_ref - def get_url(self, base_url, url_variables): + def _get_url(self, base_url, url_variables): sdk_url, sdk_variables = self.sdk_configuration.get_server_details() if base_url is None: @@ -35,7 +46,7 @@ def get_url(self, base_url, url_variables): return utils.template_url(base_url, url_variables) - def build_request_async( + def _build_request_async( self, method, path, @@ -54,9 +65,11 @@ def build_request_async( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, ) -> httpx.Request: client = self.sdk_configuration.async_client - return self.build_request_with_client( + return self._build_request_with_client( client, method, path, @@ -73,9 +86,11 @@ def build_request_async( timeout_ms, get_serialized_body, url_override, + http_headers, + allow_empty_value, ) - def build_request( + def _build_request( self, method, path, @@ -94,9 +109,11 @@ def build_request( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, ) -> httpx.Request: client = self.sdk_configuration.client - return self.build_request_with_client( + return self._build_request_with_client( client, method, path, @@ -113,9 +130,11 @@ def build_request( timeout_ms, get_serialized_body, url_override, + http_headers, + allow_empty_value, ) - def build_request_with_client( + def _build_request_with_client( self, client, method, @@ -135,13 +154,15 @@ def build_request_with_client( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, ) -> httpx.Request: query_params = {} url = url_override if url is None: url = utils.generate_url( - self.get_url(base_url, url_variables), + self._get_url(base_url, url_variables), path, request if request_has_path_params else None, _globals if request_has_path_params else None, @@ -150,6 +171,7 @@ def build_request_with_client( query_params = utils.get_query_params( request if request_has_query_params else None, _globals if request_has_query_params else None, + allow_empty_value, ) else: # Pick up the query parameter from the override so they can be @@ -190,6 +212,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( @@ -214,12 +240,12 @@ def do_request( client = self.sdk_configuration.client logger = self.sdk_configuration.debug_logger + hooks = self.sdk_configuration.__dict__["_hooks"] + def do(): http_res = None try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) logger.debug( "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", req.method, @@ -227,18 +253,20 @@ def do(): req.headers, get_body_content(req), ) + + if client is None: + raise ValueError("client is required") + http_res = client.send(req, stream=stream) except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) if e is not None: logger.debug("Request Exception", exc_info=True) raise e if http_res is None: logger.debug("Raising no response SDK error") - raise errors.SDKError("No response received") + raise errors.NoResponseError("No response received") logger.debug( "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", @@ -249,7 +277,7 @@ def do(): ) if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( + result, err = hooks.after_error( AfterErrorContext(hook_ctx), http_res, None ) if err is not None: @@ -259,7 +287,7 @@ def do(): http_res = result else: logger.debug("Raising unexpected SDK error") - raise errors.SDKError("Unexpected error occurred") + raise errors.SDKError("Unexpected error occurred", http_res) return http_res @@ -269,9 +297,7 @@ def do(): http_res = do() if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) return http_res @@ -286,12 +312,15 @@ async def do_request_async( client = self.sdk_configuration.async_client logger = self.sdk_configuration.debug_logger + hooks = self.sdk_configuration.__dict__["_hooks"] + async def do(): http_res = None try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request + req = await run_sync_in_thread( + hooks.before_request, BeforeRequestContext(hook_ctx), request ) + logger.debug( "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", req.method, @@ -299,18 +328,23 @@ async def do(): req.headers, get_body_content(req), ) + + if client is None: + raise ValueError("client is required") + http_res = await client.send(req, stream=stream) except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e + _, e = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), None, e ) + if e is not None: logger.debug("Request Exception", exc_info=True) raise e if http_res is None: logger.debug("Raising no response SDK error") - raise errors.SDKError("No response received") + raise errors.NoResponseError("No response received") logger.debug( "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", @@ -321,9 +355,10 @@ async def do(): ) if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), http_res, None + result, err = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), http_res, None ) + if err is not None: logger.debug("Request Exception", exc_info=True) raise err @@ -331,7 +366,7 @@ async def do(): http_res = result else: logger.debug("Raising unexpected SDK error") - raise errors.SDKError("Unexpected error occurred") + raise errors.SDKError("Unexpected error occurred", http_res) return http_res @@ -343,8 +378,8 @@ async def do(): http_res = await do() if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res + http_res = await run_sync_in_thread( + hooks.after_success, AfterSuccessContext(hook_ctx), http_res ) return http_res diff --git a/sync-for-payables/src/codat_sync_for_payables/bill_payments.py b/sync-for-payables/src/codat_sync_for_payables/bill_payments.py index 626b54850..9818c8963 100644 --- a/sync-for-payables/src/codat_sync_for_payables/bill_payments.py +++ b/sync-for-payables/src/codat_sync_for_payables/bill_payments.py @@ -5,7 +5,10 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast class BillPayments(BaseSDK): @@ -21,6 +24,7 @@ def get_payment_options( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.PaymentMappingOptions: r"""Get payment mapping options @@ -34,6 +38,7 @@ def get_payment_options( :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 @@ -42,6 +47,8 @@ def get_payment_options( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -49,7 +56,7 @@ def get_payment_options( ) request = cast(operations.GetMappingOptionsPaymentsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments", base_url=base_url, @@ -60,7 +67,9 @@ def get_payment_options( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -78,8 +87,10 @@ def get_payment_options( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-mapping-options-payments", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -98,30 +109,25 @@ def get_payment_options( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.PaymentMappingOptions) + return unmarshal_json_response(shared.PaymentMappingOptions, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_payment_options_async( self, @@ -133,6 +139,7 @@ async def get_payment_options_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.PaymentMappingOptions: r"""Get payment mapping options @@ -146,6 +153,7 @@ async def get_payment_options_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 @@ -154,6 +162,8 @@ async def get_payment_options_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -161,7 +171,7 @@ async def get_payment_options_async( ) request = cast(operations.GetMappingOptionsPaymentsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments", base_url=base_url, @@ -172,7 +182,9 @@ async def get_payment_options_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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -190,8 +202,10 @@ async def get_payment_options_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-mapping-options-payments", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -210,30 +224,25 @@ async def get_payment_options_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.PaymentMappingOptions) + return unmarshal_json_response(shared.PaymentMappingOptions, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def create( self, @@ -245,6 +254,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, ) -> shared.BillPayment: r"""Create bill payment @@ -256,6 +266,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 @@ -264,12 +275,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateBillPaymentRequest) request = cast(operations.CreateBillPaymentRequest, request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment", base_url=base_url, @@ -280,6 +293,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.bill_payment_prototype, @@ -288,6 +302,7 @@ def create( "json", Optional[shared.BillPaymentPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -305,8 +320,10 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-bill-payment", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -326,30 +343,27 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.BillPayment) + return unmarshal_json_response(shared.BillPayment, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -361,6 +375,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, ) -> shared.BillPayment: r"""Create bill payment @@ -372,6 +387,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 @@ -380,12 +396,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateBillPaymentRequest) request = cast(operations.CreateBillPaymentRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment", base_url=base_url, @@ -396,6 +414,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.bill_payment_prototype, @@ -404,6 +423,7 @@ async def create_async( "json", Optional[shared.BillPaymentPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -421,8 +441,10 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-bill-payment", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -442,27 +464,24 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.BillPayment) + return unmarshal_json_response(shared.BillPayment, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/sync-for-payables/src/codat_sync_for_payables/bills.py b/sync-for-payables/src/codat_sync_for_payables/bills.py index dd7572751..517497d5c 100644 --- a/sync-for-payables/src/codat_sync_for_payables/bills.py +++ b/sync-for-payables/src/codat_sync_for_payables/bills.py @@ -5,8 +5,11 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) import httpx -from typing import Any, List, Optional, Union, cast +from typing import Any, List, Mapping, Optional, Union, cast class Bills(BaseSDK): @@ -22,6 +25,7 @@ def get_bill_options( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.BillMappingOptions: r"""Get bill mapping options @@ -35,6 +39,7 @@ def get_bill_options( :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 @@ -43,12 +48,14 @@ def get_bill_options( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetMappingOptionsBillsRequest) request = cast(operations.GetMappingOptionsBillsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills", base_url=base_url, @@ -59,7 +66,9 @@ def get_bill_options( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -77,8 +86,10 @@ def get_bill_options( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-mapping-options-bills", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -97,30 +108,25 @@ def get_bill_options( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.BillMappingOptions) + return unmarshal_json_response(shared.BillMappingOptions, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_bill_options_async( self, @@ -132,6 +138,7 @@ async def get_bill_options_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.BillMappingOptions: r"""Get bill mapping options @@ -145,6 +152,7 @@ async def get_bill_options_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 @@ -153,12 +161,14 @@ async def get_bill_options_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetMappingOptionsBillsRequest) request = cast(operations.GetMappingOptionsBillsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills", base_url=base_url, @@ -169,7 +179,9 @@ async def get_bill_options_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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -187,8 +199,10 @@ async def get_bill_options_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-mapping-options-bills", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -207,30 +221,25 @@ async def get_bill_options_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.BillMappingOptions) + return unmarshal_json_response(shared.BillMappingOptions, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def list( self, @@ -241,6 +250,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, ) -> shared.Bills: r"""List bills @@ -254,6 +264,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 @@ -262,12 +273,14 @@ def list( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListBillsRequest) request = cast(operations.ListBillsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/bills", base_url=base_url, @@ -278,7 +291,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -296,8 +311,10 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-bills", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -317,30 +334,27 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Bills) + return unmarshal_json_response(shared.Bills, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, @@ -351,6 +365,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, ) -> shared.Bills: r"""List bills @@ -364,6 +379,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 @@ -372,12 +388,14 @@ async def list_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListBillsRequest) request = cast(operations.ListBillsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/bills", base_url=base_url, @@ -388,7 +406,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -406,8 +426,10 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-bills", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -427,30 +449,27 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Bills) + return unmarshal_json_response(shared.Bills, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def create( self, @@ -461,6 +480,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, ) -> shared.Bill: r"""Create bill @@ -472,6 +492,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 @@ -480,12 +501,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateBillRequest) request = cast(operations.CreateBillRequest, request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bills", base_url=base_url, @@ -496,6 +519,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.bill_prototype, @@ -504,6 +528,7 @@ def create( "json", Optional[shared.BillPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -521,8 +546,10 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-bill", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -542,30 +569,27 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Bill) + return unmarshal_json_response(shared.Bill, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -576,6 +600,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, ) -> shared.Bill: r"""Create bill @@ -587,6 +612,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 @@ -595,12 +621,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateBillRequest) request = cast(operations.CreateBillRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bills", base_url=base_url, @@ -611,6 +639,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.bill_prototype, @@ -619,6 +648,7 @@ async def create_async( "json", Optional[shared.BillPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -636,8 +666,10 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-bill", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -657,31 +689,292 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Bill) + return unmarshal_json_response(shared.Bill, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + request: Union[ + operations.UpdateBillRequest, operations.UpdateBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> shared.Bill: + r"""Update bill + + The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + ### Supported Integrations + + | Integration | Supported | + |-------------------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Xero | Yes | + | Oracle NetSuite | No | + | Sage Intacct | No | + | Zoho Books | No | + + + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateBillRequest) + request = cast(operations.UpdateBillRequest, request) + + req = self._build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + 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.bill_prototype, + False, + True, + "json", + Optional[shared.BillPrototype], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update-bill", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(shared.Bill, http_res) + if utils.match_response( http_res, + ["400", "401", "402", "403", "404", "409", "429"], + "application/json", + ): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateBillRequest, operations.UpdateBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> shared.Bill: + r"""Update bill + + The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + ### Supported Integrations + + | Integration | Supported | + |-------------------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Xero | Yes | + | Oracle NetSuite | No | + | Sage Intacct | No | + | Zoho Books | No | + + + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateBillRequest) + request = cast(operations.UpdateBillRequest, request) + + req = self._build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + 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.bill_prototype, + False, + True, + "json", + Optional[shared.BillPrototype], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, ) + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update-bill", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(shared.Bill, http_res) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429"], + "application/json", + ): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + def upload_attachment( self, *, @@ -692,6 +985,7 @@ def upload_attachment( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.Attachment: r"""Upload bill attachment @@ -703,6 +997,7 @@ def upload_attachment( :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,12 +1006,14 @@ def upload_attachment( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UploadBillAttachmentRequest) request = cast(operations.UploadBillAttachmentRequest, request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", base_url=base_url, @@ -727,6 +1024,7 @@ def upload_attachment( 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.attachment_upload, @@ -735,6 +1033,7 @@ def upload_attachment( "multipart", Optional[shared.AttachmentUpload], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -752,8 +1051,10 @@ def upload_attachment( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="upload-bill-attachment", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -772,30 +1073,25 @@ def upload_attachment( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Attachment) + return unmarshal_json_response(shared.Attachment, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def upload_attachment_async( self, @@ -807,6 +1103,7 @@ async def upload_attachment_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.Attachment: r"""Upload bill attachment @@ -818,6 +1115,7 @@ async def upload_attachment_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 @@ -826,12 +1124,14 @@ async def upload_attachment_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UploadBillAttachmentRequest) request = cast(operations.UploadBillAttachmentRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", base_url=base_url, @@ -842,6 +1142,7 @@ async def upload_attachment_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.attachment_upload, @@ -850,6 +1151,7 @@ async def upload_attachment_async( "multipart", Optional[shared.AttachmentUpload], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -867,8 +1169,10 @@ async def upload_attachment_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="upload-bill-attachment", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -887,30 +1191,25 @@ async def upload_attachment_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Attachment) + return unmarshal_json_response(shared.Attachment, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def list_attachments( self, @@ -922,6 +1221,7 @@ def list_attachments( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> List[shared.Attachment]: r"""List bill attachments @@ -933,6 +1233,7 @@ def list_attachments( :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 @@ -941,12 +1242,14 @@ def list_attachments( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListBillAttachmentsRequest) request = cast(operations.ListBillAttachmentsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", base_url=base_url, @@ -957,7 +1260,9 @@ def list_attachments( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -975,8 +1280,10 @@ def list_attachments( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-bill-attachments", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -995,30 +1302,25 @@ def list_attachments( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, List[shared.Attachment]) + return unmarshal_json_response(List[shared.Attachment], http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "409", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "409", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def list_attachments_async( self, @@ -1030,6 +1332,7 @@ async def list_attachments_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> List[shared.Attachment]: r"""List bill attachments @@ -1041,6 +1344,7 @@ async def list_attachments_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 @@ -1049,12 +1353,14 @@ async def list_attachments_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListBillAttachmentsRequest) request = cast(operations.ListBillAttachmentsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", base_url=base_url, @@ -1065,7 +1371,9 @@ async def list_attachments_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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1083,8 +1391,10 @@ async def list_attachments_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-bill-attachments", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -1103,30 +1413,25 @@ async def list_attachments_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, List[shared.Attachment]) + return unmarshal_json_response(List[shared.Attachment], http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "409", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "409", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def download_attachment( self, @@ -1138,6 +1443,7 @@ def download_attachment( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Response: r"""Download bill attachment @@ -1152,6 +1458,7 @@ def download_attachment( :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 @@ -1160,12 +1467,14 @@ def download_attachment( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DownloadBillAttachmentRequest) request = cast(operations.DownloadBillAttachmentRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download", base_url=base_url, @@ -1176,7 +1485,9 @@ def download_attachment( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/octet-stream", + http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1194,8 +1505,10 @@ def download_attachment( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="download-bill-attachment", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -1214,31 +1527,32 @@ def download_attachment( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/octet-stream"): return http_res if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response( + errors.ErrorMessageData, http_res, http_res_text + ) + raise errors.ErrorMessage(response_data, http_res, http_res_text) + if utils.match_response(http_res, ["500", "503"], "application/json"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + response_data = unmarshal_json_response( + errors.ErrorMessageData, http_res, http_res_text ) + raise errors.ErrorMessage(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def download_attachment_async( self, @@ -1250,6 +1564,7 @@ async def download_attachment_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Response: r"""Download bill attachment @@ -1264,6 +1579,7 @@ async def download_attachment_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 @@ -1272,12 +1588,14 @@ async def download_attachment_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DownloadBillAttachmentRequest) request = cast(operations.DownloadBillAttachmentRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download", base_url=base_url, @@ -1288,7 +1606,9 @@ async def download_attachment_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/octet-stream", + http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1306,8 +1626,10 @@ async def download_attachment_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="download-bill-attachment", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -1326,28 +1648,29 @@ async def download_attachment_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/octet-stream"): return http_res if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response( + errors.ErrorMessageData, http_res, http_res_text + ) + raise errors.ErrorMessage(response_data, http_res, http_res_text) + if utils.match_response(http_res, ["500", "503"], "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + response_data = unmarshal_json_response( + errors.ErrorMessageData, http_res, http_res_text ) + raise errors.ErrorMessage(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/sync-for-payables/src/codat_sync_for_payables/companies.py b/sync-for-payables/src/codat_sync_for_payables/companies.py index a2ca7ebcf..0dbe0548a 100644 --- a/sync-for-payables/src/codat_sync_for_payables/companies.py +++ b/sync-for-payables/src/codat_sync_for_payables/companies.py @@ -5,7 +5,10 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast class Companies(BaseSDK): @@ -20,6 +23,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, ) -> shared.Companies: r"""List companies @@ -28,10 +32,24 @@ def list( A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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 @@ -40,12 +58,14 @@ def list( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListCompaniesRequest) request = cast(operations.ListCompaniesRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies", base_url=base_url, @@ -56,7 +76,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -74,8 +96,10 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-companies", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -94,30 +118,25 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Companies) + return unmarshal_json_response(shared.Companies, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, @@ -128,6 +147,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, ) -> shared.Companies: r"""List companies @@ -136,10 +156,24 @@ async def list_async( A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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 @@ -148,12 +182,14 @@ async def list_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListCompaniesRequest) request = cast(operations.ListCompaniesRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies", base_url=base_url, @@ -164,7 +200,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -182,8 +220,10 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-companies", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -202,30 +242,25 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Companies) + return unmarshal_json_response(shared.Companies, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def create( self, @@ -236,6 +271,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, ) -> shared.Company: r"""Create company @@ -250,6 +286,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 @@ -258,12 +295,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, Optional[shared.CompanyRequestBody]) request = cast(Optional[shared.CompanyRequestBody], request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies", base_url=base_url, @@ -274,10 +313,12 @@ 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] ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -295,8 +336,10 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -314,30 +357,25 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Company) + return unmarshal_json_response(shared.Company, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -348,6 +386,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, ) -> shared.Company: r"""Create company @@ -362,6 +401,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 @@ -370,12 +410,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, Optional[shared.CompanyRequestBody]) request = cast(Optional[shared.CompanyRequestBody], request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies", base_url=base_url, @@ -386,10 +428,12 @@ 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] ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -407,8 +451,10 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -426,31 +472,260 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Company) + return unmarshal_json_response(shared.Company, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def replace( + self, + *, + request: Union[ + operations.ReplaceCompanyRequest, operations.ReplaceCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> shared.Company: + r"""Replace company + + Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. + + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ReplaceCompanyRequest) + request = cast(operations.ReplaceCompanyRequest, request) + + req = self._build_request( + method="PUT", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + 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, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="replace-company", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(shared.Company, http_res) + if utils.match_response( + http_res, ["401", "402", "403", "404", "429"], "application/json" + ): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def replace_async( + self, + *, + request: Union[ + operations.ReplaceCompanyRequest, operations.ReplaceCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> shared.Company: + r"""Replace company + + Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. + + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ReplaceCompanyRequest) + request = cast(operations.ReplaceCompanyRequest, request) + + req = self._build_request_async( + method="PUT", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + 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, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="replace-company", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, ) + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(shared.Company, http_res) + if utils.match_response( + http_res, ["401", "402", "403", "404", "429"], "application/json" + ): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + def update( self, *, @@ -460,18 +735,21 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> shared.Company: r"""Update company - Use the *Update company* endpoint to update both the name and description of the company. + Use the *Update company* endpoint to update the name, description, or tags of the company. + + The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. :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 @@ -480,13 +758,15 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateCompanyRequest) request = cast(operations.UpdateCompanyRequest, request) - req = self.build_request( - method="PUT", + req = self._build_request( + method="PATCH", path="/companies/{companyId}", base_url=base_url, url_variables=url_variables, @@ -496,14 +776,16 @@ 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, + request.company_update_request, False, True, "json", - Optional[shared.CompanyRequestBody], + Optional[shared.CompanyUpdateRequest], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -521,8 +803,10 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="update-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -540,30 +824,25 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Company) + return unmarshal_json_response(shared.Company, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def update_async( self, @@ -574,18 +853,21 @@ 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, ) -> shared.Company: r"""Update company - Use the *Update company* endpoint to update both the name and description of the company. + Use the *Update company* endpoint to update the name, description, or tags of the company. + + The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-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. :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 @@ -594,13 +876,15 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateCompanyRequest) request = cast(operations.UpdateCompanyRequest, request) - req = self.build_request_async( - method="PUT", + req = self._build_request_async( + method="PATCH", path="/companies/{companyId}", base_url=base_url, url_variables=url_variables, @@ -610,14 +894,16 @@ 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, + request.company_update_request, False, True, "json", - Optional[shared.CompanyRequestBody], + Optional[shared.CompanyUpdateRequest], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -635,8 +921,10 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="update-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -654,30 +942,25 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Company) + return unmarshal_json_response(shared.Company, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def delete( self, @@ -688,6 +971,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 @@ -701,6 +985,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 @@ -709,12 +994,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteCompanyRequest) request = cast(operations.DeleteCompanyRequest, request) - req = self.build_request( + req = self._build_request( method="DELETE", path="/companies/{companyId}", base_url=base_url, @@ -725,7 +1012,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -743,8 +1032,10 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="delete-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -762,30 +1053,25 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, @@ -796,6 +1082,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 @@ -809,6 +1096,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 @@ -817,12 +1105,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteCompanyRequest) request = cast(operations.DeleteCompanyRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/companies/{companyId}", base_url=base_url, @@ -833,7 +1123,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -851,8 +1143,10 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="delete-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -870,30 +1164,25 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def get( self, @@ -904,6 +1193,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, ) -> shared.Company: r"""Get company @@ -917,6 +1207,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 @@ -925,12 +1216,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetCompanyRequest) request = cast(operations.GetCompanyRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}", base_url=base_url, @@ -941,7 +1234,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -959,8 +1254,10 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -978,30 +1275,25 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Company) + return unmarshal_json_response(shared.Company, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -1012,6 +1304,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, ) -> shared.Company: r"""Get company @@ -1025,6 +1318,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 @@ -1033,12 +1327,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetCompanyRequest) request = cast(operations.GetCompanyRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}", base_url=base_url, @@ -1049,7 +1345,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1067,8 +1365,10 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-company", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -1086,27 +1386,22 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Company) + return unmarshal_json_response(shared.Company, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/sync-for-payables/src/codat_sync_for_payables/company_information.py b/sync-for-payables/src/codat_sync_for_payables/company_information.py index 986c47a42..ccf258f53 100644 --- a/sync-for-payables/src/codat_sync_for_payables/company_information.py +++ b/sync-for-payables/src/codat_sync_for_payables/company_information.py @@ -5,7 +5,10 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast class CompanyInformation(BaseSDK): @@ -21,6 +24,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, ) -> shared.CompanyInformation: r"""Get company information @@ -32,6 +36,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 @@ -40,12 +45,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetCompanyInformationRequest) request = cast(operations.GetCompanyInformationRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/info", base_url=base_url, @@ -56,7 +63,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -74,8 +83,10 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-company-information", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -94,30 +105,25 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.CompanyInformation) + return unmarshal_json_response(shared.CompanyInformation, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -129,6 +135,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, ) -> shared.CompanyInformation: r"""Get company information @@ -140,6 +147,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 @@ -148,12 +156,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetCompanyInformationRequest) request = cast(operations.GetCompanyInformationRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/info", base_url=base_url, @@ -164,7 +174,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -182,8 +194,10 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-company-information", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -202,27 +216,22 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.CompanyInformation) + return unmarshal_json_response(shared.CompanyInformation, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/sync-for-payables/src/codat_sync_for_payables/connections.py b/sync-for-payables/src/codat_sync_for_payables/connections.py index e4dada5c9..e2e3103e8 100644 --- a/sync-for-payables/src/codat_sync_for_payables/connections.py +++ b/sync-for-payables/src/codat_sync_for_payables/connections.py @@ -5,7 +5,10 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast class Connections(BaseSDK): @@ -21,6 +24,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, ) -> shared.Connections: r"""List connections @@ -30,6 +34,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 @@ -38,12 +43,14 @@ def list( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListConnectionsRequest) request = cast(operations.ListConnectionsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections", base_url=base_url, @@ -54,7 +61,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -72,8 +81,10 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-connections", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -92,30 +103,25 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connections) + return unmarshal_json_response(shared.Connections, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, @@ -127,6 +133,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, ) -> shared.Connections: r"""List connections @@ -136,6 +143,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 @@ -144,12 +152,14 @@ async def list_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListConnectionsRequest) request = cast(operations.ListConnectionsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections", base_url=base_url, @@ -160,7 +170,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -178,8 +190,10 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-connections", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -198,30 +212,25 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connections) + return unmarshal_json_response(shared.Connections, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def create( self, @@ -233,6 +242,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, ) -> shared.Connection: r"""Create connection @@ -244,6 +254,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 @@ -252,12 +263,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateConnectionRequest) request = cast(operations.CreateConnectionRequest, request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies/{companyId}/connections", base_url=base_url, @@ -268,6 +281,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, @@ -276,6 +290,7 @@ def create( "json", Optional[operations.CreateConnectionRequestBody], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -293,8 +308,10 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -312,30 +329,25 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connection) + return unmarshal_json_response(shared.Connection, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -347,6 +359,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, ) -> shared.Connection: r"""Create connection @@ -358,6 +371,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 @@ -366,12 +380,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateConnectionRequest) request = cast(operations.CreateConnectionRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies/{companyId}/connections", base_url=base_url, @@ -382,6 +398,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, @@ -390,6 +407,7 @@ async def create_async( "json", Optional[operations.CreateConnectionRequestBody], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -407,8 +425,10 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -426,30 +446,25 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connection) + return unmarshal_json_response(shared.Connection, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def get( self, @@ -460,6 +475,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, ) -> shared.Connection: r"""Get connection @@ -469,6 +485,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 @@ -477,12 +494,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetConnectionRequest) request = cast(operations.GetConnectionRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}", base_url=base_url, @@ -493,7 +512,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -511,8 +532,10 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -530,30 +553,25 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connection) + return unmarshal_json_response(shared.Connection, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -564,6 +582,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, ) -> shared.Connection: r"""Get connection @@ -573,6 +592,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 @@ -581,12 +601,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetConnectionRequest) request = cast(operations.GetConnectionRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}", base_url=base_url, @@ -597,7 +619,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -615,8 +639,10 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="get-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -634,30 +660,25 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connection) + return unmarshal_json_response(shared.Connection, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def delete( self, @@ -669,6 +690,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 @@ -679,6 +701,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 @@ -687,12 +710,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteConnectionRequest) request = cast(operations.DeleteConnectionRequest, request) - req = self.build_request( + req = self._build_request( method="DELETE", path="/companies/{companyId}/connections/{connectionId}", base_url=base_url, @@ -703,7 +728,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -721,8 +748,10 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="delete-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -740,30 +769,25 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, @@ -775,6 +799,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 @@ -785,6 +810,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 @@ -793,12 +819,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteConnectionRequest) request = cast(operations.DeleteConnectionRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/companies/{companyId}/connections/{connectionId}", base_url=base_url, @@ -809,7 +837,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -827,8 +857,10 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="delete-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -846,30 +878,25 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def unlink( self, @@ -881,6 +908,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, ) -> shared.Connection: r"""Unlink connection @@ -890,6 +918,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 @@ -898,12 +927,14 @@ def unlink( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UnlinkConnectionRequest) request = cast(operations.UnlinkConnectionRequest, request) - req = self.build_request( + req = self._build_request( method="PATCH", path="/companies/{companyId}/connections/{connectionId}", base_url=base_url, @@ -914,6 +945,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, @@ -922,6 +954,7 @@ def unlink( "json", Optional[operations.UnlinkConnectionUpdateConnection], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -939,8 +972,10 @@ def unlink( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="unlink-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -958,30 +993,25 @@ def unlink( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connection) + return unmarshal_json_response(shared.Connection, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def unlink_async( self, @@ -993,6 +1023,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, ) -> shared.Connection: r"""Unlink connection @@ -1002,6 +1033,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 @@ -1010,12 +1042,14 @@ async def unlink_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UnlinkConnectionRequest) request = cast(operations.UnlinkConnectionRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="PATCH", path="/companies/{companyId}/connections/{connectionId}", base_url=base_url, @@ -1026,6 +1060,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, @@ -1034,6 +1069,7 @@ async def unlink_async( "json", Optional[operations.UnlinkConnectionUpdateConnection], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1051,8 +1087,10 @@ async def unlink_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="unlink-connection", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -1070,27 +1108,22 @@ async def unlink_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Connection) + return unmarshal_json_response(shared.Connection, http_res) if utils.match_response( - http_res, - ["401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/sync-for-payables/src/codat_sync_for_payables/httpclient.py b/sync-for-payables/src/codat_sync_for_payables/httpclient.py index 167cea4ef..89560b566 100644 --- a/sync-for-payables/src/codat_sync_for_payables/httpclient.py +++ b/sync-for-payables/src/codat_sync_for_payables/httpclient.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" # pyright: reportReturnType = false +import asyncio from typing_extensions import Protocol, runtime_checkable import httpx from typing import Any, Optional, Union @@ -82,3 +83,43 @@ def build_request( async def aclose(self) -> None: pass + + +class ClientOwner(Protocol): + client: Union[HttpClient, None] + async_client: Union[AsyncHttpClient, None] + + +def close_clients( + owner: ClientOwner, + sync_client: Union[HttpClient, None], + sync_client_supplied: bool, + async_client: Union[AsyncHttpClient, None], + async_client_supplied: bool, +) -> None: + """ + A finalizer function that is meant to be used with weakref.finalize to close + httpx clients used by an SDK so that underlying resources can be garbage + collected. + """ + + # Unset the client/async_client properties so there are no more references + # to them from the owning SDK instance and they can be reaped. + owner.client = None + owner.async_client = None + if sync_client is not None and not sync_client_supplied: + try: + sync_client.close() + except Exception: + pass + + if async_client is not None and not async_client_supplied: + try: + loop = asyncio.get_running_loop() + asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) + except RuntimeError: + try: + asyncio.run(async_client.aclose()) + except RuntimeError: + # best effort + pass diff --git a/sync-for-payables/src/codat_sync_for_payables/models/__init__.py b/sync-for-payables/src/codat_sync_for_payables/models/__init__.py new file mode 100644 index 000000000..726fc5eb3 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/__init__.py @@ -0,0 +1,3 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# package diff --git a/sync-for-payables/src/codat_sync_for_payables/models/errors/__init__.py b/sync-for-payables/src/codat_sync_for_payables/models/errors/__init__.py index f056b05a6..759000d59 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/errors/__init__.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/errors/__init__.py @@ -1,6 +1,68 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .errormessage import ErrorMessage, ErrorMessageData -from .sdkerror import SDKError +from .codatsyncpayableserror import CodatSyncPayablesError +from typing import TYPE_CHECKING +from importlib import import_module +import builtins +import sys -__all__ = ["ErrorMessage", "ErrorMessageData", "SDKError"] +if TYPE_CHECKING: + from .errormessage import ErrorMessage, ErrorMessageData + from .no_response_error import NoResponseError + from .responsevalidationerror import ResponseValidationError + from .sdkerror import SDKError + +__all__ = [ + "CodatSyncPayablesError", + "ErrorMessage", + "ErrorMessageData", + "NoResponseError", + "ResponseValidationError", + "SDKError", +] + +_dynamic_imports: dict[str, str] = { + "ErrorMessage": ".errormessage", + "ErrorMessageData": ".errormessage", + "NoResponseError": ".no_response_error", + "ResponseValidationError": ".responsevalidationerror", + "SDKError": ".sdkerror", +} + + +def dynamic_import(modname, retries=3): + for attempt in range(retries): + try: + return import_module(modname, __package__) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = dynamic_import(module_name) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = builtins.list(_dynamic_imports.keys()) + return builtins.sorted(lazy_attrs) diff --git a/sync-for-payables/src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py b/sync-for-payables/src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py new file mode 100644 index 000000000..eb8a5afe0 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/errors/codatsyncpayableserror.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass, field + + +@dataclass(unsafe_hash=True) +class CodatSyncPayablesError(Exception): + """The base class for all HTTP error responses.""" + + message: str + status_code: int + body: str + headers: httpx.Headers = field(hash=False) + raw_response: httpx.Response = field(hash=False) + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + object.__setattr__(self, "message", message) + object.__setattr__(self, "status_code", raw_response.status_code) + object.__setattr__( + self, "body", body if body is not None else raw_response.text + ) + object.__setattr__(self, "headers", raw_response.headers) + object.__setattr__(self, "raw_response", raw_response) + + def __str__(self): + return self.message diff --git a/sync-for-payables/src/codat_sync_for_payables/models/errors/errormessage.py b/sync-for-payables/src/codat_sync_for_payables/models/errors/errormessage.py index 02083443a..5e15ab951 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/errors/errormessage.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/errors/errormessage.py @@ -1,11 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables import utils +from codat_sync_for_payables.models.errors import CodatSyncPayablesError from codat_sync_for_payables.models.shared import ( errorvalidation as shared_errorvalidation, ) from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET +from dataclasses import dataclass, field +import httpx import pydantic from typing import Optional from typing_extensions import Annotated @@ -14,39 +16,38 @@ class ErrorMessageData(BaseModel): status_code: Annotated[Optional[int], pydantic.Field(alias="statusCode")] = None r"""The HTTP status code returned by the error.""" - service: Optional[str] = None r"""Codat's service the returned the error.""" - error: Optional[str] = None r"""A brief description of the error.""" - correlation_id: Annotated[Optional[str], pydantic.Field(alias="correlationId")] = ( None ) r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" - validation: OptionalNullable[shared_errorvalidation.ErrorValidation] = UNSET r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" - can_be_retried: Annotated[Optional[str], pydantic.Field(alias="canBeRetried")] = ( None ) r"""`True` if the error occurred transiently and can be retried.""" - detailed_error_code: Annotated[ Optional[int], pydantic.Field(alias="detailedErrorCode") ] = None r"""Machine readable error code used to automate processes based on the code returned.""" -class ErrorMessage(Exception): +@dataclass(unsafe_hash=True) +class ErrorMessage(CodatSyncPayablesError): r"""Your `query` parameter was not correctly formed""" - data: ErrorMessageData - - def __init__(self, data: ErrorMessageData): - self.data = data - - def __str__(self) -> str: - return utils.marshal_json(self.data, ErrorMessageData) + data: ErrorMessageData = field(hash=False) + + def __init__( + self, + data: ErrorMessageData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/sync-for-payables/src/codat_sync_for_payables/models/errors/no_response_error.py b/sync-for-payables/src/codat_sync_for_payables/models/errors/no_response_error.py new file mode 100644 index 000000000..1deab64bc --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/errors/no_response_error.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from dataclasses import dataclass + + +@dataclass(unsafe_hash=True) +class NoResponseError(Exception): + """Error raised when no HTTP response is received from the server.""" + + message: str + + def __init__(self, message: str = "No response received"): + object.__setattr__(self, "message", message) + super().__init__(message) + + def __str__(self): + return self.message diff --git a/sync-for-payables/src/codat_sync_for_payables/models/errors/responsevalidationerror.py b/sync-for-payables/src/codat_sync_for_payables/models/errors/responsevalidationerror.py new file mode 100644 index 000000000..d6e2f035e --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/errors/responsevalidationerror.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass + +from codat_sync_for_payables.models.errors import CodatSyncPayablesError + + +@dataclass(unsafe_hash=True) +class ResponseValidationError(CodatSyncPayablesError): + """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" + + def __init__( + self, + message: str, + raw_response: httpx.Response, + cause: Exception, + body: Optional[str] = None, + ): + message = f"{message}: {cause}" + super().__init__(message, raw_response, body) + + @property + def cause(self): + """Normally the Pydantic ValidationError""" + return self.__cause__ diff --git a/sync-for-payables/src/codat_sync_for_payables/models/errors/sdkerror.py b/sync-for-payables/src/codat_sync_for_payables/models/errors/sdkerror.py index 03216cbf5..a23569a5b 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/errors/sdkerror.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/errors/sdkerror.py @@ -1,22 +1,40 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from dataclasses import dataclass -from typing import Optional import httpx +from typing import Optional +from dataclasses import dataclass + +from codat_sync_for_payables.models.errors import CodatSyncPayablesError + +MAX_MESSAGE_LEN = 10_000 + + +@dataclass(unsafe_hash=True) +class SDKError(CodatSyncPayablesError): + """The fallback error class if no more specific error class is matched.""" + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + body_display = body or raw_response.text or '""' + if message: + message += ": " + message += f"Status {raw_response.status_code}" -@dataclass -class SDKError(Exception): - """Represents an error returned by the API.""" + headers = raw_response.headers + content_type = headers.get("content-type", '""') + if content_type != "application/json": + if " " in content_type: + content_type = f'"{content_type}"' + message += f" Content-Type {content_type}" - message: str - status_code: int = -1 - body: str = "" - raw_response: Optional[httpx.Response] = None + if len(body_display) > MAX_MESSAGE_LEN: + truncated = body_display[:MAX_MESSAGE_LEN] + remaining = len(body_display) - MAX_MESSAGE_LEN + body_display = f"{truncated}...and {remaining} more chars" - def __str__(self): - body = "" - if len(self.body) > 0: - body = f"\n{self.body}" + message += f". Body: {body_display}" + message = message.strip() - return f"{self.message}: Status {self.status_code}{body}" + super().__init__(message, raw_response, body) diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/__init__.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/__init__.py index 3f73d72a0..ce0745041 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/__init__.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/__init__.py @@ -1,60 +1,74 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .create_bank_account import ( - CreateBankAccountRequest, - CreateBankAccountRequestTypedDict, -) -from .create_bill import CreateBillRequest, CreateBillRequestTypedDict -from .create_bill_payment import ( - CreateBillPaymentRequest, - CreateBillPaymentRequestTypedDict, -) -from .create_connection import ( - CreateConnectionRequest, - CreateConnectionRequestBody, - CreateConnectionRequestBodyTypedDict, - CreateConnectionRequestTypedDict, -) -from .create_supplier import CreateSupplierRequest, CreateSupplierRequestTypedDict -from .delete_company import DeleteCompanyRequest, DeleteCompanyRequestTypedDict -from .delete_connection import DeleteConnectionRequest, DeleteConnectionRequestTypedDict -from .download_bill_attachment import ( - DownloadBillAttachmentRequest, - DownloadBillAttachmentRequestTypedDict, -) -from .get_company import GetCompanyRequest, GetCompanyRequestTypedDict -from .get_company_information import ( - GetCompanyInformationRequest, - GetCompanyInformationRequestTypedDict, -) -from .get_connection import GetConnectionRequest, GetConnectionRequestTypedDict -from .get_mapping_options_bills import ( - GetMappingOptionsBillsRequest, - GetMappingOptionsBillsRequestTypedDict, -) -from .get_mapping_options_payments import ( - GetMappingOptionsPaymentsRequest, - GetMappingOptionsPaymentsRequestTypedDict, -) -from .list_bill_attachments import ( - ListBillAttachmentsRequest, - ListBillAttachmentsRequestTypedDict, -) -from .list_bills import ListBillsRequest, ListBillsRequestTypedDict -from .list_companies import ListCompaniesRequest, ListCompaniesRequestTypedDict -from .list_connections import ListConnectionsRequest, ListConnectionsRequestTypedDict -from .list_suppliers import ListSuppliersRequest, ListSuppliersRequestTypedDict -from .unlink_connection import ( - UnlinkConnectionRequest, - UnlinkConnectionRequestTypedDict, - UnlinkConnectionUpdateConnection, - UnlinkConnectionUpdateConnectionTypedDict, -) -from .update_company import UpdateCompanyRequest, UpdateCompanyRequestTypedDict -from .upload_bill_attachment import ( - UploadBillAttachmentRequest, - UploadBillAttachmentRequestTypedDict, -) +from typing import TYPE_CHECKING +from importlib import import_module +import builtins +import sys + +if TYPE_CHECKING: + from .create_bank_account import ( + CreateBankAccountRequest, + CreateBankAccountRequestTypedDict, + ) + from .create_bill import CreateBillRequest, CreateBillRequestTypedDict + from .create_bill_payment import ( + CreateBillPaymentRequest, + CreateBillPaymentRequestTypedDict, + ) + from .create_connection import ( + CreateConnectionRequest, + CreateConnectionRequestBody, + CreateConnectionRequestBodyTypedDict, + CreateConnectionRequestTypedDict, + ) + from .create_supplier import CreateSupplierRequest, CreateSupplierRequestTypedDict + from .delete_company import DeleteCompanyRequest, DeleteCompanyRequestTypedDict + from .delete_connection import ( + DeleteConnectionRequest, + DeleteConnectionRequestTypedDict, + ) + from .download_bill_attachment import ( + DownloadBillAttachmentRequest, + DownloadBillAttachmentRequestTypedDict, + ) + from .get_company import GetCompanyRequest, GetCompanyRequestTypedDict + from .get_company_information import ( + GetCompanyInformationRequest, + GetCompanyInformationRequestTypedDict, + ) + from .get_connection import GetConnectionRequest, GetConnectionRequestTypedDict + from .get_mapping_options_bills import ( + GetMappingOptionsBillsRequest, + GetMappingOptionsBillsRequestTypedDict, + ) + from .get_mapping_options_payments import ( + GetMappingOptionsPaymentsRequest, + GetMappingOptionsPaymentsRequestTypedDict, + ) + from .list_bill_attachments import ( + ListBillAttachmentsRequest, + ListBillAttachmentsRequestTypedDict, + ) + from .list_bills import ListBillsRequest, ListBillsRequestTypedDict + from .list_companies import ListCompaniesRequest, ListCompaniesRequestTypedDict + from .list_connections import ( + ListConnectionsRequest, + ListConnectionsRequestTypedDict, + ) + from .list_suppliers import ListSuppliersRequest, ListSuppliersRequestTypedDict + from .replace_company import ReplaceCompanyRequest, ReplaceCompanyRequestTypedDict + from .unlink_connection import ( + UnlinkConnectionRequest, + UnlinkConnectionRequestTypedDict, + UnlinkConnectionUpdateConnection, + UnlinkConnectionUpdateConnectionTypedDict, + ) + from .update_bill import UpdateBillRequest, UpdateBillRequestTypedDict + from .update_company import UpdateCompanyRequest, UpdateCompanyRequestTypedDict + from .upload_bill_attachment import ( + UploadBillAttachmentRequest, + UploadBillAttachmentRequestTypedDict, + ) __all__ = [ "CreateBankAccountRequest", @@ -95,12 +109,107 @@ "ListConnectionsRequestTypedDict", "ListSuppliersRequest", "ListSuppliersRequestTypedDict", + "ReplaceCompanyRequest", + "ReplaceCompanyRequestTypedDict", "UnlinkConnectionRequest", "UnlinkConnectionRequestTypedDict", "UnlinkConnectionUpdateConnection", "UnlinkConnectionUpdateConnectionTypedDict", + "UpdateBillRequest", + "UpdateBillRequestTypedDict", "UpdateCompanyRequest", "UpdateCompanyRequestTypedDict", "UploadBillAttachmentRequest", "UploadBillAttachmentRequestTypedDict", ] + +_dynamic_imports: dict[str, str] = { + "CreateBankAccountRequest": ".create_bank_account", + "CreateBankAccountRequestTypedDict": ".create_bank_account", + "CreateBillRequest": ".create_bill", + "CreateBillRequestTypedDict": ".create_bill", + "CreateBillPaymentRequest": ".create_bill_payment", + "CreateBillPaymentRequestTypedDict": ".create_bill_payment", + "CreateConnectionRequest": ".create_connection", + "CreateConnectionRequestBody": ".create_connection", + "CreateConnectionRequestBodyTypedDict": ".create_connection", + "CreateConnectionRequestTypedDict": ".create_connection", + "CreateSupplierRequest": ".create_supplier", + "CreateSupplierRequestTypedDict": ".create_supplier", + "DeleteCompanyRequest": ".delete_company", + "DeleteCompanyRequestTypedDict": ".delete_company", + "DeleteConnectionRequest": ".delete_connection", + "DeleteConnectionRequestTypedDict": ".delete_connection", + "DownloadBillAttachmentRequest": ".download_bill_attachment", + "DownloadBillAttachmentRequestTypedDict": ".download_bill_attachment", + "GetCompanyRequest": ".get_company", + "GetCompanyRequestTypedDict": ".get_company", + "GetCompanyInformationRequest": ".get_company_information", + "GetCompanyInformationRequestTypedDict": ".get_company_information", + "GetConnectionRequest": ".get_connection", + "GetConnectionRequestTypedDict": ".get_connection", + "GetMappingOptionsBillsRequest": ".get_mapping_options_bills", + "GetMappingOptionsBillsRequestTypedDict": ".get_mapping_options_bills", + "GetMappingOptionsPaymentsRequest": ".get_mapping_options_payments", + "GetMappingOptionsPaymentsRequestTypedDict": ".get_mapping_options_payments", + "ListBillAttachmentsRequest": ".list_bill_attachments", + "ListBillAttachmentsRequestTypedDict": ".list_bill_attachments", + "ListBillsRequest": ".list_bills", + "ListBillsRequestTypedDict": ".list_bills", + "ListCompaniesRequest": ".list_companies", + "ListCompaniesRequestTypedDict": ".list_companies", + "ListConnectionsRequest": ".list_connections", + "ListConnectionsRequestTypedDict": ".list_connections", + "ListSuppliersRequest": ".list_suppliers", + "ListSuppliersRequestTypedDict": ".list_suppliers", + "ReplaceCompanyRequest": ".replace_company", + "ReplaceCompanyRequestTypedDict": ".replace_company", + "UnlinkConnectionRequest": ".unlink_connection", + "UnlinkConnectionRequestTypedDict": ".unlink_connection", + "UnlinkConnectionUpdateConnection": ".unlink_connection", + "UnlinkConnectionUpdateConnectionTypedDict": ".unlink_connection", + "UpdateBillRequest": ".update_bill", + "UpdateBillRequestTypedDict": ".update_bill", + "UpdateCompanyRequest": ".update_company", + "UpdateCompanyRequestTypedDict": ".update_company", + "UploadBillAttachmentRequest": ".upload_bill_attachment", + "UploadBillAttachmentRequestTypedDict": ".upload_bill_attachment", +} + + +def dynamic_import(modname, retries=3): + for attempt in range(retries): + try: + return import_module(modname, __package__) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = dynamic_import(module_name) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = builtins.list(_dynamic_imports.keys()) + return builtins.sorted(lazy_attrs) diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bank_account.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bank_account.py index de52628c1..46a2d3048 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bank_account.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bank_account.py @@ -4,7 +4,7 @@ from codat_sync_for_payables.models.shared import ( bankaccountprototype as shared_bankaccountprototype, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, HeaderMetadata, @@ -12,6 +12,7 @@ RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -54,3 +55,19 @@ class CreateBankAccountRequest(BaseModel): Optional[shared_bankaccountprototype.BankAccountPrototype], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["Idempotency-Key", "bankAccountPrototype"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill.py index caade28c3..2be21bb53 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill.py @@ -2,7 +2,7 @@ from __future__ import annotations from codat_sync_for_payables.models.shared import billprototype as shared_billprototype -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, HeaderMetadata, @@ -10,6 +10,7 @@ RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -50,3 +51,19 @@ class CreateBillRequest(BaseModel): Optional[shared_billprototype.BillPrototype], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["Idempotency-Key", "billPrototype"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill_payment.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill_payment.py index 92c5011a6..0ff27fc4e 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill_payment.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_bill_payment.py @@ -4,7 +4,7 @@ from codat_sync_for_payables.models.shared import ( billpaymentprototype as shared_billpaymentprototype, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, HeaderMetadata, @@ -12,6 +12,7 @@ RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -63,3 +64,19 @@ class CreateBillPaymentRequest(BaseModel): Optional[shared_billpaymentprototype.BillPaymentPrototype], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["Idempotency-Key", "billPaymentPrototype"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_connection.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_connection.py index 68a50cead..b5a1fc96e 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_connection.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_connection.py @@ -1,13 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -21,6 +22,22 @@ class CreateConnectionRequestBody(BaseModel): platform_key: Annotated[Optional[str], pydantic.Field(alias="platformKey")] = None r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["platformKey"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class CreateConnectionRequestTypedDict(TypedDict): company_id: str @@ -40,3 +57,19 @@ class CreateConnectionRequest(BaseModel): Optional[CreateConnectionRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["RequestBody"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_supplier.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_supplier.py index c5c89adeb..bf1ea7f08 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/create_supplier.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/create_supplier.py @@ -4,7 +4,7 @@ from codat_sync_for_payables.models.shared import ( supplierprototype as shared_supplierprototype, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, HeaderMetadata, @@ -12,6 +12,7 @@ RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -52,3 +53,19 @@ class CreateSupplierRequest(BaseModel): Optional[shared_supplierprototype.SupplierPrototype], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["Idempotency-Key", "supplierPrototype"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py index 010685a38..98de06231 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_bills.py @@ -1,13 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, QueryParamMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -51,3 +52,19 @@ class GetMappingOptionsBillsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Codat query string allows you to filter by `status` (`status=Active||status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat's query string.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["continuationToken", "statusQuery"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py index 9a795ec9f..ebd62e463 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/get_mapping_options_payments.py @@ -1,13 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, QueryParamMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -51,3 +52,19 @@ class GetMappingOptionsPaymentsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Codat query string allows you to filter by `status` (`status=Active||status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat's query string.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["continuationToken", "statusQuery"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_bills.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_bills.py index f0ce17326..08602e4b8 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_bills.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_bills.py @@ -1,13 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, QueryParamMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -50,3 +51,19 @@ class ListBillsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat's query string [here](https://docs.codat.io/using-the-api/querying). Platfrom specfic statuses: Xero supports Open | PartiallyPaid | Paid | Void | Draft. Qbo supports Open | PartiallyPaid | Paid. FreeAgent supports Open | PartiallyPaid | Paid.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["continuationToken", "query"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_companies.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_companies.py index e6a8df3bc..443b275ad 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_companies.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_companies.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import FieldMetadata, QueryParamMetadata import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -17,6 +18,8 @@ class ListCompaniesRequestTypedDict(TypedDict): r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" order_by: NotRequired[str] r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + 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 +48,25 @@ class ListCompaniesRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + 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).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page", "pageSize", "query", "orderBy", "tags"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_connections.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_connections.py index e422e36fd..7b0f6c504 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_connections.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_connections.py @@ -1,13 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, QueryParamMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -58,3 +59,19 @@ class ListConnectionsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page", "pageSize", "query", "orderBy"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_suppliers.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_suppliers.py index e37ad2e71..c2d6d5397 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/list_suppliers.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/list_suppliers.py @@ -1,13 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, QueryParamMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -50,3 +51,19 @@ class ListSuppliersRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Codat query string allows you to filter by `sourceModifiedDate` or if a supplier is `Active` or `Archived` in the accounting software. Learn more about Codat's query string [here](https://docs.codat.io/using-the-api/querying).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["continuationToken", "query"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/replace_company.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/replace_company.py new file mode 100644 index 000000000..b9bf9a37a --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/replace_company.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables.models.shared import ( + companyrequestbody as shared_companyrequestbody, +) +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from codat_sync_for_payables.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ReplaceCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + company_request_body: NotRequired[ + shared_companyrequestbody.CompanyRequestBodyTypedDict + ] + + +class ReplaceCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + company_request_body: Annotated[ + Optional[shared_companyrequestbody.CompanyRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["CompanyRequestBody"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/unlink_connection.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/unlink_connection.py index 08747aaae..d4e3261e7 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/unlink_connection.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/unlink_connection.py @@ -4,13 +4,14 @@ from codat_sync_for_payables.models.shared import ( dataconnectionstatus as shared_dataconnectionstatus, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -24,6 +25,22 @@ class UnlinkConnectionUpdateConnection(BaseModel): status: Optional[shared_dataconnectionstatus.DataConnectionStatus] = None r"""The current authorization status of the data connection.""" + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["status"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class UnlinkConnectionRequestTypedDict(TypedDict): company_id: str @@ -52,3 +69,19 @@ class UnlinkConnectionRequest(BaseModel): Optional[UnlinkConnectionUpdateConnection], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["RequestBody"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/update_bill.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/update_bill.py new file mode 100644 index 000000000..eada75683 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/update_bill.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables.models.shared import billprototype as shared_billprototype +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from codat_sync_for_payables.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateBillRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bill_id: str + r"""Unique identifier for a bill.""" + idempotency_key: NotRequired[str] + r"""A unique identifier to ensure idempotent behaviour for subsequent requests.""" + bill_prototype: NotRequired[shared_billprototype.BillPrototypeTypedDict] + + +class UpdateBillRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + idempotency_key: Annotated[ + Optional[str], + pydantic.Field(alias="Idempotency-Key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""A unique identifier to ensure idempotent behaviour for subsequent requests.""" + + bill_prototype: Annotated[ + Optional[shared_billprototype.BillPrototype], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["Idempotency-Key", "billPrototype"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/update_company.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/update_company.py index a73b48dfc..707e4d029 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/update_company.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/update_company.py @@ -2,15 +2,16 @@ from __future__ import annotations from codat_sync_for_payables.models.shared import ( - companyrequestbody as shared_companyrequestbody, + companyupdaterequest as shared_companyupdaterequest, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -18,8 +19,8 @@ class UpdateCompanyRequestTypedDict(TypedDict): company_id: str r"""Unique identifier for a company.""" - company_request_body: NotRequired[ - shared_companyrequestbody.CompanyRequestBodyTypedDict + company_update_request: NotRequired[ + shared_companyupdaterequest.CompanyUpdateRequestTypedDict ] @@ -31,7 +32,23 @@ class UpdateCompanyRequest(BaseModel): ] r"""Unique identifier for a company.""" - company_request_body: Annotated[ - Optional[shared_companyrequestbody.CompanyRequestBody], + company_update_request: Annotated[ + Optional[shared_companyupdaterequest.CompanyUpdateRequest], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["CompanyUpdateRequest"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/operations/upload_bill_attachment.py b/sync-for-payables/src/codat_sync_for_payables/models/operations/upload_bill_attachment.py index 5c22b7d01..8fdc88788 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/operations/upload_bill_attachment.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/operations/upload_bill_attachment.py @@ -4,13 +4,14 @@ from codat_sync_for_payables.models.shared import ( attachmentupload as shared_attachmentupload, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import ( FieldMetadata, PathParamMetadata, RequestMetadata, ) import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -51,3 +52,19 @@ class UploadBillAttachmentRequest(BaseModel): Optional[shared_attachmentupload.AttachmentUpload], FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["AttachmentUpload"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/__init__.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/__init__.py index 22873fa7c..096b152f8 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/__init__.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/__init__.py @@ -1,90 +1,100 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .accountmappingoption import AccountMappingOption, AccountMappingOptionTypedDict -from .accountstatus import AccountStatus -from .address import Address, AddressTypedDict -from .addresstype import AddressType -from .attachment import Attachment, AttachmentTypedDict -from .attachmentupload import AttachmentUpload, AttachmentUploadTypedDict -from .bankaccount import BankAccount, BankAccountTypedDict -from .bankaccountmappingoption import ( - BankAccountMappingOption, - BankAccountMappingOptionTypedDict, -) -from .bankaccountprototype import BankAccountPrototype, BankAccountPrototypeTypedDict -from .bankaccountstatus import BankAccountStatus -from .bankaccounttype import BankAccountType -from .bill import Bill, BillTypedDict -from .billaccountref import BillAccountRef, BillAccountRefTypedDict -from .billlineitem import BillLineItem, BillLineItemTypedDict -from .billmappingoptions import BillMappingOptions, BillMappingOptionsTypedDict -from .billpayment import BillPayment, BillPaymentTypedDict -from .billpaymentaccountref import BillPaymentAccountRef, BillPaymentAccountRefTypedDict -from .billpaymentprototype import BillPaymentPrototype, BillPaymentPrototypeTypedDict -from .billprototype import BillPrototype, BillPrototypeTypedDict -from .bills import Bills, BillsTypedDict -from .billstatus import BillStatus -from .billtaxrateref import BillTaxRateRef, BillTaxRateRefTypedDict -from .clientratelimitreachedwebhook import ( - ClientRateLimitReachedWebhook, - ClientRateLimitReachedWebhookTypedDict, -) -from .clientratelimitreachedwebhookdata import ( - ClientRateLimitReachedWebhookData, - ClientRateLimitReachedWebhookDataTypedDict, -) -from .clientratelimitresetwebhook import ( - ClientRateLimitResetWebhook, - ClientRateLimitResetWebhookTypedDict, -) -from .clientratelimitresetwebhookdata import ( - ClientRateLimitResetWebhookData, - ClientRateLimitResetWebhookDataTypedDict, -) -from .clientratelimitwebhook import ( - ClientRateLimitWebhook, - ClientRateLimitWebhookTypedDict, -) -from .clientratelimitwebhookpayload import ( - ClientRateLimitWebhookPayload, - ClientRateLimitWebhookPayloadTypedDict, -) -from .codatfile import CodatFile, CodatFileTypedDict -from .companies import Companies, CompaniesTypedDict -from .company import Company, CompanyTypedDict -from .companyinformation import CompanyInformation, CompanyInformationTypedDict -from .companyreference import ( - CompanyReference, - CompanyReferenceLinks, - CompanyReferenceLinksTypedDict, - CompanyReferenceTypedDict, -) -from .companyrequestbody import CompanyRequestBody, CompanyRequestBodyTypedDict -from .connection import Connection, ConnectionTypedDict, SourceType -from .connections import Connections, ConnectionsTypedDict -from .dataconnectionerror import ( - DataConnectionError, - DataConnectionErrorTypedDict, - ErrorStatus, -) -from .dataconnectionstatus import DataConnectionStatus -from .errorvalidation import ErrorValidation, ErrorValidationTypedDict -from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict -from .halref import HalRef, HalRefTypedDict -from .links import Links, LinksTypedDict -from .pagination import Pagination, PaginationTypedDict -from .paymentmappingoptions import PaymentMappingOptions, PaymentMappingOptionsTypedDict -from .security import Security, SecurityTypedDict -from .supplier import Supplier, SupplierTypedDict -from .supplierprototype import SupplierPrototype, SupplierPrototypeTypedDict -from .supplierref import SupplierRef, SupplierRefTypedDict -from .suppliers import Suppliers, SuppliersTypedDict -from .supplierstatus import SupplierStatus -from .taxratemappingoption import ( - TaxRateMappingOption, - TaxRateMappingOptionTypedDict, - TaxRateStatus, -) +from typing import TYPE_CHECKING +from importlib import import_module +import builtins +import sys + +if TYPE_CHECKING: + from .accountmappingoption import ( + AccountMappingOption, + AccountMappingOptionTypedDict, + ) + from .accountstatus import AccountStatus + from .address import Address, AddressTypedDict + from .addresstype import AddressType + from .attachment import Attachment, AttachmentTypedDict + from .attachmentupload import AttachmentUpload, AttachmentUploadTypedDict + from .bankaccount import BankAccount, BankAccountTypedDict + from .bankaccountmappingoption import ( + BankAccountMappingOption, + BankAccountMappingOptionTypedDict, + ) + from .bankaccountprototype import ( + BankAccountPrototype, + BankAccountPrototypeTypedDict, + ) + from .bankaccountstatus import BankAccountStatus + from .bankaccounttype import BankAccountType + from .bill import Bill, BillTypedDict + from .billaccountref import BillAccountRef, BillAccountRefTypedDict + from .billlineitem import BillLineItem, BillLineItemTypedDict + from .billmappingoptions import BillMappingOptions, BillMappingOptionsTypedDict + from .billpayment import BillPayment, BillPaymentTypedDict + from .billpaymentaccountref import ( + BillPaymentAccountRef, + BillPaymentAccountRefTypedDict, + ) + from .billpaymentprototype import ( + BillPaymentPrototype, + BillPaymentPrototypeTypedDict, + ) + from .billprototype import BillPrototype, BillPrototypeTypedDict + from .bills import Bills, BillsTypedDict + from .billstatus import BillStatus + from .billtaxrateref import BillTaxRateRef, BillTaxRateRefTypedDict + from .clientratelimitwebhook import ( + ClientRateLimitWebhook, + ClientRateLimitWebhookTypedDict, + ) + from .clientratelimitwebhookpayload import ( + ClientRateLimitWebhookPayload, + ClientRateLimitWebhookPayloadTypedDict, + ) + from .codatfile import CodatFile, CodatFileTypedDict + from .companies import Companies, CompaniesTypedDict + from .company import Company, CompanyTypedDict + from .companyinformation import CompanyInformation, CompanyInformationTypedDict + from .companyreference import ( + CompanyReference, + CompanyReferenceLinks, + CompanyReferenceLinksTypedDict, + CompanyReferenceTypedDict, + ) + from .companyrequestbody import CompanyRequestBody, CompanyRequestBodyTypedDict + from .companyupdaterequest import ( + CompanyUpdateRequest, + CompanyUpdateRequestTypedDict, + ) + from .connection import Connection, ConnectionTypedDict, SourceType + from .connections import Connections, ConnectionsTypedDict + from .dataconnectionerror import ( + DataConnectionError, + DataConnectionErrorTypedDict, + ErrorStatus, + ) + from .dataconnectionstatus import DataConnectionStatus + from .errorvalidation import ErrorValidation, ErrorValidationTypedDict + from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict + from .halref import HalRef, HalRefTypedDict + from .links import Links, LinksTypedDict + from .pagination import Pagination, PaginationTypedDict + from .paymentmappingoptions import ( + PaymentMappingOptions, + PaymentMappingOptionsTypedDict, + ) + from .security import Security, SecurityTypedDict + from .supplier import Supplier, SupplierTypedDict + from .supplierprototype import SupplierPrototype, SupplierPrototypeTypedDict + from .supplierref import SupplierRef, SupplierRefTypedDict + from .suppliers import Suppliers, SuppliersTypedDict + from .supplierstatus import SupplierStatus + from .taxratemappingoption import ( + TaxRateMappingOption, + TaxRateMappingOptionTypedDict, + TaxRateStatus, + ) + from .trackingref import DataType, TrackingRef, TrackingRefTypedDict __all__ = [ "AccountMappingOption", @@ -126,14 +136,6 @@ "BillTypedDict", "Bills", "BillsTypedDict", - "ClientRateLimitReachedWebhook", - "ClientRateLimitReachedWebhookData", - "ClientRateLimitReachedWebhookDataTypedDict", - "ClientRateLimitReachedWebhookTypedDict", - "ClientRateLimitResetWebhook", - "ClientRateLimitResetWebhookData", - "ClientRateLimitResetWebhookDataTypedDict", - "ClientRateLimitResetWebhookTypedDict", "ClientRateLimitWebhook", "ClientRateLimitWebhookPayload", "ClientRateLimitWebhookPayloadTypedDict", @@ -152,6 +154,8 @@ "CompanyRequestBody", "CompanyRequestBodyTypedDict", "CompanyTypedDict", + "CompanyUpdateRequest", + "CompanyUpdateRequestTypedDict", "Connection", "ConnectionTypedDict", "Connections", @@ -159,6 +163,7 @@ "DataConnectionError", "DataConnectionErrorTypedDict", "DataConnectionStatus", + "DataType", "ErrorStatus", "ErrorValidation", "ErrorValidationItem", @@ -187,4 +192,144 @@ "TaxRateMappingOption", "TaxRateMappingOptionTypedDict", "TaxRateStatus", + "TrackingRef", + "TrackingRefTypedDict", ] + +_dynamic_imports: dict[str, str] = { + "AccountMappingOption": ".accountmappingoption", + "AccountMappingOptionTypedDict": ".accountmappingoption", + "AccountStatus": ".accountstatus", + "Address": ".address", + "AddressTypedDict": ".address", + "AddressType": ".addresstype", + "Attachment": ".attachment", + "AttachmentTypedDict": ".attachment", + "AttachmentUpload": ".attachmentupload", + "AttachmentUploadTypedDict": ".attachmentupload", + "BankAccount": ".bankaccount", + "BankAccountTypedDict": ".bankaccount", + "BankAccountMappingOption": ".bankaccountmappingoption", + "BankAccountMappingOptionTypedDict": ".bankaccountmappingoption", + "BankAccountPrototype": ".bankaccountprototype", + "BankAccountPrototypeTypedDict": ".bankaccountprototype", + "BankAccountStatus": ".bankaccountstatus", + "BankAccountType": ".bankaccounttype", + "Bill": ".bill", + "BillTypedDict": ".bill", + "BillAccountRef": ".billaccountref", + "BillAccountRefTypedDict": ".billaccountref", + "BillLineItem": ".billlineitem", + "BillLineItemTypedDict": ".billlineitem", + "BillMappingOptions": ".billmappingoptions", + "BillMappingOptionsTypedDict": ".billmappingoptions", + "BillPayment": ".billpayment", + "BillPaymentTypedDict": ".billpayment", + "BillPaymentAccountRef": ".billpaymentaccountref", + "BillPaymentAccountRefTypedDict": ".billpaymentaccountref", + "BillPaymentPrototype": ".billpaymentprototype", + "BillPaymentPrototypeTypedDict": ".billpaymentprototype", + "BillPrototype": ".billprototype", + "BillPrototypeTypedDict": ".billprototype", + "Bills": ".bills", + "BillsTypedDict": ".bills", + "BillStatus": ".billstatus", + "BillTaxRateRef": ".billtaxrateref", + "BillTaxRateRefTypedDict": ".billtaxrateref", + "ClientRateLimitWebhook": ".clientratelimitwebhook", + "ClientRateLimitWebhookTypedDict": ".clientratelimitwebhook", + "ClientRateLimitWebhookPayload": ".clientratelimitwebhookpayload", + "ClientRateLimitWebhookPayloadTypedDict": ".clientratelimitwebhookpayload", + "CodatFile": ".codatfile", + "CodatFileTypedDict": ".codatfile", + "Companies": ".companies", + "CompaniesTypedDict": ".companies", + "Company": ".company", + "CompanyTypedDict": ".company", + "CompanyInformation": ".companyinformation", + "CompanyInformationTypedDict": ".companyinformation", + "CompanyReference": ".companyreference", + "CompanyReferenceLinks": ".companyreference", + "CompanyReferenceLinksTypedDict": ".companyreference", + "CompanyReferenceTypedDict": ".companyreference", + "CompanyRequestBody": ".companyrequestbody", + "CompanyRequestBodyTypedDict": ".companyrequestbody", + "CompanyUpdateRequest": ".companyupdaterequest", + "CompanyUpdateRequestTypedDict": ".companyupdaterequest", + "Connection": ".connection", + "ConnectionTypedDict": ".connection", + "SourceType": ".connection", + "Connections": ".connections", + "ConnectionsTypedDict": ".connections", + "DataConnectionError": ".dataconnectionerror", + "DataConnectionErrorTypedDict": ".dataconnectionerror", + "ErrorStatus": ".dataconnectionerror", + "DataConnectionStatus": ".dataconnectionstatus", + "ErrorValidation": ".errorvalidation", + "ErrorValidationTypedDict": ".errorvalidation", + "ErrorValidationItem": ".errorvalidationitem", + "ErrorValidationItemTypedDict": ".errorvalidationitem", + "HalRef": ".halref", + "HalRefTypedDict": ".halref", + "Links": ".links", + "LinksTypedDict": ".links", + "Pagination": ".pagination", + "PaginationTypedDict": ".pagination", + "PaymentMappingOptions": ".paymentmappingoptions", + "PaymentMappingOptionsTypedDict": ".paymentmappingoptions", + "Security": ".security", + "SecurityTypedDict": ".security", + "Supplier": ".supplier", + "SupplierTypedDict": ".supplier", + "SupplierPrototype": ".supplierprototype", + "SupplierPrototypeTypedDict": ".supplierprototype", + "SupplierRef": ".supplierref", + "SupplierRefTypedDict": ".supplierref", + "Suppliers": ".suppliers", + "SuppliersTypedDict": ".suppliers", + "SupplierStatus": ".supplierstatus", + "TaxRateMappingOption": ".taxratemappingoption", + "TaxRateMappingOptionTypedDict": ".taxratemappingoption", + "TaxRateStatus": ".taxratemappingoption", + "DataType": ".trackingref", + "TrackingRef": ".trackingref", + "TrackingRefTypedDict": ".trackingref", +} + + +def dynamic_import(modname, retries=3): + for attempt in range(retries): + try: + return import_module(modname, __package__) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = dynamic_import(module_name) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = builtins.list(_dynamic_imports.keys()) + return builtins.sorted(lazy_attrs) diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/accountmappingoption.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/accountmappingoption.py index a99171912..9452401d9 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/accountmappingoption.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/accountmappingoption.py @@ -72,38 +72,35 @@ class AccountMappingOption(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "nominalCode", - "name", - "type", - "currency", - "status", - "sourceModifiedDate", - ] - nullable_fields = ["nominalCode", "name", "type"] - null_default_fields = [] - + optional_fields = set( + [ + "id", + "nominalCode", + "name", + "type", + "currency", + "status", + "sourceModifiedDate", + ] + ) + nullable_fields = set(["nominalCode", "name", "type"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/address.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/address.py index f9b642ac9..bd9a6331f 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/address.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/address.py @@ -58,38 +58,29 @@ class Address(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "type", - "line1", - "line2", - "city", - "region", - "country", - "postalCode", - ] - nullable_fields = ["line1", "line2", "city", "region", "country", "postalCode"] - null_default_fields = [] - + optional_fields = set( + ["type", "line1", "line2", "city", "region", "country", "postalCode"] + ) + nullable_fields = set( + ["line1", "line2", "city", "region", "country", "postalCode"] + ) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/attachment.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/attachment.py index e863fc54b..5b3431359 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/attachment.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/attachment.py @@ -141,38 +141,35 @@ class Attachment(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "name", - "contentType", - "dateCreated", - "fileSize", - "includeWhenSent", - "sourceModifiedDate", - ] - nullable_fields = ["name", "contentType", "fileSize"] - null_default_fields = [] - + optional_fields = set( + [ + "id", + "name", + "contentType", + "dateCreated", + "fileSize", + "includeWhenSent", + "sourceModifiedDate", + ] + ) + nullable_fields = set(["name", "contentType", "fileSize"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/attachmentupload.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/attachmentupload.py index 94768bf1f..b53e491ed 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/attachmentupload.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/attachmentupload.py @@ -4,7 +4,6 @@ from .codatfile import CodatFile, CodatFileTypedDict from codat_sync_for_payables.types import BaseModel from codat_sync_for_payables.utils import FieldMetadata, MultipartFormMetadata -import pydantic from typing_extensions import Annotated, TypedDict @@ -15,8 +14,6 @@ class AttachmentUploadTypedDict(TypedDict): class AttachmentUpload(BaseModel): file: Annotated[ - CodatFile, - pydantic.Field(alias=""), - FieldMetadata(multipart=MultipartFormMetadata(file=True)), + CodatFile, FieldMetadata(multipart=MultipartFormMetadata(file=True)) ] r"""The file to be uploaded as an attachment.""" diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccount.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccount.py index b91ff6041..fc5c124a0 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccount.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccount.py @@ -111,40 +111,37 @@ class BankAccount(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "nominalCode", - "name", - "accountType", - "accountNumber", - "sortCode", - "currency", - "status", - "sourceModifiedDate", - ] - nullable_fields = ["nominalCode", "name", "accountNumber", "sortCode"] - null_default_fields = [] - + optional_fields = set( + [ + "id", + "nominalCode", + "name", + "accountType", + "accountNumber", + "sortCode", + "currency", + "status", + "sourceModifiedDate", + ] + ) + nullable_fields = set(["nominalCode", "name", "accountNumber", "sortCode"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py index e1bd77e20..c1a0b7412 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountmappingoption.py @@ -97,46 +97,39 @@ class BankAccountMappingOption(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "name", - "accountNumber", - "nominalCode", - "sortCode", - "currency", - "status", - "accountType", - "sourceModifiedDate", - ] - nullable_fields = [ - "name", - "accountNumber", - "nominalCode", - "sortCode", - "currency", - ] - null_default_fields = [] - + optional_fields = set( + [ + "id", + "name", + "accountNumber", + "nominalCode", + "sortCode", + "currency", + "status", + "accountType", + "sourceModifiedDate", + ] + ) + nullable_fields = set( + ["name", "accountNumber", "nominalCode", "sortCode", "currency"] + ) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountprototype.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountprototype.py index 0342fc117..b24e6b7f6 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountprototype.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/bankaccountprototype.py @@ -90,30 +90,25 @@ class BankAccountPrototype(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["nominalCode", "sortCode"] - nullable_fields = ["name", "accountNumber", "nominalCode", "sortCode"] - null_default_fields = [] - + optional_fields = set(["nominalCode", "sortCode"]) + nullable_fields = set(["nominalCode", "name", "accountNumber", "sortCode"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/bill.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/bill.py index 2e6bd6c06..0bfde2a06 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/bill.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/bill.py @@ -188,38 +188,35 @@ class Bill(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "reference", - "currencyRate", - "lineItems", - "totalAmount", - "amountDue", - "sourceModifiedDate", - ] - nullable_fields = ["reference", "currencyRate", "lineItems", "amountDue"] - null_default_fields = [] - + optional_fields = set( + [ + "id", + "reference", + "currencyRate", + "lineItems", + "totalAmount", + "amountDue", + "sourceModifiedDate", + ] + ) + nullable_fields = set(["reference", "currencyRate", "lineItems", "amountDue"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billaccountref.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billaccountref.py index 211829d2e..4b7ee1f2c 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billaccountref.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billaccountref.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import Optional from typing_extensions import NotRequired, TypedDict @@ -18,3 +19,19 @@ class BillAccountRef(BaseModel): id: Optional[str] = None r"""'id' from the Accounts data type.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billlineitem.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billlineitem.py index c05b3714c..3c497ec63 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billlineitem.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billlineitem.py @@ -3,6 +3,7 @@ from __future__ import annotations from .billaccountref import BillAccountRef, BillAccountRefTypedDict from .billtaxrateref import BillTaxRateRef, BillTaxRateRefTypedDict +from .trackingref import TrackingRef, TrackingRefTypedDict from codat_sync_for_payables.types import ( BaseModel, Nullable, @@ -16,51 +17,49 @@ from pydantic import model_serializer from pydantic.functional_serializers import PlainSerializer from pydantic.functional_validators import BeforeValidator -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict class BillLineItemTypedDict(TypedDict): - unit_amount: Decimal - r"""Unit price of the goods or service.""" - quantity: Decimal - r"""Number of units of goods or services received.""" - account_ref: BillAccountRefTypedDict - r"""Reference to the account to which the line item is linked.""" description: NotRequired[Nullable[str]] r"""Friendly name of the goods or services received.""" + unit_amount: NotRequired[Decimal] + r"""Unit price of the goods or service.""" + quantity: NotRequired[Decimal] + r"""Number of units of goods or services received.""" tax_amount: NotRequired[Decimal] r"""Amount of tax applied to the line item.""" + account_ref: NotRequired[BillAccountRefTypedDict] + r"""Reference to the account to which the line item is linked.""" total_amount: NotRequired[Nullable[Decimal]] r"""Total amount of the line, including tax.""" tax_rate_ref: NotRequired[BillTaxRateRefTypedDict] r"""Reference to the tax rate to which the line item is linked.""" + tracking_refs: NotRequired[Nullable[List[TrackingRefTypedDict]]] class BillLineItem(BaseModel): + description: OptionalNullable[str] = UNSET + r"""Friendly name of the goods or services received.""" + unit_amount: Annotated[ Annotated[ - Decimal, + Optional[Decimal], BeforeValidator(validate_decimal), PlainSerializer(serialize_decimal(False)), ], pydantic.Field(alias="unitAmount"), - ] + ] = None r"""Unit price of the goods or service.""" quantity: Annotated[ - Decimal, + Optional[Decimal], BeforeValidator(validate_decimal), PlainSerializer(serialize_decimal(False)), - ] + ] = None r"""Number of units of goods or services received.""" - account_ref: Annotated[BillAccountRef, pydantic.Field(alias="accountRef")] - r"""Reference to the account to which the line item is linked.""" - - description: OptionalNullable[str] = UNSET - r"""Friendly name of the goods or services received.""" - tax_amount: Annotated[ Annotated[ Optional[Decimal], @@ -71,6 +70,11 @@ class BillLineItem(BaseModel): ] = None r"""Amount of tax applied to the line item.""" + account_ref: Annotated[ + Optional[BillAccountRef], pydantic.Field(alias="accountRef") + ] = None + r"""Reference to the account to which the line item is linked.""" + total_amount: Annotated[ Annotated[ OptionalNullable[Decimal], @@ -86,32 +90,42 @@ class BillLineItem(BaseModel): ] = None r"""Reference to the tax rate to which the line item is linked.""" + tracking_refs: Annotated[ + OptionalNullable[List[TrackingRef]], pydantic.Field(alias="trackingRefs") + ] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["description", "taxAmount", "totalAmount", "taxRateRef"] - nullable_fields = ["description", "totalAmount"] - null_default_fields = [] - + optional_fields = set( + [ + "description", + "unitAmount", + "quantity", + "taxAmount", + "accountRef", + "totalAmount", + "taxRateRef", + "trackingRefs", + ] + ) + nullable_fields = set(["description", "totalAmount", "trackingRefs"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billmappingoptions.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billmappingoptions.py index 07f053598..3a4201bde 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billmappingoptions.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billmappingoptions.py @@ -4,8 +4,9 @@ from .accountmappingoption import AccountMappingOption, AccountMappingOptionTypedDict from .pagination import Pagination, PaginationTypedDict from .taxratemappingoption import TaxRateMappingOption, TaxRateMappingOptionTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, Nullable, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -13,7 +14,7 @@ class BillMappingOptionsTypedDict(TypedDict): r"""The bill mapping options for a company's accounting software.""" - accounts: NotRequired[List[AccountMappingOptionTypedDict]] + accounts: NotRequired[List[Nullable[AccountMappingOptionTypedDict]]] tax_rates: NotRequired[List[TaxRateMappingOptionTypedDict]] pagination: NotRequired[PaginationTypedDict] @@ -21,10 +22,26 @@ class BillMappingOptionsTypedDict(TypedDict): class BillMappingOptions(BaseModel): r"""The bill mapping options for a company's accounting software.""" - accounts: Optional[List[AccountMappingOption]] = None + accounts: Optional[List[Nullable[AccountMappingOption]]] = None tax_rates: Annotated[ Optional[List[TaxRateMappingOption]], pydantic.Field(alias="taxRates") ] = None pagination: Optional[Pagination] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["accounts", "taxRates", "pagination"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billpayment.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billpayment.py index 03150a819..6e49d8d46 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billpayment.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billpayment.py @@ -130,37 +130,27 @@ class BillPayment(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "amount", - "date", - "reference", - "accountRef", - "currencyRate", - ] - nullable_fields = ["reference", "currencyRate"] - null_default_fields = [] - + optional_fields = set( + ["id", "amount", "date", "reference", "accountRef", "currencyRate"] + ) + nullable_fields = set(["reference", "currencyRate"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billpaymentprototype.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billpaymentprototype.py index 8f8f30151..249d545e6 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billpaymentprototype.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billpaymentprototype.py @@ -122,30 +122,25 @@ class BillPaymentPrototype(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["reference", "currencyRate"] - nullable_fields = ["reference", "currencyRate"] - null_default_fields = [] - + optional_fields = set(["reference", "currencyRate"]) + nullable_fields = set(["reference", "currencyRate"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billprototype.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billprototype.py index 9ca17bfde..06e4da1c2 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billprototype.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billprototype.py @@ -150,30 +150,25 @@ class BillPrototype(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["reference", "currencyRate", "lineItems"] - nullable_fields = ["reference", "currencyRate", "lineItems"] - null_default_fields = [] - + optional_fields = set(["reference", "currencyRate", "lineItems"]) + nullable_fields = set(["reference", "currencyRate", "lineItems"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/bills.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/bills.py index 893a3d1f5..f70b0ae7e 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/bills.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/bills.py @@ -3,7 +3,8 @@ from __future__ import annotations from .bill import Bill, BillTypedDict from .pagination import Pagination, PaginationTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import List, Optional from typing_extensions import NotRequired, TypedDict @@ -17,3 +18,19 @@ class Bills(BaseModel): results: Optional[List[Bill]] = None pagination: Optional[Pagination] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "pagination"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/billtaxrateref.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/billtaxrateref.py index 656a5aa2d..d78556c2b 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/billtaxrateref.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/billtaxrateref.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import Optional from typing_extensions import NotRequired, TypedDict @@ -18,3 +19,19 @@ class BillTaxRateRef(BaseModel): id: Optional[str] = None r"""Unique identifier for the tax rate in the accounting software.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhook.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhook.py deleted file mode 100644 index ccf9415e1..000000000 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhook.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .clientratelimitreachedwebhookdata import ( - ClientRateLimitReachedWebhookData, - ClientRateLimitReachedWebhookDataTypedDict, -) -from codat_sync_for_payables.types import BaseModel -import pydantic -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ClientRateLimitReachedWebhookTypedDict(TypedDict): - r"""Webhook request body for a client that has reached their rate limit.""" - - client_id: NotRequired[str] - r"""Unique identifier for your client in Codat.""" - client_name: NotRequired[str] - r"""Name of your client in Codat.""" - rule_id: NotRequired[str] - r"""Unique identifier for the rule.""" - rule_type: NotRequired[str] - r"""The type of rule.""" - alert_id: NotRequired[str] - r"""Unique identifier of the webhook event.""" - message: NotRequired[str] - r"""A human-readable message about the webhook.""" - data: NotRequired[ClientRateLimitReachedWebhookDataTypedDict] - - -class ClientRateLimitReachedWebhook(BaseModel): - r"""Webhook request body for a client that has reached their rate limit.""" - - client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None - r"""Unique identifier for your client in Codat.""" - - client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None - r"""Name of your client in Codat.""" - - rule_id: Annotated[ - Optional[str], - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", - alias="RuleId", - ), - ] = None - r"""Unique identifier for the rule.""" - - rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None - r"""The type of rule.""" - - alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None - r"""Unique identifier of the webhook event.""" - - message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None - r"""A human-readable message about the webhook.""" - - data: Annotated[ - Optional[ClientRateLimitReachedWebhookData], pydantic.Field(alias="Data") - ] = None diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhookdata.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhookdata.py deleted file mode 100644 index 3ba443c88..000000000 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitreachedwebhookdata.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from codat_sync_for_payables.types import BaseModel -import pydantic -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ClientRateLimitReachedWebhookDataTypedDict(TypedDict): - daily_quota: NotRequired[int] - r"""The number of available requests per day.""" - expires_utc: 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. - """ - - -class ClientRateLimitReachedWebhookData(BaseModel): - daily_quota: Annotated[Optional[int], pydantic.Field(alias="DailyQuota")] = None - r"""The number of available requests per day.""" - - expires_utc: Annotated[Optional[str], pydantic.Field(alias="ExpiresUtc")] = 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. - """ diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhook.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhook.py deleted file mode 100644 index 8c8ba48d1..000000000 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhook.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .clientratelimitresetwebhookdata import ( - ClientRateLimitResetWebhookData, - ClientRateLimitResetWebhookDataTypedDict, -) -from codat_sync_for_payables.types import BaseModel -import pydantic -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ClientRateLimitResetWebhookTypedDict(TypedDict): - r"""Webhook request body for a client that has had their rate limit reset.""" - - client_id: NotRequired[str] - r"""Unique identifier for your client in Codat.""" - client_name: NotRequired[str] - r"""Name of your client in Codat.""" - rule_id: NotRequired[str] - r"""Unique identifier for the rule.""" - rule_type: NotRequired[str] - r"""The type of rule.""" - alert_id: NotRequired[str] - r"""Unique identifier of the webhook event.""" - message: NotRequired[str] - r"""A human-readable message about the webhook.""" - data: NotRequired[ClientRateLimitResetWebhookDataTypedDict] - - -class ClientRateLimitResetWebhook(BaseModel): - r"""Webhook request body for a client that has had their rate limit reset.""" - - client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None - r"""Unique identifier for your client in Codat.""" - - client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None - r"""Name of your client in Codat.""" - - rule_id: Annotated[ - Optional[str], - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", - alias="RuleId", - ), - ] = None - r"""Unique identifier for the rule.""" - - rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None - r"""The type of rule.""" - - alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None - r"""Unique identifier of the webhook event.""" - - message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None - r"""A human-readable message about the webhook.""" - - data: Annotated[ - Optional[ClientRateLimitResetWebhookData], pydantic.Field(alias="Data") - ] = None diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhookdata.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhookdata.py deleted file mode 100644 index 7c4b71602..000000000 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitresetwebhookdata.py +++ /dev/null @@ -1,109 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from codat_sync_for_payables.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ClientRateLimitResetWebhookDataTypedDict(TypedDict): - quota_remaining: NotRequired[Nullable[int]] - r"""Total number of requests remaining for your client.""" - reset_reason: NotRequired[str] - r"""The reason for your rate limit quota being reset.""" - daily_quota: NotRequired[int] - r"""The number of available requests per day.""" - expires_utc: 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. - """ - - -class ClientRateLimitResetWebhookData(BaseModel): - quota_remaining: Annotated[ - OptionalNullable[int], pydantic.Field(alias="QuotaRemaining") - ] = UNSET - r"""Total number of requests remaining for your client.""" - - reset_reason: Annotated[Optional[str], pydantic.Field(alias="ResetReason")] = None - r"""The reason for your rate limit quota being reset.""" - - daily_quota: Annotated[Optional[int], pydantic.Field(alias="DailyQuota")] = None - r"""The number of available requests per day.""" - - expires_utc: Annotated[Optional[str], pydantic.Field(alias="ExpiresUtc")] = 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. - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["QuotaRemaining", "ResetReason", "DailyQuota", "ExpiresUtc"] - nullable_fields = ["QuotaRemaining"] - 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/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py index ac039a790..d0ba137f7 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhook.py @@ -5,8 +5,9 @@ ClientRateLimitWebhookPayload, ClientRateLimitWebhookPayloadTypedDict, ) -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -72,3 +73,19 @@ class ClientRateLimitWebhook(BaseModel): """ payload: Optional[ClientRateLimitWebhookPayload] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "eventType", "generatedDate", "payload"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py index fd1ee4f0d..7231884f8 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/clientratelimitwebhookpayload.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -65,3 +66,19 @@ class ClientRateLimitWebhookPayload(BaseModel): > 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. """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["dailyQuota", "quotaRemaining", "expiryDate"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/codatfile.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/codatfile.py index 0c51d083a..0dd6f1332 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/codatfile.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/codatfile.py @@ -1,10 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL from codat_sync_for_payables.utils import FieldMetadata, MultipartFormMetadata import io import pydantic +from pydantic import model_serializer from typing import IO, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -31,3 +32,19 @@ class CodatFile(BaseModel): pydantic.Field(alias="Content-Type"), FieldMetadata(multipart=True), ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["contentType"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/companies.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/companies.py index 2fe832d5f..d8e833343 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/companies.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/companies.py @@ -3,8 +3,9 @@ from __future__ import annotations from .company import Company, CompanyTypedDict from .links import Links, LinksTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -33,3 +34,19 @@ class Companies(BaseModel): links: Annotated[Links, pydantic.Field(alias="_links")] results: Optional[List[Company]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/company.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/company.py index 679e2c040..79700c99d 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/company.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/company.py @@ -177,40 +177,37 @@ class Company(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "description", - "lastSync", - "created", - "createdByUserName", - "products", - "tags", - "referenceParentCompany", - "referenceSubsidiaryCompanies", - "dataConnections", - ] - nullable_fields = ["createdByUserName"] - null_default_fields = [] - + optional_fields = set( + [ + "description", + "lastSync", + "created", + "createdByUserName", + "products", + "tags", + "referenceParentCompany", + "referenceSubsidiaryCompanies", + "dataConnections", + ] + ) + nullable_fields = set(["createdByUserName"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyinformation.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyinformation.py index 48ab5dc73..31e5af9bd 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyinformation.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyinformation.py @@ -37,30 +37,25 @@ class CompanyInformation(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["companyName", "baseCurrency"] - nullable_fields = ["companyName", "baseCurrency"] - null_default_fields = [] - + optional_fields = set(["companyName", "baseCurrency"]) + nullable_fields = set(["companyName", "baseCurrency"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyreference.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyreference.py index 74383bcaa..e76bb64c3 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyreference.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyreference.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import Dict, Optional from typing_extensions import NotRequired, TypedDict @@ -19,6 +20,22 @@ class CompanyReferenceLinks(BaseModel): portal: Optional[str] = None r"""Link to the company page in the portal.""" + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["portal"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class CompanyReferenceTypedDict(TypedDict): id: NotRequired[str] @@ -48,3 +65,19 @@ class CompanyReference(BaseModel): tags: Optional[Dict[str, str]] = None r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "name", "description", "links", "tags"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyrequestbody.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyrequestbody.py index e7eb6a274..ba0413dab 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyrequestbody.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyrequestbody.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import Dict, Optional from typing_extensions import NotRequired, TypedDict @@ -24,3 +25,19 @@ class CompanyRequestBody(BaseModel): tags: Optional[Dict[str, str]] = None r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "tags"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/companyupdaterequest.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyupdaterequest.py new file mode 100644 index 000000000..46e89fef6 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/companyupdaterequest.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompanyUpdateRequestTypedDict(TypedDict): + name: NotRequired[str] + r"""Name of company being connected.""" + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyUpdateRequest(BaseModel): + name: Optional[str] = None + r"""Name of company being connected.""" + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + tags: Optional[Dict[str, str]] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "description", "tags"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/connection.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/connection.py index 3eca3d708..9ebfccc2c 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/connection.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/connection.py @@ -13,7 +13,7 @@ from enum import Enum import pydantic from pydantic import model_serializer -from typing import Dict, List, Optional +from typing import Any, Dict, List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -101,7 +101,7 @@ class ConnectionTypedDict(TypedDict): > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ data_connection_errors: NotRequired[Nullable[List[DataConnectionErrorTypedDict]]] - connection_info: NotRequired[Nullable[Dict[str, str]]] + connection_info: NotRequired[Nullable[Dict[str, Any]]] class Connection(BaseModel): @@ -191,35 +191,30 @@ class Connection(BaseModel): ] = UNSET connection_info: Annotated[ - OptionalNullable[Dict[str, str]], pydantic.Field(alias="connectionInfo") + OptionalNullable[Dict[str, Any]], pydantic.Field(alias="connectionInfo") ] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["lastSync", "dataConnectionErrors", "connectionInfo"] - nullable_fields = ["dataConnectionErrors", "connectionInfo"] - null_default_fields = [] - + optional_fields = set(["lastSync", "dataConnectionErrors", "connectionInfo"]) + nullable_fields = set(["dataConnectionErrors", "connectionInfo"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/connections.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/connections.py index e373a22ca..2e1df73d5 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/connections.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/connections.py @@ -3,8 +3,9 @@ from __future__ import annotations from .connection import Connection, ConnectionTypedDict from .links import Links, LinksTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -33,3 +34,19 @@ class Connections(BaseModel): links: Annotated[Links, pydantic.Field(alias="_links")] results: Optional[List[Connection]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/dataconnectionerror.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/dataconnectionerror.py index f33eb1f63..a875b724a 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/dataconnectionerror.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/dataconnectionerror.py @@ -138,37 +138,34 @@ class DataConnectionError(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "statusCode", - "statusText", - "errorMessage", - "erroredOnUtc", - "status", - "resolvedOnUtc", - ] - nullable_fields = ["status"] - null_default_fields = [] - + optional_fields = set( + [ + "statusCode", + "statusText", + "errorMessage", + "erroredOnUtc", + "status", + "resolvedOnUtc", + ] + ) + nullable_fields = set(["status"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidation.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidation.py index 6ba86e02a..4b5f24f6c 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidation.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidation.py @@ -30,30 +30,25 @@ class ErrorValidation(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["errors", "warnings"] - nullable_fields = ["errors", "warnings"] - null_default_fields = [] - + optional_fields = set(["errors", "warnings"]) + nullable_fields = set(["errors", "warnings"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidationitem.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidationitem.py index 82eeddaf4..0722479cc 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidationitem.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/errorvalidationitem.py @@ -36,30 +36,25 @@ class ErrorValidationItem(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["itemId", "message", "validatorName"] - nullable_fields = ["itemId", "message", "validatorName"] - null_default_fields = [] - + optional_fields = set(["itemId", "message", "validatorName"]) + nullable_fields = set(["itemId", "message", "validatorName"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/halref.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/halref.py index 23ca53d21..3633c6fa9 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/halref.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/halref.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import Optional from typing_extensions import NotRequired, TypedDict @@ -14,3 +15,19 @@ class HalRefTypedDict(TypedDict): class HalRef(BaseModel): href: Optional[str] = None r"""Uri hypertext reference.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["href"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/links.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/links.py index 2c814f351..76e148720 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/links.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/links.py @@ -2,8 +2,9 @@ from __future__ import annotations from .halref import HalRef, HalRefTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -23,3 +24,19 @@ class Links(BaseModel): next: Optional[HalRef] = None previous: Optional[HalRef] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/pagination.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/pagination.py index 28e920235..ebd4d9d33 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/pagination.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/pagination.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -17,3 +18,19 @@ class Pagination(BaseModel): Optional[str], pydantic.Field(alias="continuationToken") ] = None r"""A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["continuationToken"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/paymentmappingoptions.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/paymentmappingoptions.py index f9743e452..e84f5a096 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/paymentmappingoptions.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/paymentmappingoptions.py @@ -6,8 +6,9 @@ BankAccountMappingOptionTypedDict, ) from .pagination import Pagination, PaginationTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, Nullable, UNSET_SENTINEL import pydantic +from pydantic import model_serializer from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -15,7 +16,7 @@ class PaymentMappingOptionsTypedDict(TypedDict): r"""Gets the bill payments mapping options for a company's accounting software""" - bank_accounts: NotRequired[List[BankAccountMappingOptionTypedDict]] + bank_accounts: NotRequired[List[Nullable[BankAccountMappingOptionTypedDict]]] pagination: NotRequired[PaginationTypedDict] @@ -23,7 +24,24 @@ class PaymentMappingOptions(BaseModel): r"""Gets the bill payments mapping options for a company's accounting software""" bank_accounts: Annotated[ - Optional[List[BankAccountMappingOption]], pydantic.Field(alias="bankAccounts") + Optional[List[Nullable[BankAccountMappingOption]]], + pydantic.Field(alias="bankAccounts"), ] = None pagination: Optional[Pagination] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["bankAccounts", "pagination"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/supplier.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/supplier.py index 634e3b4cf..16bb52a8b 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/supplier.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/supplier.py @@ -98,48 +98,47 @@ class Supplier(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "supplierName", - "contactName", - "emailAddress", - "phone", - "addresses", - "status", - "balance", - "defaultCurrency", - "sourceModifiedDate", - ] - nullable_fields = [ - "contactName", - "emailAddress", - "phone", - "addresses", - "balance", - "defaultCurrency", - ] - null_default_fields = [] - + optional_fields = set( + [ + "id", + "supplierName", + "contactName", + "emailAddress", + "phone", + "addresses", + "status", + "balance", + "defaultCurrency", + "sourceModifiedDate", + ] + ) + nullable_fields = set( + [ + "contactName", + "emailAddress", + "phone", + "addresses", + "balance", + "defaultCurrency", + ] + ) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierprototype.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierprototype.py index 2623f6ba6..248e452a6 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierprototype.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierprototype.py @@ -76,44 +76,43 @@ class SupplierPrototype(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "contactName", - "emailAddress", - "phone", - "addresses", - "balance", - "defaultCurrency", - ] - nullable_fields = [ - "contactName", - "emailAddress", - "phone", - "addresses", - "balance", - "defaultCurrency", - ] - null_default_fields = [] - + optional_fields = set( + [ + "contactName", + "emailAddress", + "phone", + "addresses", + "balance", + "defaultCurrency", + ] + ) + nullable_fields = set( + [ + "contactName", + "emailAddress", + "phone", + "addresses", + "balance", + "defaultCurrency", + ] + ) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierref.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierref.py index 427049d1d..bef54f97c 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierref.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/supplierref.py @@ -35,30 +35,25 @@ class SupplierRef(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["supplierName"] - nullable_fields = ["supplierName"] - null_default_fields = [] - + optional_fields = set(["supplierName"]) + nullable_fields = set(["supplierName"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/suppliers.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/suppliers.py index 563954e01..8cd43943f 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/suppliers.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/suppliers.py @@ -3,7 +3,8 @@ from __future__ import annotations from .pagination import Pagination, PaginationTypedDict from .supplier import Supplier, SupplierTypedDict -from codat_sync_for_payables.types import BaseModel +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer from typing import List, Optional from typing_extensions import NotRequired, TypedDict @@ -17,3 +18,19 @@ class Suppliers(BaseModel): results: Optional[List[Supplier]] = None pagination: Optional[Pagination] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "pagination"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/taxratemappingoption.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/taxratemappingoption.py index 2c73ba36a..ffc4c9033 100644 --- a/sync-for-payables/src/codat_sync_for_payables/models/shared/taxratemappingoption.py +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/taxratemappingoption.py @@ -85,37 +85,27 @@ class TaxRateMappingOption(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [ - "id", - "name", - "code", - "effectiveTaxRate", - "totalTaxRate", - "status", - ] - nullable_fields = ["name", "code", "effectiveTaxRate", "totalTaxRate"] - null_default_fields = [] - + optional_fields = set( + ["id", "name", "code", "effectiveTaxRate", "totalTaxRate", "status"] + ) + nullable_fields = set(["name", "code", "effectiveTaxRate", "totalTaxRate"]) serialized = handler(self) - m = {} - for n, f in self.model_fields.items(): + for n, f in type(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 + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val return m diff --git a/sync-for-payables/src/codat_sync_for_payables/models/shared/trackingref.py b/sync-for-payables/src/codat_sync_for_payables/models/shared/trackingref.py new file mode 100644 index 000000000..640672745 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/models/shared/trackingref.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables.types import BaseModel, UNSET_SENTINEL +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataType(str, Enum): + r"""The type of the linked reference.""" + + TRACKING_CATEGORIES = "trackingCategories" + CUSTOMERS = "customers" + + +class TrackingRefTypedDict(TypedDict): + id: NotRequired[str] + r"""Unique identifier of the linked tracking category or the unique identifier of the linked customer.""" + data_type: NotRequired[DataType] + r"""The type of the linked reference.""" + is_billable: NotRequired[bool] + r"""If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not.""" + + +class TrackingRef(BaseModel): + id: Optional[str] = None + r"""Unique identifier of the linked tracking category or the unique identifier of the linked customer.""" + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""The type of the linked reference.""" + + is_billable: Annotated[Optional[bool], pydantic.Field(alias="isBillable")] = None + r"""If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "dataType", "isBillable"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/sync-for-payables/src/codat_sync_for_payables/sdk.py b/sync-for-payables/src/codat_sync_for_payables/sdk.py index 0b25d5469..19182eedc 100644 --- a/sync-for-payables/src/codat_sync_for_payables/sdk.py +++ b/sync-for-payables/src/codat_sync_for_payables/sdk.py @@ -1,31 +1,36 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, HttpClient +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients from .sdkconfiguration import SDKConfiguration from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig from codat_sync_for_payables import utils from codat_sync_for_payables._hooks import SDKHooks -from codat_sync_for_payables.bank_accounts import BankAccounts -from codat_sync_for_payables.bill_payments import BillPayments -from codat_sync_for_payables.bills import Bills -from codat_sync_for_payables.companies import Companies -from codat_sync_for_payables.company_information import CompanyInformation -from codat_sync_for_payables.connections import Connections from codat_sync_for_payables.models import shared -from codat_sync_for_payables.suppliers import Suppliers from codat_sync_for_payables.types import OptionalNullable, UNSET import httpx -from typing import Callable, Dict, Optional, Union +import importlib +import sys +from typing import Callable, Dict, Optional, TYPE_CHECKING, Union, cast +import weakref + +if TYPE_CHECKING: + from codat_sync_for_payables.bank_accounts import BankAccounts + from codat_sync_for_payables.bill_payments import BillPayments + from codat_sync_for_payables.bills import Bills + from codat_sync_for_payables.companies import Companies + from codat_sync_for_payables.company_information import CompanyInformation + from codat_sync_for_payables.connections import Connections + from codat_sync_for_payables.suppliers import Suppliers class CodatSyncPayables(BaseSDK): - r"""Bill pay kit: The API reference for the Bill Pay kit. + r"""Bill pay (synchronous solution): The API reference for the synchronous Bill Pay solution. - The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. + The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. - [Explore product](https://docs.codat.io/payables/bill-pay-kit) | [See OpenAPI spec](https://github.com/codatio/oas) + [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations @@ -35,7 +40,9 @@ class CodatSyncPayables(BaseSDK): | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | + | Sage Intacct | Yes | | Xero | Yes | + | Zoho Books | Yes | --- @@ -53,20 +60,32 @@ class CodatSyncPayables(BaseSDK): """ - companies: Companies + companies: "Companies" r"""Create and manage your SMB users' companies.""" - connections: Connections + connections: "Connections" r"""Create new and manage existing data connections for a company.""" - company_information: CompanyInformation + company_information: "CompanyInformation" r"""View company profile from the source platform.""" - bills: Bills + bills: "Bills" r"""Get, create, and update Bills.""" - bill_payments: BillPayments + bill_payments: "BillPayments" r"""Get, create, and update Bill payments.""" - suppliers: Suppliers + suppliers: "Suppliers" r"""Get, create, and update Suppliers.""" - bank_accounts: BankAccounts + bank_accounts: "BankAccounts" r"""Create a bank account for a given company's connection.""" + _sub_sdk_map = { + "companies": ("codat_sync_for_payables.companies", "Companies"), + "connections": ("codat_sync_for_payables.connections", "Connections"), + "company_information": ( + "codat_sync_for_payables.company_information", + "CompanyInformation", + ), + "bills": ("codat_sync_for_payables.bills", "Bills"), + "bill_payments": ("codat_sync_for_payables.bill_payments", "BillPayments"), + "suppliers": ("codat_sync_for_payables.suppliers", "Suppliers"), + "bank_accounts": ("codat_sync_for_payables.bank_accounts", "BankAccounts"), + } def __init__( self, @@ -91,15 +110,19 @@ def __init__( :param retry_config: The retry configuration to use for all supported methods :param timeout_ms: Optional request timeout applied to each operation in milliseconds """ + client_supplied = True if client is None: - client = httpx.Client() + client = httpx.Client(follow_redirects=True) + client_supplied = False assert issubclass( type(client), HttpClient ), "The provided client must implement the HttpClient protocol." + async_client_supplied = True if async_client is None: - async_client = httpx.AsyncClient() + async_client = httpx.AsyncClient(follow_redirects=True) + async_client_supplied = False if debug_logger is None: debug_logger = get_default_logger() @@ -116,7 +139,9 @@ def __init__( self, SDKConfiguration( client=client, + client_supplied=client_supplied, async_client=async_client, + async_client_supplied=async_client_supplied, security=security, server_url=server_url, server_idx=server_idx, @@ -124,30 +149,68 @@ def __init__( timeout_ms=timeout_ms, debug_logger=debug_logger, ), + parent_ref=self, ) hooks = SDKHooks() + # pylint: disable=protected-access + self.sdk_configuration.__dict__["_hooks"] = hooks + current_server_url, *_ = self.sdk_configuration.get_server_details() server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, self.sdk_configuration.client + current_server_url, client ) if current_server_url != server_url: self.sdk_configuration.server_url = server_url - # pylint: disable=protected-access - self.sdk_configuration.__dict__["_hooks"] = hooks + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) - self._init_sdks() + def dynamic_import(self, modname, retries=3): + for attempt in range(retries): + try: + return importlib.import_module(modname) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + def __getattr__(self, name: str): + if name in self._sub_sdk_map: + module_path, class_name = self._sub_sdk_map[name] + try: + module = self.dynamic_import(module_path) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration, parent_ref=self) + setattr(self, name, instance) + return instance + except ImportError as e: + raise AttributeError( + f"Failed to import module {module_path} for attribute {name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" + ) from e + + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{name}'" + ) - def _init_sdks(self): - self.companies = Companies(self.sdk_configuration) - self.connections = Connections(self.sdk_configuration) - self.company_information = CompanyInformation(self.sdk_configuration) - self.bills = Bills(self.sdk_configuration) - self.bill_payments = BillPayments(self.sdk_configuration) - self.suppliers = Suppliers(self.sdk_configuration) - self.bank_accounts = BankAccounts(self.sdk_configuration) + def __dir__(self): + default_attrs = list(super().__dir__()) + lazy_attrs = list(self._sub_sdk_map.keys()) + return sorted(list(set(default_attrs + lazy_attrs))) def __enter__(self): return self @@ -156,9 +219,17 @@ async def __aenter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): - if self.sdk_configuration.client is not None: + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): self.sdk_configuration.client.close() + self.sdk_configuration.client = None async def __aexit__(self, exc_type, exc_val, exc_tb): - if self.sdk_configuration.async_client is not None: + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/sync-for-payables/src/codat_sync_for_payables/sdkconfiguration.py b/sync-for-payables/src/codat_sync_for_payables/sdkconfiguration.py index b56db6de0..49269e53b 100644 --- a/sync-for-payables/src/codat_sync_for_payables/sdkconfiguration.py +++ b/sync-for-payables/src/codat_sync_for_payables/sdkconfiguration.py @@ -1,6 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._hooks import SDKHooks +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from codat_sync_for_payables.models import shared @@ -19,25 +24,22 @@ @dataclass class SDKConfiguration: - client: HttpClient - async_client: AsyncHttpClient + client: Union[HttpClient, None] + client_supplied: bool + async_client: Union[AsyncHttpClient, None] + async_client_supplied: bool debug_logger: Logger security: Optional[Union[shared.Security, Callable[[], shared.Security]]] = None server_url: Optional[str] = "" server_idx: Optional[int] = 0 language: str = "python" - openapi_doc_version: str = "3.0.0" - sdk_version: str = "8.0.3" - gen_version: str = "2.474.15" - user_agent: str = ( - "speakeasy-sdk/python 8.0.3 2.474.15 3.0.0 codat-sync-for-payables" - ) + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None - def __post_init__(self): - self._hooks = SDKHooks() - def get_server_details(self) -> Tuple[str, Dict[str, str]]: if self.server_url is not None and self.server_url: return remove_suffix(self.server_url, "/"), {} @@ -45,6 +47,3 @@ def get_server_details(self) -> Tuple[str, Dict[str, str]]: self.server_idx = 0 return SERVERS[self.server_idx], {} - - def get_hooks(self) -> SDKHooks: - return self._hooks diff --git a/sync-for-payables/src/codat_sync_for_payables/suppliers.py b/sync-for-payables/src/codat_sync_for_payables/suppliers.py index f0acd70bc..fc8e95a55 100644 --- a/sync-for-payables/src/codat_sync_for_payables/suppliers.py +++ b/sync-for-payables/src/codat_sync_for_payables/suppliers.py @@ -5,7 +5,10 @@ from codat_sync_for_payables._hooks import HookContext from codat_sync_for_payables.models import errors, operations, shared from codat_sync_for_payables.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from codat_sync_for_payables.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast class Suppliers(BaseSDK): @@ -20,6 +23,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, ) -> shared.Suppliers: r"""List suppliers @@ -35,6 +39,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 @@ -43,12 +48,14 @@ def list( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListSuppliersRequest) request = cast(operations.ListSuppliersRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/suppliers", base_url=base_url, @@ -59,7 +66,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -77,8 +86,10 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-suppliers", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -98,30 +109,27 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Suppliers) + return unmarshal_json_response(shared.Suppliers, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, @@ -132,6 +140,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, ) -> shared.Suppliers: r"""List suppliers @@ -147,6 +156,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 @@ -155,12 +165,14 @@ async def list_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListSuppliersRequest) request = cast(operations.ListSuppliersRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/companies/{companyId}/connections/{connectionId}/payables/suppliers", base_url=base_url, @@ -171,7 +183,9 @@ 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, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -189,8 +203,10 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="list-suppliers", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -210,30 +226,27 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Suppliers) + return unmarshal_json_response(shared.Suppliers, http_res) if utils.match_response( http_res, - ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + ["400", "401", "402", "403", "404", "409", "429"], "application/json", ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) def create( self, @@ -244,6 +257,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, ) -> shared.Supplier: r"""Create supplier @@ -256,6 +270,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 @@ -264,12 +279,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateSupplierRequest) request = cast(operations.CreateSupplierRequest, request) - req = self.build_request( + req = self._build_request( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/suppliers", base_url=base_url, @@ -280,6 +297,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.supplier_prototype, @@ -288,6 +306,7 @@ def create( "json", Optional[shared.SupplierPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -305,8 +324,10 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-supplier", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -325,30 +346,25 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Supplier) + return unmarshal_json_response(shared.Supplier, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -359,6 +375,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, ) -> shared.Supplier: r"""Create supplier @@ -371,6 +388,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 @@ -379,12 +397,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateSupplierRequest) request = cast(operations.CreateSupplierRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/companies/{companyId}/connections/{connectionId}/payables/suppliers", base_url=base_url, @@ -395,6 +415,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.supplier_prototype, @@ -403,6 +424,7 @@ async def create_async( "json", Optional[shared.SupplierPrototype], ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -420,8 +442,10 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create-supplier", - oauth2_scopes=[], + oauth2_scopes=None, security_source=self.sdk_configuration.security, ), request=req, @@ -440,27 +464,22 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return utils.unmarshal_json(http_res.text, shared.Supplier) + return unmarshal_json_response(shared.Supplier, http_res) if utils.match_response( - http_res, - ["400", "401", "402", "403", "404", "429", "500", "503"], - "application/json", + http_res, ["400", "401", "402", "403", "404", "429"], "application/json" ): - data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) - raise errors.ErrorMessage(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/json"): + response_data = unmarshal_json_response(errors.ErrorMessageData, http_res) + raise errors.ErrorMessage(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/sync-for-payables/src/codat_sync_for_payables/types/basemodel.py b/sync-for-payables/src/codat_sync_for_payables/types/basemodel.py index a6187efa6..a9a640a1a 100644 --- a/sync-for-payables/src/codat_sync_for_payables/types/basemodel.py +++ b/sync-for-payables/src/codat_sync_for_payables/types/basemodel.py @@ -2,7 +2,8 @@ from pydantic import ConfigDict, model_serializer from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from pydantic_core import core_schema +from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union from typing_extensions import TypeAliasType, TypeAlias @@ -35,5 +36,42 @@ def __bool__(self) -> Literal[False]: "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) ) -UnrecognizedInt = NewType("UnrecognizedInt", int) -UnrecognizedStr = NewType("UnrecognizedStr", str) + +class UnrecognizedStr(str): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedStr only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedStr': + if isinstance(v, cls): + return v + return cls(str(v)) + + # Use lax_or_strict_schema where strict always fails + # This forces Pydantic to prefer other union members in strict mode + # and only fall back to UnrecognizedStr in lax mode + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.str_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) + + +class UnrecognizedInt(int): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedInt only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedInt': + if isinstance(v, cls): + return v + return cls(int(v)) + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.int_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/__init__.py b/sync-for-payables/src/codat_sync_for_payables/utils/__init__.py index 26d51ae8f..15394a08a 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/__init__.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/__init__.py @@ -1,49 +1,65 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .annotations import get_discriminator -from .enums import OpenEnumMeta -from .headers import get_headers, get_response_headers -from .metadata import ( - FieldMetadata, - find_metadata, - FormMetadata, - HeaderMetadata, - MultipartFormMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, - SecurityMetadata, -) -from .queryparams import get_query_params -from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig -from .requestbodies import serialize_request_body, SerializedRequestBody -from .security import get_security -from .serializers import ( - get_pydantic_model, - marshal_json, - unmarshal, - unmarshal_json, - serialize_decimal, - serialize_float, - serialize_int, - stream_to_text, - stream_to_text_async, - stream_to_bytes, - stream_to_bytes_async, - validate_const, - validate_decimal, - validate_float, - validate_int, - validate_open_enum, -) -from .url import generate_url, template_url, remove_suffix -from .values import ( - get_global_from_env, - match_content_type, - match_status_codes, - match_response, -) -from .logger import Logger, get_body_content, get_default_logger +from typing import TYPE_CHECKING, Callable, TypeVar +from importlib import import_module +import asyncio +import builtins +import sys + +_T = TypeVar("_T") + + +async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T: + """Run a synchronous function in a thread pool to avoid blocking the event loop.""" + return await asyncio.to_thread(func, *args) + + +if TYPE_CHECKING: + from .annotations import get_discriminator + from .datetimes import parse_datetime + from .enums import OpenEnumMeta + from .headers import get_headers, get_response_headers + from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, + ) + from .queryparams import get_query_params + from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig + from .requestbodies import serialize_request_body, SerializedRequestBody + from .security import get_security + from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + ) + from .url import generate_url, template_url, remove_suffix + from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, + cast_partial, + ) + from .logger import Logger, get_body_content, get_default_logger __all__ = [ "BackoffStrategy", @@ -54,6 +70,7 @@ "get_body_content", "get_default_logger", "get_discriminator", + "parse_datetime", "get_global_from_env", "get_headers", "get_pydantic_model", @@ -93,5 +110,94 @@ "validate_const", "validate_float", "validate_int", - "validate_open_enum", + "cast_partial", ] + +_dynamic_imports: dict[str, str] = { + "BackoffStrategy": ".retries", + "FieldMetadata": ".metadata", + "find_metadata": ".metadata", + "FormMetadata": ".metadata", + "generate_url": ".url", + "get_body_content": ".logger", + "get_default_logger": ".logger", + "get_discriminator": ".annotations", + "parse_datetime": ".datetimes", + "get_global_from_env": ".values", + "get_headers": ".headers", + "get_pydantic_model": ".serializers", + "get_query_params": ".queryparams", + "get_response_headers": ".headers", + "get_security": ".security", + "HeaderMetadata": ".metadata", + "Logger": ".logger", + "marshal_json": ".serializers", + "match_content_type": ".values", + "match_status_codes": ".values", + "match_response": ".values", + "MultipartFormMetadata": ".metadata", + "OpenEnumMeta": ".enums", + "PathParamMetadata": ".metadata", + "QueryParamMetadata": ".metadata", + "remove_suffix": ".url", + "Retries": ".retries", + "retry": ".retries", + "retry_async": ".retries", + "RetryConfig": ".retries", + "RequestMetadata": ".metadata", + "SecurityMetadata": ".metadata", + "serialize_decimal": ".serializers", + "serialize_float": ".serializers", + "serialize_int": ".serializers", + "serialize_request_body": ".requestbodies", + "SerializedRequestBody": ".requestbodies", + "stream_to_text": ".serializers", + "stream_to_text_async": ".serializers", + "stream_to_bytes": ".serializers", + "stream_to_bytes_async": ".serializers", + "template_url": ".url", + "unmarshal": ".serializers", + "unmarshal_json": ".serializers", + "validate_decimal": ".serializers", + "validate_const": ".serializers", + "validate_float": ".serializers", + "validate_int": ".serializers", + "cast_partial": ".values", +} + + +def dynamic_import(modname, retries=3): + for attempt in range(retries): + try: + return import_module(modname, __package__) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"no {attr_name} found in _dynamic_imports, module name -> {__name__} " + ) + + try: + module = dynamic_import(module_name) + return getattr(module, attr_name) + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = builtins.list(_dynamic_imports.keys()) + return builtins.sorted(lazy_attrs) diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/annotations.py b/sync-for-payables/src/codat_sync_for_payables/utils/annotations.py index 387874edd..12e0aa4f1 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/annotations.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/annotations.py @@ -3,6 +3,7 @@ from enum import Enum from typing import Any, Optional + def get_discriminator(model: Any, fieldname: str, key: str) -> str: """ Recursively search for the discriminator attribute in a model. @@ -25,31 +26,54 @@ def get_field_discriminator(field: Any) -> Optional[str]: if isinstance(field, dict): if key in field: - return f'{field[key]}' + return f"{field[key]}" if hasattr(field, fieldname): attr = getattr(field, fieldname) if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' + return f"{attr.value}" + return f"{attr}" if hasattr(field, upper_fieldname): attr = getattr(field, upper_fieldname) if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' + return f"{attr.value}" + return f"{attr}" return None + def search_nested_discriminator(obj: Any) -> Optional[str]: + """Recursively search for discriminator in nested structures.""" + # First try direct field lookup + discriminator = get_field_discriminator(obj) + if discriminator is not None: + return discriminator + + # If it's a dict, search in nested values + if isinstance(obj, dict): + for value in obj.values(): + if isinstance(value, list): + # Search in list items + for item in value: + nested_discriminator = search_nested_discriminator(item) + if nested_discriminator is not None: + return nested_discriminator + elif isinstance(value, dict): + # Search in nested dict + nested_discriminator = search_nested_discriminator(value) + if nested_discriminator is not None: + return nested_discriminator + + return None if isinstance(model, list): for field in model: - discriminator = get_field_discriminator(field) + discriminator = search_nested_discriminator(field) if discriminator is not None: return discriminator - discriminator = get_field_discriminator(model) + discriminator = search_nested_discriminator(model) if discriminator is not None: return discriminator - raise ValueError(f'Could not find discriminator field {fieldname} in {model}') + raise ValueError(f"Could not find discriminator field {fieldname} in {model}") diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/datetimes.py b/sync-for-payables/src/codat_sync_for_payables/utils/datetimes.py new file mode 100644 index 000000000..a6c52cd61 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/utils/datetimes.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +import sys + + +def parse_datetime(datetime_string: str) -> datetime: + """ + Convert a RFC 3339 / ISO 8601 formatted string into a datetime object. + Python versions 3.11 and later support parsing RFC 3339 directly with + datetime.fromisoformat(), but for earlier versions, this function + encapsulates the necessary extra logic. + """ + # Python 3.11 and later can parse RFC 3339 directly + if sys.version_info >= (3, 11): + return datetime.fromisoformat(datetime_string) + + # For Python 3.10 and earlier, a common ValueError is trailing 'Z' suffix, + # so fix that upfront. + if datetime_string.endswith("Z"): + datetime_string = datetime_string[:-1] + "+00:00" + + return datetime.fromisoformat(datetime_string) diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/enums.py b/sync-for-payables/src/codat_sync_for_payables/utils/enums.py index c650b10cb..3324e1bc2 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/enums.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/enums.py @@ -1,34 +1,134 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" import enum +import sys +from typing import Any + +from pydantic_core import core_schema class OpenEnumMeta(enum.EnumMeta): - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin - - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value + + def __new__(mcs, name, bases, namespace, **kwargs): + cls = super().__new__(mcs, name, bases, namespace, **kwargs) + + # Add __get_pydantic_core_schema__ to make open enums work correctly + # in union discrimination. In strict mode (used by Pydantic for unions), + # only known enum values match. In lax mode, unknown values are accepted. + def __get_pydantic_core_schema__( + cls_inner: Any, _source_type: Any, _handler: Any + ) -> core_schema.CoreSchema: + # Create a validator that only accepts known enum values (for strict mode) + def validate_strict(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + # Use the parent EnumMeta's __call__ which raises ValueError for unknown values + return enum.EnumMeta.__call__(cls_inner, v) + + # Create a lax validator that accepts unknown values + def validate_lax(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + try: + return enum.EnumMeta.__call__(cls_inner, v) + except ValueError: + # Return the raw value for unknown enum values + return v + + # Determine the base type schema (str or int) + is_int_enum = False + for base in cls_inner.__mro__: + if base is int: + is_int_enum = True + break + if base is str: + break + + base_schema = ( + core_schema.int_schema() + if is_int_enum + else core_schema.str_schema() ) - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, + # Use lax_or_strict_schema: + # - strict mode: only known enum values match (raises ValueError for unknown) + # - lax mode: accept any value, return enum member or raw value + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_lax)] + ), + strict_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_strict)] + ), ) - except ValueError: - return value + + setattr(cls, "__get_pydantic_core_schema__", classmethod(__get_pydantic_core_schema__)) + return cls diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/eventstreaming.py b/sync-for-payables/src/codat_sync_for_payables/utils/eventstreaming.py index 74a63f757..f2052fc22 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/eventstreaming.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/eventstreaming.py @@ -2,7 +2,9 @@ import re import json +from dataclasses import dataclass, asdict from typing import ( + Any, Callable, Generic, TypeVar, @@ -17,70 +19,98 @@ class EventStream(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] response: httpx.Response generator: Generator[T, None, None] + _closed: bool def __init__( self, response: httpx.Response, decoder: Callable[[str], T], sentinel: Optional[str] = None, + client_ref: Optional[object] = None, ): self.response = response self.generator = stream_events(response, decoder, sentinel) + self.client_ref = client_ref + self._closed = False def __iter__(self): return self def __next__(self): + if self._closed: + raise StopIteration return next(self.generator) def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): + self._closed = True self.response.close() class EventStreamAsync(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] response: httpx.Response generator: AsyncGenerator[T, None] + _closed: bool def __init__( self, response: httpx.Response, decoder: Callable[[str], T], sentinel: Optional[str] = None, + client_ref: Optional[object] = None, ): self.response = response self.generator = stream_events_async(response, decoder, sentinel) + self.client_ref = client_ref + self._closed = False def __aiter__(self): return self async def __anext__(self): + if self._closed: + raise StopAsyncIteration return await self.generator.__anext__() async def __aenter__(self): return self async def __aexit__(self, exc_type, exc_val, exc_tb): + self._closed = True await self.response.aclose() +@dataclass class ServerEvent: id: Optional[str] = None event: Optional[str] = None - data: Optional[str] = None + data: Any = None retry: Optional[int] = None MESSAGE_BOUNDARIES = [ b"\r\n\r\n", - b"\n\n", + b"\r\n\r", + b"\r\n\n", + b"\r\r\n", + b"\n\r\n", b"\r\r", + b"\n\r", + b"\n\n", ] +UTF8_BOM = b"\xef\xbb\xbf" + async def stream_events_async( response: httpx.Response, @@ -89,14 +119,10 @@ async def stream_events_async( ) -> AsyncGenerator[T, None]: buffer = bytearray() position = 0 - discard = False + event_id: Optional[str] = None async for chunk in response.aiter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] buffer += chunk for i in range(position, len(buffer)): char = buffer[i : i + 1] @@ -111,15 +137,22 @@ async def stream_events_async( block = buffer[position:i] position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) + event, discard, event_id = _parse_event( + raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + ) if event is not None: yield event + if discard: + await response.aclose() + return if position > 0: buffer = buffer[position:] position = 0 - event, discard = _parse_event(buffer, decoder, sentinel) + event, discard, _ = _parse_event( + raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + ) if event is not None: yield event @@ -131,14 +164,10 @@ def stream_events( ) -> Generator[T, None, None]: buffer = bytearray() position = 0 - discard = False + event_id: Optional[str] = None for chunk in response.iter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] buffer += chunk for i in range(position, len(buffer)): char = buffer[i : i + 1] @@ -153,22 +182,33 @@ def stream_events( block = buffer[position:i] position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) + event, discard, event_id = _parse_event( + raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + ) if event is not None: yield event + if discard: + response.close() + return if position > 0: buffer = buffer[position:] position = 0 - event, discard = _parse_event(buffer, decoder, sentinel) + event, discard, _ = _parse_event( + raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + ) if event is not None: yield event def _parse_event( - raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None -) -> Tuple[Optional[T], bool]: + *, + raw: bytearray, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + event_id: Optional[str] = None, +) -> Tuple[Optional[T], bool, Optional[str]]: block = raw.decode() lines = re.split(r"\r?\n|\r", block) publish = False @@ -179,13 +219,16 @@ def _parse_event( continue delim = line.find(":") - if delim <= 0: + if delim == 0: continue - field = line[0:delim] - value = line[delim + 1 :] if delim < len(line) - 1 else "" - if len(value) and value[0] == " ": - value = value[1:] + field = line + value = "" + if delim > 0: + field = line[0:delim] + value = line[delim + 1 :] if delim < len(line) - 1 else "" + if len(value) and value[0] == " ": + value = value[1:] if field == "event": event.event = value @@ -194,37 +237,36 @@ def _parse_event( data += value + "\n" publish = True elif field == "id": - event.id = value publish = True + if "\x00" not in value: + event_id = value elif field == "retry": - event.retry = int(value) if value.isdigit() else None + if value.isdigit(): + event.retry = int(value) publish = True + event.id = event_id + if sentinel and data == f"{sentinel}\n": - return None, True + return None, True, event_id if data: data = data[:-1] - event.data = data - - data_is_primitive = ( - data.isnumeric() or data == "true" or data == "false" or data == "null" - ) - data_is_json = ( - data.startswith("{") or data.startswith("[") or data.startswith('"') - ) - - if data_is_primitive or data_is_json: - try: - event.data = json.loads(data) - except Exception: - pass + try: + event.data = json.loads(data) + except json.JSONDecodeError: + event.data = data out = None if publish: - out = decoder(json.dumps(event.__dict__)) - - return out, False + out_dict = { + k: v + for k, v in asdict(event).items() + if v is not None or (k == "data" and data) + } + out = decoder(json.dumps(out_dict)) + + return out, False, event_id def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/forms.py b/sync-for-payables/src/codat_sync_for_payables/utils/forms.py index 9f5a731e9..f961e76be 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/forms.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/forms.py @@ -86,11 +86,39 @@ def _populate_form( return form +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + def serialize_multipart_form( media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: form: Dict[str, Any] = {} - files: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] if not isinstance(request, BaseModel): raise TypeError("invalid request body type") @@ -109,47 +137,44 @@ def serialize_multipart_form( if not field_metadata: continue - f_name = field.alias if field.alias is not None else name + f_name = field.alias if field.alias else name if field_metadata.file: - file_fields: Dict[str, FieldInfo] = val.__class__.model_fields - - file_name = "" - field_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] - - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue + if isinstance(val, List): + # Handle array of files + array_field_name = f_name + "[]" + for file_obj in val: + if not _is_set(file_obj): + continue - if file_metadata.content: - content = getattr(val, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(val, file_field_name, None) - else: - field_name = ( - file_field.alias - if file_field.alias is not None - else file_field_name + file_name, content, content_type = _extract_file_properties( + file_obj ) - file_name = getattr(val, file_field_name) - - if field_name == "" or file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - if content_type is not None: - files[field_name] = (file_name, content, content_type) + if content_type is not None: + files.append( + (array_field_name, (file_name, content, content_type)) + ) + else: + files.append((array_field_name, (file_name, content))) else: - files[field_name] = (file_name, content) + # Handle single file + file_name, content, content_type = _extract_file_properties(val) + + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) + else: + files.append((f_name, (file_name, content))) elif field_metadata.json: - files[f_name] = ( - None, - marshal_json(val, request_field_types[name]), - "application/json", + files.append( + ( + f_name, + ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ), + ) ) else: if isinstance(val, List): @@ -160,7 +185,8 @@ def serialize_multipart_form( continue values.append(_val_to_string(value)) - form[f_name + "[]"] = values + array_field_name = f_name + "[]" + form[array_field_name] = values else: form[f_name] = _val_to_string(val) return media_type, form, files diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/queryparams.py b/sync-for-payables/src/codat_sync_for_payables/utils/queryparams.py index 37a6e7f9a..c04e0db82 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/queryparams.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/queryparams.py @@ -27,12 +27,13 @@ def get_query_params( query_params: Any, gbls: Optional[Any] = None, + allow_empty_value: Optional[List[str]] = None, ) -> Dict[str, List[str]]: params: Dict[str, List[str]] = {} - globals_already_populated = _populate_query_params(query_params, gbls, params, []) + globals_already_populated = _populate_query_params(query_params, gbls, params, [], allow_empty_value) if _is_set(gbls): - _populate_query_params(gbls, None, params, globals_already_populated) + _populate_query_params(gbls, None, params, globals_already_populated, allow_empty_value) return params @@ -42,6 +43,7 @@ def _populate_query_params( gbls: Any, query_param_values: Dict[str, List[str]], skip_fields: List[str], + allow_empty_value: Optional[List[str]] = None, ) -> List[str]: globals_already_populated: List[str] = [] @@ -69,6 +71,16 @@ def _populate_query_params( globals_already_populated.append(name) f_name = field.alias if field.alias is not None else name + + allow_empty_set = set(allow_empty_value or []) + should_include_empty = f_name in allow_empty_set and ( + value is None or value == [] or value == "" + ) + + if should_include_empty: + query_param_values[f_name] = [""] + continue + serialization = metadata.serialization if serialization is not None: serialized_parms = _get_serialized_params( diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/requestbodies.py b/sync-for-payables/src/codat_sync_for_payables/utils/requestbodies.py index d5240dd5f..1de32b6d2 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/requestbodies.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/requestbodies.py @@ -44,15 +44,15 @@ def serialize_request_body( serialized_request_body = SerializedRequestBody(media_type) - if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: + if re.match(r"^(application|text)\/([^+]+\+)*json.*", media_type) is not None: serialized_request_body.content = marshal_json(request_body, request_body_type) - elif re.match(r"multipart\/.*", media_type) is not None: + elif re.match(r"^multipart\/.*", media_type) is not None: ( serialized_request_body.media_type, serialized_request_body.data, serialized_request_body.files, ) = serialize_multipart_form(media_type, request_body) - elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: + elif re.match(r"^application\/x-www-form-urlencoded.*", media_type) is not None: serialized_request_body.data = serialize_form_data(request_body) elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): serialized_request_body.content = request_body diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/retries.py b/sync-for-payables/src/codat_sync_for_payables/utils/retries.py index 4d6086716..88a91b10c 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/retries.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/retries.py @@ -3,7 +3,9 @@ import asyncio import random import time -from typing import List +from datetime import datetime +from email.utils import parsedate_to_datetime +from typing import List, Optional import httpx @@ -51,9 +53,11 @@ def __init__(self, config: RetryConfig, status_codes: List[str]): class TemporaryError(Exception): response: httpx.Response + retry_after: Optional[int] def __init__(self, response: httpx.Response): self.response = response + self.retry_after = _parse_retry_after_header(response) class PermanentError(Exception): @@ -63,6 +67,62 @@ def __init__(self, inner: Exception): self.inner = inner +def _parse_retry_after_header(response: httpx.Response) -> Optional[int]: + """Parse Retry-After header from response. + + Returns: + Retry interval in milliseconds, or None if header is missing or invalid. + """ + retry_after_header = response.headers.get("retry-after") + if not retry_after_header: + return None + + try: + seconds = float(retry_after_header) + return round(seconds * 1000) + except ValueError: + pass + + try: + retry_date = parsedate_to_datetime(retry_after_header) + delta = (retry_date - datetime.now(retry_date.tzinfo)).total_seconds() + return round(max(0, delta) * 1000) + except (ValueError, TypeError): + pass + + return None + + +def _get_sleep_interval( + exception: Exception, + initial_interval: int, + max_interval: int, + exponent: float, + retries: int, +) -> float: + """Get sleep interval for retry with exponential backoff. + + Args: + exception: The exception that triggered the retry. + initial_interval: Initial retry interval in milliseconds. + max_interval: Maximum retry interval in milliseconds. + exponent: Base for exponential backoff calculation. + retries: Current retry attempt count. + + Returns: + Sleep interval in seconds. + """ + if ( + isinstance(exception, TemporaryError) + and exception.retry_after is not None + and exception.retry_after > 0 + ): + return exception.retry_after / 1000 + + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + return min(sleep, max_interval / 1000) + + def retry(func, retries: Retries): if retries.config.strategy == "backoff": @@ -183,8 +243,10 @@ def retry_with_backoff( return exception.response raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) time.sleep(sleep) retries += 1 @@ -211,7 +273,9 @@ async def retry_with_backoff_async( return exception.response raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) await asyncio.sleep(sleep) retries += 1 diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/security.py b/sync-for-payables/src/codat_sync_for_payables/utils/security.py index 295a3f400..17996bd54 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/security.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/security.py @@ -135,6 +135,8 @@ def _parse_security_scheme_value( elif scheme_type == "http": if sub_type == "bearer": headers[header_name] = _apply_bearer(value) + elif sub_type == "basic": + headers[header_name] = value elif sub_type == "custom": return else: diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/serializers.py b/sync-for-payables/src/codat_sync_for_payables/utils/serializers.py index c5eb36597..14321eb47 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/serializers.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/serializers.py @@ -1,20 +1,24 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from decimal import Decimal +import functools import json -from typing import Any, Dict, List, Union, get_args -import httpx +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions from typing_extensions import get_origin + +import httpx from pydantic import ConfigDict, create_model from pydantic_core import from_json -from typing_inspect import is_optional_type from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset def serialize_decimal(as_str: bool): def serialize(d): - if is_optional_type(type(d)) and d is None: + # Optional[T] is a Union[T, None] + if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: return None if isinstance(d, Unset): return d @@ -42,7 +46,8 @@ def validate_decimal(d): def serialize_float(as_str: bool): def serialize(f): - if is_optional_type(type(f)) and f is None: + # Optional[T] is a Union[T, None] + if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: return None if isinstance(f, Unset): return f @@ -70,7 +75,8 @@ def validate_float(f): def serialize_int(as_str: bool): def serialize(i): - if is_optional_type(type(i)) and i is None: + # Optional[T] is a Union[T, None] + if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: return None if isinstance(i, Unset): return i @@ -96,29 +102,10 @@ def validate_int(b): return int(b) -def validate_open_enum(is_int: bool): - def validate(e): - if e is None: - return None - - if isinstance(e, Unset): - return e - - if is_int: - if not isinstance(e, int): - raise ValueError("Expected int") - else: - if not isinstance(e, str): - raise ValueError("Expected string") - - return e - - return validate - - def validate_const(v): def validate(c): - if is_optional_type(type(c)) and c is None: + # Optional[T] is a Union[T, None] + if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: return None if v != c: @@ -163,7 +150,7 @@ def marshal_json(val, typ): if len(d) == 0: return "" - return json.dumps(d[next(iter(d))], separators=(",", ":"), sort_keys=True) + return json.dumps(d[next(iter(d))], separators=(",", ":")) def is_nullable(field): @@ -181,6 +168,15 @@ def is_nullable(field): return False +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any( + obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") + ) + + def stream_to_text(stream: httpx.Response) -> str: return "".join(stream.iter_text()) @@ -213,3 +209,21 @@ def _contains_pydantic_model(data: Any) -> bool: return any(_contains_pydantic_model(value) for value in data.values()) return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/unmarshal_json_response.py b/sync-for-payables/src/codat_sync_for_payables/utils/unmarshal_json_response.py new file mode 100644 index 000000000..0394c9ff4 --- /dev/null +++ b/sync-for-payables/src/codat_sync_for_payables/utils/unmarshal_json_response.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, Optional, Type, TypeVar, overload + +import httpx + +from .serializers import unmarshal_json +from codat_sync_for_payables.models import errors + +T = TypeVar("T") + + +@overload +def unmarshal_json_response( + typ: Type[T], http_res: httpx.Response, body: Optional[str] = None +) -> T: ... + + +@overload +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: ... + + +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: + if body is None: + body = http_res.text + try: + return unmarshal_json(body, typ) + except Exception as e: + raise errors.ResponseValidationError( + "Response validation failed", + http_res, + e, + body, + ) from e diff --git a/sync-for-payables/src/codat_sync_for_payables/utils/values.py b/sync-for-payables/src/codat_sync_for_payables/utils/values.py index 2b4b68321..dae01a443 100644 --- a/sync-for-payables/src/codat_sync_for_payables/utils/values.py +++ b/sync-for-payables/src/codat_sync_for_payables/utils/values.py @@ -3,8 +3,9 @@ from datetime import datetime from enum import Enum from email.message import Message +from functools import partial import os -from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast from httpx import Response from pydantic import BaseModel @@ -51,6 +52,8 @@ def match_status_codes(status_codes: List[str], status_code: int) -> bool: T = TypeVar("T") +def cast_partial(typ): + return partial(cast, typ) def get_global_from_env( value: Optional[T], env_key: str, type_cast: Callable[[str], T]