diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d8fd3bb54..9a19cf072 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.446.1 +speakeasyVersion: 1.447.0 sources: accounting-source: sourceNamespace: accounting-source @@ -73,6 +73,14 @@ sources: - latest - speakeasy-sdk-regen-1732635208 - "1.1" + sync-for-expenses-source: + sourceNamespace: sync-for-expenses-source + sourceRevisionDigest: sha256:41e2e01d05c1e741182977bc257561fbf22e7d1e144dc86afa13000cc0d713d9 + sourceBlobDigest: sha256:abe56a70fc7e5c5883c7e8a6bef59d69ceb2dc4eddbb3106ae06b6c5acb38408 + tags: + - latest + - speakeasy-sdk-regen-1732638431 + - prealpha sync-for-payables-source: sourceNamespace: sync-for-payables-source sourceRevisionDigest: sha256:9b7390685375f6bb8f444cfdaef0cf211fe30a63abac80c98d441203bd76d654 @@ -146,6 +154,13 @@ targets: sourceBlobDigest: sha256:1d1592cd53dae647bff1e58e43cb64f19f9da714cfc6f6198c43659b89b05369 codeSamplesNamespace: sync-for-commerce-source-code-samples codeSamplesRevisionDigest: sha256:3b9ecd425a767a3ec537a2496260b5f66bcc810311faa362630aecb65f6c8367 + sync-for-expenses-library: + source: sync-for-expenses-source + sourceNamespace: sync-for-expenses-source + sourceRevisionDigest: sha256:41e2e01d05c1e741182977bc257561fbf22e7d1e144dc86afa13000cc0d713d9 + sourceBlobDigest: sha256:abe56a70fc7e5c5883c7e8a6bef59d69ceb2dc4eddbb3106ae06b6c5acb38408 + codeSamplesNamespace: sync-for-expenses-source-code-samples + codeSamplesRevisionDigest: sha256:e6d7dcebdfe01aa1632ae52a84b8845df637387eab47239f688b8c827b10045b sync-for-payables-library: source: sync-for-payables-source sourceNamespace: sync-for-payables-source diff --git a/sync-for-expenses/.gitignore b/sync-for-expenses/.gitignore index 8ac3f51d4..f49ed9610 100755 --- a/sync-for-expenses/.gitignore +++ b/sync-for-expenses/.gitignore @@ -1,3 +1,6 @@ +.venv/ +pyrightconfig.json +README-PYPI.md .python-version .DS_Store venv/ diff --git a/sync-for-expenses/.speakeasy/gen.lock b/sync-for-expenses/.speakeasy/gen.lock index 504013592..f4e11363d 100755 --- a/sync-for-expenses/.speakeasy/gen.lock +++ b/sync-for-expenses/.speakeasy/gen.lock @@ -1,445 +1,2270 @@ lockVersion: 2.0.0 id: a2c830ee-4f93-4e8e-8f01-48d0991317f5 management: - docChecksum: b84c137b488c9aa6b56fa6e53acdf2cc + docChecksum: c99953b67f6a5e5522a0340e273decdb docVersion: prealpha - speakeasyVersion: 1.244.2 - generationVersion: 2.301.3 - releaseVersion: 6.2.0 - configChecksum: 459921fe135cf9813305705dbcdd4885 + speakeasyVersion: 1.447.0 + generationVersion: 2.463.0 + releaseVersion: 7.0.0 + configChecksum: 6f483801042fce2cb5d58c6bbeaa9ed1 repoURL: https://github.com/codatio/client-sdk-python.git repoSubDirectory: sync-for-expenses installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=sync-for-expenses published: true features: python: - constsAndDefaults: 0.1.3 - core: 4.6.4 - decimal: 0.1.0 - deprecations: 2.81.1 - examples: 2.81.3 - globalSecurity: 2.83.5 - globalServerURLs: 2.82.2 - inputOutputModels: 2.83.1 - nameOverrides: 2.81.2 - responseFormat: 0.1.0 - retries: 2.82.1 - webhooks: 1.0.0 + additionalDependencies: 1.0.0 + constsAndDefaults: 1.0.5 + core: 5.6.8 + decimal: 1.0.0 + defaultEnabledRetries: 0.2.0 + deprecations: 3.0.0 + enumUnions: 0.1.0 + envVarSecurityUsage: 0.3.2 + examples: 3.0.0 + globalSecurity: 3.0.2 + globalSecurityCallbacks: 1.0.0 + globalServerURLs: 3.0.0 + inputOutputModels: 3.0.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 + serverEventsSentinels: 0.1.0 + uploadStreams: 1.0.0 + webhooks: 2.0.0 generatedFiles: - - src/codatsyncexpenses/sdkconfiguration.py - - src/codatsyncexpenses/companies.py - - src/codatsyncexpenses/connections.py - - src/codatsyncexpenses/accounts.py - - src/codatsyncexpenses/customers.py - - src/codatsyncexpenses/suppliers.py - - src/codatsyncexpenses/manage_data.py - - src/codatsyncexpenses/push_operations.py - - src/codatsyncexpenses/configuration.py - - src/codatsyncexpenses/expenses.py - - src/codatsyncexpenses/reimbursements.py - - src/codatsyncexpenses/sync.py - - src/codatsyncexpenses/transaction_status.py - - src/codatsyncexpenses/attachments.py - - src/codatsyncexpenses/transfers.py - - src/codatsyncexpenses/sdk.py - - py.typed - - pylintrc - - setup.py - - src/codatsyncexpenses/__init__.py - - src/codatsyncexpenses/utils/__init__.py - - src/codatsyncexpenses/utils/retries.py - - src/codatsyncexpenses/utils/utils.py - - src/codatsyncexpenses/models/errors/sdkerror.py - - tests/helpers.py - - src/codatsyncexpenses/models/operations/create_company.py - - src/codatsyncexpenses/models/operations/delete_company.py - - src/codatsyncexpenses/models/operations/get_company.py - - src/codatsyncexpenses/models/operations/list_companies.py - - src/codatsyncexpenses/models/operations/update_company.py - - src/codatsyncexpenses/models/operations/create_connection.py - - src/codatsyncexpenses/models/operations/create_partner_expense_connection.py - - src/codatsyncexpenses/models/operations/delete_connection.py - - src/codatsyncexpenses/models/operations/get_connection.py - - src/codatsyncexpenses/models/operations/list_connections.py - - src/codatsyncexpenses/models/operations/unlink_connection.py - - src/codatsyncexpenses/models/operations/create_account.py - - src/codatsyncexpenses/models/operations/get_create_chartofaccounts_model.py - - src/codatsyncexpenses/models/operations/create_customer.py - - src/codatsyncexpenses/models/operations/get_customer.py - - src/codatsyncexpenses/models/operations/list_customers.py - - src/codatsyncexpenses/models/operations/update_customer.py - - src/codatsyncexpenses/models/operations/create_supplier.py - - src/codatsyncexpenses/models/operations/get_supplier.py - - src/codatsyncexpenses/models/operations/list_suppliers.py - - src/codatsyncexpenses/models/operations/update_supplier.py - - src/codatsyncexpenses/models/operations/get_data_status.py - - src/codatsyncexpenses/models/operations/get_pull_operation.py - - src/codatsyncexpenses/models/operations/list_pull_operations.py - - src/codatsyncexpenses/models/operations/refresh_all_data_types.py - - src/codatsyncexpenses/models/operations/refresh_data_type.py - - src/codatsyncexpenses/models/operations/get_push_operation.py - - src/codatsyncexpenses/models/operations/list_push_operations.py - - src/codatsyncexpenses/models/operations/get_company_configuration.py - - src/codatsyncexpenses/models/operations/get_mapping_options.py - - src/codatsyncexpenses/models/operations/set_company_configuration.py - - src/codatsyncexpenses/models/operations/create_expense_transaction.py - - src/codatsyncexpenses/models/operations/update_expense_transaction.py - - src/codatsyncexpenses/models/operations/create_reimbursable_expense_transaction.py - - src/codatsyncexpenses/models/operations/update_reimbursable_expense_transaction.py - - src/codatsyncexpenses/models/operations/get_sync_by_id.py - - src/codatsyncexpenses/models/operations/get_last_successful_sync.py - - src/codatsyncexpenses/models/operations/get_latest_sync.py - - src/codatsyncexpenses/models/operations/initiate_sync.py - - src/codatsyncexpenses/models/operations/list_syncs.py - - src/codatsyncexpenses/models/operations/get_sync_transaction.py - - src/codatsyncexpenses/models/operations/list_sync_transactions.py - - src/codatsyncexpenses/models/operations/upload_expense_attachment.py - - src/codatsyncexpenses/models/operations/create_transfer_transaction.py - - src/codatsyncexpenses/models/shared/company.py - - src/codatsyncexpenses/models/shared/connection.py - - src/codatsyncexpenses/models/shared/dataconnectionstatus.py - - src/codatsyncexpenses/models/shared/dataconnectionerror.py - - src/codatsyncexpenses/models/shared/errorvalidation.py - - src/codatsyncexpenses/models/shared/errorvalidationitem.py - - src/codatsyncexpenses/models/shared/companyrequestbody.py - - src/codatsyncexpenses/models/shared/group_items.py - - src/codatsyncexpenses/models/shared/companies.py - - src/codatsyncexpenses/models/shared/links.py - - src/codatsyncexpenses/models/shared/halref.py - - src/codatsyncexpenses/models/shared/connections.py - - src/codatsyncexpenses/models/shared/createaccountresponse.py - - src/codatsyncexpenses/models/shared/validation.py - - src/codatsyncexpenses/models/shared/validationitem.py - - src/codatsyncexpenses/models/shared/pushoperationstatus.py - - src/codatsyncexpenses/models/shared/datatype.py - - src/codatsyncexpenses/models/shared/accounttype.py - - src/codatsyncexpenses/models/shared/supplementaldata.py - - src/codatsyncexpenses/models/shared/accountstatus.py - - src/codatsyncexpenses/models/shared/pushoperationchange.py - - src/codatsyncexpenses/models/shared/pushchangetype.py - - src/codatsyncexpenses/models/shared/pushoperationref.py - - src/codatsyncexpenses/models/shared/accountprototype.py - - src/codatsyncexpenses/models/shared/pushoption.py - - src/codatsyncexpenses/models/shared/pushvalidationinfo.py - - src/codatsyncexpenses/models/shared/pushfieldvalidation.py - - src/codatsyncexpenses/models/shared/pushoptiontype.py - - src/codatsyncexpenses/models/shared/pushoptionproperty.py - - src/codatsyncexpenses/models/shared/pushoptionchoice.py - - src/codatsyncexpenses/models/shared/createcustomerresponse.py - - src/codatsyncexpenses/models/shared/customerstatus.py - - src/codatsyncexpenses/models/shared/metadata.py - - src/codatsyncexpenses/models/shared/contact.py - - src/codatsyncexpenses/models/shared/phonenumbertype.py - - src/codatsyncexpenses/models/shared/items.py - - src/codatsyncexpenses/models/shared/accountingaddresstype.py - - src/codatsyncexpenses/models/shared/customer.py - - src/codatsyncexpenses/models/shared/customers.py - - src/codatsyncexpenses/models/shared/updatecustomerresponse.py - - src/codatsyncexpenses/models/shared/createsupplierresponse.py - - src/codatsyncexpenses/models/shared/supplierstatus.py - - src/codatsyncexpenses/models/shared/supplier.py - - src/codatsyncexpenses/models/shared/suppliers.py - - src/codatsyncexpenses/models/shared/updatesupplierresponse.py - - src/codatsyncexpenses/models/shared/datastatus.py - - src/codatsyncexpenses/models/shared/pulloperation.py - - src/codatsyncexpenses/models/shared/pulloperations.py - - src/codatsyncexpenses/models/shared/schema_datatype.py - - src/codatsyncexpenses/models/shared/pushoperation.py - - src/codatsyncexpenses/models/shared/pushoperations.py - - src/codatsyncexpenses/models/shared/companyconfiguration.py - - src/codatsyncexpenses/models/shared/supplierdetails.py - - src/codatsyncexpenses/models/shared/customerdetails.py - - src/codatsyncexpenses/models/shared/bankaccount.py - - src/codatsyncexpenses/models/shared/mappingoptions.py - - src/codatsyncexpenses/models/shared/trackingcategorymappinginfo.py - - src/codatsyncexpenses/models/shared/taxratemappinginfo.py - - src/codatsyncexpenses/models/shared/accountmappinginfo.py - - src/codatsyncexpenses/models/shared/createexpenseresponse.py - - src/codatsyncexpenses/models/shared/createexpenserequest.py - - src/codatsyncexpenses/models/shared/expensetransaction.py - - src/codatsyncexpenses/models/shared/expensetransactionline.py - - src/codatsyncexpenses/models/shared/trackingref.py - - src/codatsyncexpenses/models/shared/recordref.py - - src/codatsyncexpenses/models/shared/invoiceto.py - - src/codatsyncexpenses/models/shared/contactref.py - - src/codatsyncexpenses/models/shared/updateexpenseresponse.py - - src/codatsyncexpenses/models/shared/updateexpenserequest.py - - src/codatsyncexpenses/models/shared/createreimbursableexpenseresponse.py - - src/codatsyncexpenses/models/shared/createreimbursableexpenserequest.py - - src/codatsyncexpenses/models/shared/reimbursableexpensetransaction.py - - src/codatsyncexpenses/models/shared/reimbursableexpensetransactionline.py - - src/codatsyncexpenses/models/shared/companysyncstatus.py - - src/codatsyncexpenses/models/shared/syncinitiated.py - - src/codatsyncexpenses/models/shared/initiatesync.py - - src/codatsyncexpenses/models/shared/transaction.py - - src/codatsyncexpenses/models/shared/transactionstatus.py - - src/codatsyncexpenses/models/shared/integrationtype.py - - src/codatsyncexpenses/models/shared/transactions.py - - src/codatsyncexpenses/models/shared/attachment.py - - src/codatsyncexpenses/models/shared/attachmentupload.py - - src/codatsyncexpenses/models/shared/codatfile.py - - src/codatsyncexpenses/models/shared/createtransferresponse.py - - src/codatsyncexpenses/models/shared/createtransferrequest.py - - src/codatsyncexpenses/models/shared/transferdetails.py - - src/codatsyncexpenses/models/shared/accountref.py - - src/codatsyncexpenses/models/shared/security.py - - src/codatsyncexpenses/models/shared/clientratelimitreachedwebhook.py - - src/codatsyncexpenses/models/shared/clientratelimitreachedwebhookdata.py - - src/codatsyncexpenses/models/shared/clientratelimitresetwebhook.py - - src/codatsyncexpenses/models/shared/clientratelimitresetwebhookdata.py - - src/codatsyncexpenses/models/shared/synccompletewebhook.py - - src/codatsyncexpenses/models/shared/synccompletewebhookdata.py - - src/codatsyncexpenses/models/shared/syncfailedwebhook.py - - src/codatsyncexpenses/models/shared/syncfailedwebhookdata.py - - src/codatsyncexpenses/models/shared/syncstartedwebhook.py - - src/codatsyncexpenses/models/errors/errormessage.py - - src/codatsyncexpenses/models/webhooks/client_rate_limit_reached.py - - src/codatsyncexpenses/models/webhooks/client_rate_limit_reset.py - - src/codatsyncexpenses/models/webhooks/sync_complete.py - - src/codatsyncexpenses/models/webhooks/sync_failed.py - - src/codatsyncexpenses/models/webhooks/sync_started.py - - src/codatsyncexpenses/models/__init__.py - - src/codatsyncexpenses/models/errors/__init__.py - - src/codatsyncexpenses/models/operations/__init__.py - - src/codatsyncexpenses/models/shared/__init__.py - - src/codatsyncexpenses/models/webhooks/__init__.py - - docs/models/operations/createcompanyresponse.md - - docs/models/operations/deletecompanyrequest.md - - docs/models/operations/deletecompanyresponse.md - - docs/models/operations/getcompanyrequest.md - - docs/models/operations/getcompanyresponse.md - - docs/models/operations/listcompaniesrequest.md - - docs/models/operations/listcompaniesresponse.md - - docs/models/operations/updatecompanyrequest.md - - docs/models/operations/updatecompanyresponse.md - - docs/models/operations/createconnectionrequestbody.md + - .gitattributes + - .python-version + - .vscode/settings.json + - CONTRIBUTING.md + - USAGE.md + - docs/models/errors/errormessage.md + - docs/models/operations/createaccountrequest.md + - docs/models/operations/createadjustmenttransactionrequest.md + - docs/models/operations/createbankaccountrequest.md - docs/models/operations/createconnectionrequest.md - - docs/models/operations/createconnectionresponse.md + - docs/models/operations/createconnectionrequestbody.md + - docs/models/operations/createcustomerrequest.md + - docs/models/operations/createexpensetransactionrequest.md - docs/models/operations/createpartnerexpenseconnectionrequest.md - - docs/models/operations/createpartnerexpenseconnectionresponse.md + - docs/models/operations/createreimbursableexpensetransactionrequest.md + - docs/models/operations/createsupplierrequest.md + - docs/models/operations/createtransfertransactionrequest.md + - docs/models/operations/deletecompanyrequest.md - docs/models/operations/deleteconnectionrequest.md - - docs/models/operations/deleteconnectionresponse.md + - docs/models/operations/getcompanyconfigurationrequest.md + - docs/models/operations/getcompanyinforequest.md + - docs/models/operations/getcompanyrequest.md - docs/models/operations/getconnectionrequest.md - - docs/models/operations/getconnectionresponse.md - - docs/models/operations/listconnectionsrequest.md - - docs/models/operations/listconnectionsresponse.md - - docs/models/operations/unlinkconnectionupdateconnection.md - - docs/models/operations/unlinkconnectionrequest.md - - docs/models/operations/unlinkconnectionresponse.md - - docs/models/operations/createaccountrequest.md - - docs/models/operations/createaccountresponse.md + - docs/models/operations/getcreatebankaccountsmodelrequest.md - docs/models/operations/getcreatechartofaccountsmodelrequest.md - - docs/models/operations/getcreatechartofaccountsmodelresponse.md - - docs/models/operations/createcustomerrequest.md - - docs/models/operations/createcustomerresponse.md - docs/models/operations/getcustomerrequest.md - - docs/models/operations/getcustomerresponse.md - - docs/models/operations/listcustomersrequest.md - - docs/models/operations/listcustomersresponse.md - - docs/models/operations/updatecustomerrequest.md - - docs/models/operations/updatecustomerresponse.md - - docs/models/operations/createsupplierrequest.md - - docs/models/operations/createsupplierresponse.md - - docs/models/operations/getsupplierrequest.md - - docs/models/operations/getsupplierresponse.md - - docs/models/operations/listsuppliersrequest.md - - docs/models/operations/listsuppliersresponse.md - - docs/models/operations/updatesupplierrequest.md - - docs/models/operations/updatesupplierresponse.md + - docs/models/operations/getdatastatusdatastatuses.md - docs/models/operations/getdatastatusrequest.md - - docs/models/operations/getdatastatusresponse.md + - docs/models/operations/getlastsuccessfulsyncrequest.md + - docs/models/operations/getlatestsyncrequest.md + - docs/models/operations/getmappingoptionsrequest.md - docs/models/operations/getpulloperationrequest.md - - docs/models/operations/getpulloperationresponse.md + - docs/models/operations/getpushoperationrequest.md + - docs/models/operations/getsupplierrequest.md + - docs/models/operations/getsyncbyidrequest.md + - docs/models/operations/getsynctransactionrequest.md + - docs/models/operations/listcompaniesrequest.md + - docs/models/operations/listconnectionsrequest.md + - docs/models/operations/listcustomersrequest.md - docs/models/operations/listpulloperationsrequest.md - - docs/models/operations/listpulloperationsresponse.md + - docs/models/operations/listpushoperationsrequest.md + - docs/models/operations/listsuppliersrequest.md + - docs/models/operations/listsyncsrequest.md + - docs/models/operations/listsynctransactionsrequest.md - docs/models/operations/refreshalldatatypesrequest.md - - docs/models/operations/refreshalldatatypesresponse.md - docs/models/operations/refreshdatatyperequest.md - - docs/models/operations/refreshdatatyperesponse.md - - docs/models/operations/getpushoperationrequest.md - - docs/models/operations/getpushoperationresponse.md - - docs/models/operations/listpushoperationsrequest.md - - docs/models/operations/listpushoperationsresponse.md - - docs/models/operations/getcompanyconfigurationrequest.md - - docs/models/operations/getcompanyconfigurationresponse.md - - docs/models/operations/getmappingoptionsrequest.md - - docs/models/operations/getmappingoptionsresponse.md - docs/models/operations/setcompanyconfigurationrequest.md - - docs/models/operations/setcompanyconfigurationresponse.md - - docs/models/operations/createexpensetransactionrequest.md - - docs/models/operations/createexpensetransactionresponse.md + - docs/models/operations/unlinkconnectionrequest.md + - docs/models/operations/unlinkconnectionupdateconnection.md + - docs/models/operations/updatecompanyrequest.md + - docs/models/operations/updatecustomerrequest.md - docs/models/operations/updateexpensetransactionrequest.md - - docs/models/operations/updateexpensetransactionresponse.md - - docs/models/operations/createreimbursableexpensetransactionrequest.md - - docs/models/operations/createreimbursableexpensetransactionresponse.md - docs/models/operations/updatereimbursableexpensetransactionrequest.md - - docs/models/operations/updatereimbursableexpensetransactionresponse.md - - docs/models/operations/getsyncbyidrequest.md - - docs/models/operations/getsyncbyidresponse.md - - docs/models/operations/getlastsuccessfulsyncrequest.md - - docs/models/operations/getlastsuccessfulsyncresponse.md - - docs/models/operations/getlatestsyncrequest.md - - docs/models/operations/getlatestsyncresponse.md - - docs/models/operations/initiatesyncrequest.md - - docs/models/operations/initiatesyncresponse.md - - docs/models/operations/listsyncsrequest.md - - docs/models/operations/listsyncsresponse.md - - docs/models/operations/getsynctransactionrequest.md - - docs/models/operations/getsynctransactionresponse.md - - docs/models/operations/listsynctransactionsrequest.md - - docs/models/operations/listsynctransactionsresponse.md + - docs/models/operations/updatesupplierrequest.md - docs/models/operations/uploadexpenseattachmentrequest.md - - docs/models/operations/uploadexpenseattachmentresponse.md - - docs/models/operations/createtransfertransactionrequest.md - - docs/models/operations/createtransfertransactionresponse.md - - docs/models/shared/groupreference.md + - docs/models/shared/accountingaccount.md + - docs/models/shared/accountingaddress.md + - docs/models/shared/accountingaddresstype.md + - docs/models/shared/accountingbankaccount.md + - docs/models/shared/accountingcustomer.md + - docs/models/shared/accountingsupplier.md + - docs/models/shared/accountmappinginfo.md + - docs/models/shared/accountmappinginfoaccounttype.md + - docs/models/shared/accountprototype.md + - docs/models/shared/accountreference.md + - docs/models/shared/accountstatus.md + - docs/models/shared/accounttype.md + - docs/models/shared/adjustmenttransactionline.md + - docs/models/shared/adjustmenttransactionrequest.md + - docs/models/shared/adjustmenttransactionresponse.md + - docs/models/shared/apaccountref.md + - docs/models/shared/attachment.md + - docs/models/shared/attachmentupload.md + - docs/models/shared/bankaccount.md + - docs/models/shared/bankaccountdetails.md + - docs/models/shared/bankaccountreference.md + - docs/models/shared/bankaccountstatus.md + - docs/models/shared/bankaccounttype.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/sourcetype.md - - docs/models/shared/connection.md - - docs/models/shared/dataconnectionstatus.md - - docs/models/shared/dataconnectionerror.md - - docs/models/shared/errorvalidation.md - - docs/models/shared/errorvalidationitem.md + - docs/models/shared/companyconfiguration.md + - docs/models/shared/companyinformation.md + - docs/models/shared/companyinformationtype.md + - docs/models/shared/companyreference.md + - docs/models/shared/companyreferencelinks.md - docs/models/shared/companyrequestbody.md - - docs/models/shared/groupitems.md - - docs/models/shared/companies.md - - docs/models/shared/links.md - - docs/models/shared/halref.md + - docs/models/shared/companysyncstatus.md + - docs/models/shared/connection.md - docs/models/shared/connections.md + - docs/models/shared/contact.md + - docs/models/shared/createaccountresponse.md - docs/models/shared/createaccountresponsemetadata.md - docs/models/shared/createaccountresponsevaliddatatypelinks.md - - docs/models/shared/accountingaccount.md - - docs/models/shared/createaccountresponse.md - - docs/models/shared/validation.md - - docs/models/shared/validationitem.md - - docs/models/shared/pushoperationstatus.md - - docs/models/shared/datatype.md - - docs/models/shared/accounttype.md - - docs/models/shared/supplementaldata.md - - docs/models/shared/accountstatus.md - - docs/models/shared/pushoperationchange.md - - docs/models/shared/pushchangetype.md - - docs/models/shared/pushoperationref.md - - docs/models/shared/validdatatypelinks.md - - docs/models/shared/accountprototype.md - - docs/models/shared/pushoption.md - - docs/models/shared/pushvalidationinfo.md - - docs/models/shared/pushfieldvalidation.md - - docs/models/shared/pushoptiontype.md - - docs/models/shared/pushoptionproperty.md - - docs/models/shared/pushoptionchoice.md - - docs/models/shared/createcustomerresponseaccountingaddress.md - - docs/models/shared/accountingcustomer.md + - docs/models/shared/createbankaccountresponse.md + - docs/models/shared/createbankaccountresponsebankaccounttype.md - docs/models/shared/createcustomerresponse.md + - docs/models/shared/createexpenseresponse.md + - docs/models/shared/createreimbursableexpenseresponse.md + - docs/models/shared/createsupplierresponse.md + - docs/models/shared/customer.md + - docs/models/shared/customerdetails.md + - docs/models/shared/customers.md - docs/models/shared/customerstatus.md + - docs/models/shared/dataconnectionerror.md + - docs/models/shared/dataconnectionstatus.md + - docs/models/shared/datasetstatus.md + - docs/models/shared/datastatus.md + - docs/models/shared/datatype.md + - docs/models/shared/datatypes.md + - docs/models/shared/errorstatus.md + - docs/models/shared/errorvalidation.md + - docs/models/shared/errorvalidationitem.md + - docs/models/shared/expensecontactref.md + - docs/models/shared/expensessyncwebhook.md + - docs/models/shared/expensessyncwebhookpayload.md + - docs/models/shared/expensetransaction.md + - docs/models/shared/expensetransactionline.md + - docs/models/shared/expensetransactiontype.md + - docs/models/shared/from_.md + - docs/models/shared/halref.md + - docs/models/shared/integrationtype.md + - docs/models/shared/invoiceto.md + - docs/models/shared/invoicetotype.md + - docs/models/shared/itemref.md + - docs/models/shared/items.md + - docs/models/shared/links.md + - docs/models/shared/mappingoptions.md - docs/models/shared/metadata.md - docs/models/shared/phone.md - - docs/models/shared/contact.md + - docs/models/shared/phonenumberitems.md - docs/models/shared/phonenumbertype.md - - docs/models/shared/items.md - - docs/models/shared/accountingaddresstype.md - - docs/models/shared/accountingaddress.md - - docs/models/shared/customer.md - - docs/models/shared/customers.md - - docs/models/shared/updatecustomerresponseaccountingaddress.md - - docs/models/shared/updatecustomerresponseaccountingcustomer.md - - docs/models/shared/updatecustomerresponse.md - - docs/models/shared/accountingsupplier.md - - docs/models/shared/createsupplierresponse.md - - docs/models/shared/supplierstatus.md - - docs/models/shared/supplier.md - - docs/models/shared/suppliers.md - - docs/models/shared/updatesupplierresponseaccountingsupplier.md - - docs/models/shared/updatesupplierresponse.md - - docs/models/shared/datatypes.md - - docs/models/shared/datastatus.md - - docs/models/shared/status.md - docs/models/shared/pulloperation.md - docs/models/shared/pulloperations.md - - docs/models/shared/schemadatatype.md + - docs/models/shared/pushchangetype.md + - docs/models/shared/pushfieldvalidation.md - docs/models/shared/pushoperation.md + - docs/models/shared/pushoperationchange.md + - docs/models/shared/pushoperationref.md - docs/models/shared/pushoperations.md - - docs/models/shared/companyconfiguration.md - - docs/models/shared/supplierdetails.md - - docs/models/shared/customerdetails.md - - docs/models/shared/bankaccount.md - - docs/models/shared/mappingoptions.md - - docs/models/shared/trackingcategorymappinginfo.md - - docs/models/shared/taxratemappinginfovalidtransactiontypes.md - - docs/models/shared/taxratemappinginfo.md - - docs/models/shared/accountmappinginfoaccounttype.md - - docs/models/shared/validtransactiontypes.md - - docs/models/shared/accountmappinginfo.md - - docs/models/shared/createexpenseresponse.md - - docs/models/shared/createexpenserequest.md - - docs/models/shared/expensetransactionbankaccountreference.md - - docs/models/shared/expensetransactiontype.md - - docs/models/shared/expensetransaction.md - - docs/models/shared/expensetransactionline.md - - docs/models/shared/trackingrefdatatype.md - - docs/models/shared/trackingref.md + - docs/models/shared/pushoperationstatus.md + - docs/models/shared/pushoption.md + - docs/models/shared/pushoptionchoice.md + - docs/models/shared/pushoptionproperty.md + - docs/models/shared/pushoptiontype.md + - docs/models/shared/pushvalidationinfo.md - docs/models/shared/recordref.md - - docs/models/shared/invoicetodatatype.md - - docs/models/shared/invoiceto.md - - docs/models/shared/type.md - - docs/models/shared/contactref.md - - docs/models/shared/updateexpenseresponse.md - - docs/models/shared/updateexpenserequestbankaccountreference.md - - docs/models/shared/updateexpenserequest.md - - docs/models/shared/createreimbursableexpenseresponse.md - - docs/models/shared/createreimbursableexpenserequest.md - - docs/models/shared/bankaccountreference.md - docs/models/shared/reimbursableexpensetransaction.md - docs/models/shared/reimbursableexpensetransactionline.md - - docs/models/shared/companysyncstatus.md - - docs/models/shared/syncinitiated.md - - docs/models/shared/initiatesync.md - - docs/models/shared/transaction.md - - docs/models/shared/transactionstatus.md - - docs/models/shared/integrationtype.md - - docs/models/shared/transactions.md - - docs/models/shared/attachment.md - - docs/models/shared/attachmentupload.md - - docs/models/shared/codatfile.md - - docs/models/shared/createtransferresponse.md - - docs/models/shared/createtransferrequest.md - - docs/models/shared/transferdetails.md - - docs/models/shared/accountref.md + - docs/models/shared/reimbursementcontactref.md + - docs/models/shared/schemadatatype.md + - docs/models/shared/schematransaction.md - docs/models/shared/security.md - - docs/models/shared/clientratelimitreachedwebhook.md - - docs/models/shared/clientratelimitreachedwebhookdata.md - - docs/models/shared/clientratelimitresetwebhook.md - - docs/models/shared/clientratelimitresetwebhookdata.md + - docs/models/shared/sourcetype.md + - docs/models/shared/status.md + - docs/models/shared/supplementaldata.md + - docs/models/shared/supplier.md + - docs/models/shared/supplierdetails.md + - docs/models/shared/suppliers.md + - docs/models/shared/supplierstatus.md - docs/models/shared/synccompletewebhook.md - docs/models/shared/synccompletewebhookdata.md - docs/models/shared/syncfailedwebhook.md - docs/models/shared/syncfailedwebhookdata.md - - docs/models/shared/data.md - - docs/models/shared/syncstartedwebhook.md - - docs/models/errors/errormessage.md - - docs/models/webhooks/clientratelimitreachedresponse.md - - docs/models/webhooks/clientratelimitresetresponse.md - - docs/models/webhooks/synccompleteresponse.md - - docs/models/webhooks/syncfailedresponse.md - - docs/models/webhooks/syncstartedresponse.md - - docs/sdks/codatsyncexpenses/README.md + - docs/models/shared/taxratemappinginfo.md + - docs/models/shared/to.md + - docs/models/shared/trackingcategorymappinginfo.md + - docs/models/shared/trackingref.md + - docs/models/shared/trackingrefadjustmenttransaction.md + - docs/models/shared/trackingrefadjustmenttransactiondatatype.md + - docs/models/shared/trackingrefdatatype.md + - docs/models/shared/transaction.md + - docs/models/shared/transactiondefinitionsstatus.md + - docs/models/shared/transactions.md + - docs/models/shared/transactionstatus.md + - docs/models/shared/transfertransactionrequest.md + - docs/models/shared/transfertransactionrequestaccountreference.md + - docs/models/shared/transfertransactionresponse.md + - docs/models/shared/type.md + - docs/models/shared/updatecustomerresponse.md + - docs/models/shared/updatecustomerresponseaccountingcustomer.md + - docs/models/shared/updateexpenserequest.md + - docs/models/shared/updateexpenserequestbankaccountreference.md + - docs/models/shared/updateexpenserequesttype.md + - docs/models/shared/updateexpenseresponse.md + - docs/models/shared/updatereimbursableexpensetransactionrequest.md + - docs/models/shared/updatesupplierresponse.md + - docs/models/shared/updatesupplierresponseaccountingsupplier.md + - docs/models/shared/validation.md + - docs/models/shared/validationitem.md + - docs/models/shared/validdatatypelinks.md + - docs/models/shared/validfor.md + - docs/models/shared/validtransactiontypes.md + - docs/models/shared/weblink.md - docs/models/utils/retryconfig.md + - docs/sdks/accounts/README.md + - docs/sdks/adjustments/README.md + - docs/sdks/attachments/README.md + - docs/sdks/bankaccounts/README.md + - docs/sdks/codatsyncexpenses/README.md - docs/sdks/companies/README.md + - docs/sdks/companyinfo/README.md + - docs/sdks/configuration/README.md - docs/sdks/connections/README.md - - docs/sdks/accounts/README.md - docs/sdks/customers/README.md - - docs/sdks/suppliers/README.md + - docs/sdks/expenses/README.md - docs/sdks/managedata/README.md + - docs/sdks/mappingoptions/README.md - docs/sdks/pushoperations/README.md - - docs/sdks/configuration/README.md - - docs/sdks/expenses/README.md - docs/sdks/reimbursements/README.md + - docs/sdks/suppliers/README.md - docs/sdks/sync/README.md - docs/sdks/transactionstatus/README.md - - docs/sdks/attachments/README.md - docs/sdks/transfers/README.md - - USAGE.md - - .gitattributes - - src/codatsyncexpenses/_hooks/sdkhooks.py - - src/codatsyncexpenses/_hooks/types.py - - src/codatsyncexpenses/_hooks/__init__.py + - poetry.toml + - py.typed + - pylintrc + - pyproject.toml + - scripts/prepare-readme.py + - scripts/publish.sh + - src/codat_sync_for_expenses/__init__.py + - src/codat_sync_for_expenses/_hooks/__init__.py + - src/codat_sync_for_expenses/_hooks/sdkhooks.py + - src/codat_sync_for_expenses/_hooks/types.py + - src/codat_sync_for_expenses/_version.py + - src/codat_sync_for_expenses/accounts.py + - src/codat_sync_for_expenses/adjustments.py + - src/codat_sync_for_expenses/attachments.py + - src/codat_sync_for_expenses/bank_accounts.py + - src/codat_sync_for_expenses/basesdk.py + - src/codat_sync_for_expenses/companies.py + - src/codat_sync_for_expenses/company_info.py + - src/codat_sync_for_expenses/configuration.py + - src/codat_sync_for_expenses/connections.py + - src/codat_sync_for_expenses/customers.py + - src/codat_sync_for_expenses/expenses.py + - src/codat_sync_for_expenses/httpclient.py + - src/codat_sync_for_expenses/manage_data.py + - src/codat_sync_for_expenses/mapping_options.py + - src/codat_sync_for_expenses/models/errors/__init__.py + - src/codat_sync_for_expenses/models/errors/errormessage.py + - src/codat_sync_for_expenses/models/errors/sdkerror.py + - src/codat_sync_for_expenses/models/operations/__init__.py + - src/codat_sync_for_expenses/models/operations/create_account.py + - src/codat_sync_for_expenses/models/operations/create_adjustment_transaction.py + - src/codat_sync_for_expenses/models/operations/create_bank_account.py + - src/codat_sync_for_expenses/models/operations/create_connection.py + - src/codat_sync_for_expenses/models/operations/create_customer.py + - src/codat_sync_for_expenses/models/operations/create_expense_transaction.py + - src/codat_sync_for_expenses/models/operations/create_partner_expense_connection.py + - src/codat_sync_for_expenses/models/operations/create_reimbursable_expense_transaction.py + - src/codat_sync_for_expenses/models/operations/create_supplier.py + - src/codat_sync_for_expenses/models/operations/create_transfer_transaction.py + - src/codat_sync_for_expenses/models/operations/delete_company.py + - src/codat_sync_for_expenses/models/operations/delete_connection.py + - src/codat_sync_for_expenses/models/operations/get_company.py + - src/codat_sync_for_expenses/models/operations/get_company_configuration.py + - src/codat_sync_for_expenses/models/operations/get_company_info.py + - src/codat_sync_for_expenses/models/operations/get_connection.py + - src/codat_sync_for_expenses/models/operations/get_create_bankaccounts_model.py + - src/codat_sync_for_expenses/models/operations/get_create_chartofaccounts_model.py + - src/codat_sync_for_expenses/models/operations/get_customer.py + - src/codat_sync_for_expenses/models/operations/get_data_status.py + - src/codat_sync_for_expenses/models/operations/get_last_successful_sync.py + - src/codat_sync_for_expenses/models/operations/get_latest_sync.py + - src/codat_sync_for_expenses/models/operations/get_mapping_options.py + - src/codat_sync_for_expenses/models/operations/get_pull_operation.py + - src/codat_sync_for_expenses/models/operations/get_push_operation.py + - src/codat_sync_for_expenses/models/operations/get_supplier.py + - src/codat_sync_for_expenses/models/operations/get_sync_by_id.py + - src/codat_sync_for_expenses/models/operations/get_sync_transaction.py + - src/codat_sync_for_expenses/models/operations/list_companies.py + - src/codat_sync_for_expenses/models/operations/list_connections.py + - src/codat_sync_for_expenses/models/operations/list_customers.py + - src/codat_sync_for_expenses/models/operations/list_pull_operations.py + - src/codat_sync_for_expenses/models/operations/list_push_operations.py + - src/codat_sync_for_expenses/models/operations/list_suppliers.py + - src/codat_sync_for_expenses/models/operations/list_sync_transactions.py + - src/codat_sync_for_expenses/models/operations/list_syncs.py + - src/codat_sync_for_expenses/models/operations/refresh_all_data_types.py + - src/codat_sync_for_expenses/models/operations/refresh_data_type.py + - src/codat_sync_for_expenses/models/operations/set_company_configuration.py + - src/codat_sync_for_expenses/models/operations/unlink_connection.py + - src/codat_sync_for_expenses/models/operations/update_company.py + - src/codat_sync_for_expenses/models/operations/update_customer.py + - src/codat_sync_for_expenses/models/operations/update_expense_transaction.py + - src/codat_sync_for_expenses/models/operations/update_reimbursable_expense_transaction.py + - src/codat_sync_for_expenses/models/operations/update_supplier.py + - src/codat_sync_for_expenses/models/operations/upload_expense_attachment.py + - src/codat_sync_for_expenses/models/shared/__init__.py + - src/codat_sync_for_expenses/models/shared/accountingaddresstype.py + - src/codat_sync_for_expenses/models/shared/accountmappinginfo.py + - src/codat_sync_for_expenses/models/shared/accountprototype.py + - src/codat_sync_for_expenses/models/shared/accountstatus.py + - src/codat_sync_for_expenses/models/shared/accounttype.py + - src/codat_sync_for_expenses/models/shared/adjustmenttransactionline.py + - src/codat_sync_for_expenses/models/shared/adjustmenttransactionrequest.py + - src/codat_sync_for_expenses/models/shared/adjustmenttransactionresponse.py + - src/codat_sync_for_expenses/models/shared/apaccountref.py + - src/codat_sync_for_expenses/models/shared/attachment.py + - src/codat_sync_for_expenses/models/shared/attachmentupload.py + - src/codat_sync_for_expenses/models/shared/bankaccount.py + - src/codat_sync_for_expenses/models/shared/bankaccountdetails.py + - src/codat_sync_for_expenses/models/shared/bankaccountstatus.py + - src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhook.py + - src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhookdata.py + - src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhook.py + - src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhookdata.py + - src/codat_sync_for_expenses/models/shared/clientratelimitwebhook.py + - src/codat_sync_for_expenses/models/shared/clientratelimitwebhookpayload.py + - src/codat_sync_for_expenses/models/shared/codatfile.py + - src/codat_sync_for_expenses/models/shared/companies.py + - src/codat_sync_for_expenses/models/shared/company.py + - src/codat_sync_for_expenses/models/shared/companyconfiguration.py + - src/codat_sync_for_expenses/models/shared/companyinformation.py + - src/codat_sync_for_expenses/models/shared/companyreference.py + - src/codat_sync_for_expenses/models/shared/companyrequestbody.py + - src/codat_sync_for_expenses/models/shared/companysyncstatus.py + - src/codat_sync_for_expenses/models/shared/connection.py + - src/codat_sync_for_expenses/models/shared/connections.py + - src/codat_sync_for_expenses/models/shared/contact.py + - src/codat_sync_for_expenses/models/shared/createaccountresponse.py + - src/codat_sync_for_expenses/models/shared/createbankaccountresponse.py + - src/codat_sync_for_expenses/models/shared/createcustomerresponse.py + - src/codat_sync_for_expenses/models/shared/createexpenseresponse.py + - src/codat_sync_for_expenses/models/shared/createreimbursableexpenseresponse.py + - src/codat_sync_for_expenses/models/shared/createsupplierresponse.py + - src/codat_sync_for_expenses/models/shared/customer.py + - src/codat_sync_for_expenses/models/shared/customerdetails.py + - src/codat_sync_for_expenses/models/shared/customers.py + - src/codat_sync_for_expenses/models/shared/customerstatus.py + - src/codat_sync_for_expenses/models/shared/dataconnectionerror.py + - src/codat_sync_for_expenses/models/shared/dataconnectionstatus.py + - src/codat_sync_for_expenses/models/shared/datastatus.py + - src/codat_sync_for_expenses/models/shared/datatype.py + - src/codat_sync_for_expenses/models/shared/errorvalidation.py + - src/codat_sync_for_expenses/models/shared/errorvalidationitem.py + - src/codat_sync_for_expenses/models/shared/expensecontactref.py + - src/codat_sync_for_expenses/models/shared/expensessyncwebhook.py + - src/codat_sync_for_expenses/models/shared/expensessyncwebhookpayload.py + - src/codat_sync_for_expenses/models/shared/expensetransaction.py + - src/codat_sync_for_expenses/models/shared/expensetransactionline.py + - src/codat_sync_for_expenses/models/shared/halref.py + - src/codat_sync_for_expenses/models/shared/integrationtype.py + - src/codat_sync_for_expenses/models/shared/invoiceto.py + - src/codat_sync_for_expenses/models/shared/itemref.py + - src/codat_sync_for_expenses/models/shared/items.py + - src/codat_sync_for_expenses/models/shared/links.py + - src/codat_sync_for_expenses/models/shared/mappingoptions.py + - src/codat_sync_for_expenses/models/shared/metadata.py + - src/codat_sync_for_expenses/models/shared/phonenumber_items.py + - src/codat_sync_for_expenses/models/shared/phonenumbertype.py + - src/codat_sync_for_expenses/models/shared/pulloperation.py + - src/codat_sync_for_expenses/models/shared/pulloperations.py + - src/codat_sync_for_expenses/models/shared/pushchangetype.py + - src/codat_sync_for_expenses/models/shared/pushfieldvalidation.py + - src/codat_sync_for_expenses/models/shared/pushoperation.py + - src/codat_sync_for_expenses/models/shared/pushoperationchange.py + - src/codat_sync_for_expenses/models/shared/pushoperationref.py + - src/codat_sync_for_expenses/models/shared/pushoperations.py + - src/codat_sync_for_expenses/models/shared/pushoperationstatus.py + - src/codat_sync_for_expenses/models/shared/pushoption.py + - src/codat_sync_for_expenses/models/shared/pushoptionchoice.py + - src/codat_sync_for_expenses/models/shared/pushoptionproperty.py + - src/codat_sync_for_expenses/models/shared/pushoptiontype.py + - src/codat_sync_for_expenses/models/shared/pushvalidationinfo.py + - src/codat_sync_for_expenses/models/shared/recordref.py + - src/codat_sync_for_expenses/models/shared/reimbursableexpensetransaction.py + - src/codat_sync_for_expenses/models/shared/reimbursableexpensetransactionline.py + - src/codat_sync_for_expenses/models/shared/reimbursementcontactref.py + - src/codat_sync_for_expenses/models/shared/schema_datatype.py + - src/codat_sync_for_expenses/models/shared/schema_transaction.py + - src/codat_sync_for_expenses/models/shared/security.py + - src/codat_sync_for_expenses/models/shared/status.py + - src/codat_sync_for_expenses/models/shared/supplementaldata.py + - src/codat_sync_for_expenses/models/shared/supplier.py + - src/codat_sync_for_expenses/models/shared/supplierdetails.py + - src/codat_sync_for_expenses/models/shared/suppliers.py + - src/codat_sync_for_expenses/models/shared/supplierstatus.py + - src/codat_sync_for_expenses/models/shared/synccompletewebhook.py + - src/codat_sync_for_expenses/models/shared/synccompletewebhookdata.py + - src/codat_sync_for_expenses/models/shared/syncfailedwebhook.py + - src/codat_sync_for_expenses/models/shared/syncfailedwebhookdata.py + - src/codat_sync_for_expenses/models/shared/taxratemappinginfo.py + - src/codat_sync_for_expenses/models/shared/trackingcategorymappinginfo.py + - src/codat_sync_for_expenses/models/shared/trackingref.py + - src/codat_sync_for_expenses/models/shared/trackingrefadjustmenttransaction.py + - src/codat_sync_for_expenses/models/shared/transaction.py + - src/codat_sync_for_expenses/models/shared/transactions.py + - src/codat_sync_for_expenses/models/shared/transactionstatus.py + - src/codat_sync_for_expenses/models/shared/transfertransactionrequest.py + - src/codat_sync_for_expenses/models/shared/transfertransactionresponse.py + - src/codat_sync_for_expenses/models/shared/updatecustomerresponse.py + - src/codat_sync_for_expenses/models/shared/updateexpenserequest.py + - src/codat_sync_for_expenses/models/shared/updateexpenseresponse.py + - src/codat_sync_for_expenses/models/shared/updatereimbursableexpensetransactionrequest.py + - src/codat_sync_for_expenses/models/shared/updatesupplierresponse.py + - src/codat_sync_for_expenses/models/shared/validation.py + - src/codat_sync_for_expenses/models/shared/validationitem.py + - src/codat_sync_for_expenses/models/shared/validfor.py + - src/codat_sync_for_expenses/models/shared/validtransactiontypes.py + - src/codat_sync_for_expenses/push_operations.py + - src/codat_sync_for_expenses/py.typed + - src/codat_sync_for_expenses/reimbursements.py + - src/codat_sync_for_expenses/sdk.py + - src/codat_sync_for_expenses/sdkconfiguration.py + - src/codat_sync_for_expenses/suppliers.py + - src/codat_sync_for_expenses/sync.py + - src/codat_sync_for_expenses/transaction_status.py + - src/codat_sync_for_expenses/transfers.py + - src/codat_sync_for_expenses/types/__init__.py + - src/codat_sync_for_expenses/types/basemodel.py + - src/codat_sync_for_expenses/utils/__init__.py + - src/codat_sync_for_expenses/utils/annotations.py + - src/codat_sync_for_expenses/utils/enums.py + - src/codat_sync_for_expenses/utils/eventstreaming.py + - src/codat_sync_for_expenses/utils/forms.py + - src/codat_sync_for_expenses/utils/headers.py + - src/codat_sync_for_expenses/utils/logger.py + - src/codat_sync_for_expenses/utils/metadata.py + - src/codat_sync_for_expenses/utils/queryparams.py + - src/codat_sync_for_expenses/utils/requestbodies.py + - src/codat_sync_for_expenses/utils/retries.py + - src/codat_sync_for_expenses/utils/security.py + - src/codat_sync_for_expenses/utils/serializers.py + - src/codat_sync_for_expenses/utils/url.py + - src/codat_sync_for_expenses/utils/values.py +examples: + create-company: + With no description: + requestBody: + application/json: {"name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} + With a description: + requestBody: + application/json: {"description": "Technology services, including web and app design and development", "name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} + With a tag: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [], "tags": {"region": "us"}} + Malformed query: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-company: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} + Parent multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]} + Subsidiary multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "description": "", "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-companies: + "": + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + One company: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "referenceSubsidiaryCompanies": []}], "totalResults": 1} + List of Companies: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}], "totalResults": 3} + Malformed query: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-company: + Update name: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "New Name"} + responses: + "200": + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + "401": {} + Update description: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Additional documents required", "name": "Same name"} + responses: + "200": + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-partner-expense-connection: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-connection: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-connections: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Connections: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + unlink-connection: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"status": "Unlinked"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-bank-account: + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountName": "GBP Bank Account", "accountNumber": "12345678", "accountType": "Debit", "currency": "GBP", "status": "Active"} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "621cf021-cd9c-4f54-a033-15211a509a30", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Success", "statusCode": 550483} + "400": {} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountName": "Xero GBP Bank Account", "accountNumber": "12345678", "accountType": "Debit", "currency": "GBP", "sortCode": "445566", "status": "Active"} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "74c2becc-3769-4177-b5e0-24985613de0e", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 198175} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "EUR", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-bankAccounts-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Needs to be of the format '{No.}-{Name}'", "field": "AccountName"}], "warnings": []}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "Bank Account Posting Group with Nominal Account must exist", "field": "NominalCode"}], "warnings": []}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [{"details": "Must have a length between 0 and 20 characters", "field": "SortCode"}], "warnings": []}}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String"}, "overdraftLimit": {"description": "The pre-arranged overdraft limit of the account", "displayName": "Overdraft Limit", "required": false, "type": "Number", "validation": {"information": [{"details": "Default value is 0", "field": "OverdraftLimit"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP.", "field": "AccountNumber"}]}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be 6 characters long if the specified currency is GBP.", "field": "SortCode"}, {"details": "Must be provided if the specified currency is GBP.", "field": "SortCode"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String"}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP.", "field": "AccountNumber"}]}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be 6 characters long if the specified currency is GBP.", "field": "SortCode"}, {"details": "Must be provided if the specified currency is GBP.", "field": "SortCode"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String"}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 0 and 8 characters", "field": "SortCode"}]}}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String"}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String"}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "options": [{"displayName": "AED", "required": false, "type": "String", "value": "AED"}, {"displayName": "AMD", "required": false, "type": "String", "value": "AMD"}, {"displayName": "AOA", "required": false, "type": "String", "value": "AOA"}, {"displayName": "ARS", "required": false, "type": "String", "value": "ARS"}, {"displayName": "AUD", "required": false, "type": "String", "value": "AUD"}, {"displayName": "AWG", "required": false, "type": "String", "value": "AWG"}, {"displayName": "AZN", "required": false, "type": "String", "value": "AZN"}, {"displayName": "BBD", "required": false, "type": "String", "value": "BBD"}, {"displayName": "BDT", "required": false, "type": "String", "value": "BDT"}, {"displayName": "BGN", "required": false, "type": "String", "value": "BGN"}, {"displayName": "BRL", "required": false, "type": "String", "value": "BRL"}, {"displayName": "BWP", "required": false, "type": "String", "value": "BWP"}, {"displayName": "CAD", "required": false, "type": "String", "value": "CAD"}, {"displayName": "CHF", "required": false, "type": "String", "value": "CHF"}, {"displayName": "CLP", "required": false, "type": "String", "value": "CLP"}, {"displayName": "CNY", "required": false, "type": "String", "value": "CNY"}, {"displayName": "COP", "required": false, "type": "String", "value": "COP"}, {"displayName": "CRC", "required": false, "type": "String", "value": "CRC"}, {"displayName": "CUC", "required": false, "type": "String", "value": "CUC"}, {"displayName": "CUP", "required": false, "type": "String", "value": "CUP"}, {"displayName": "CZK", "required": false, "type": "String", "value": "CZK"}, {"displayName": "DKK", "required": false, "type": "String", "value": "DKK"}, {"displayName": "DOP", "required": false, "type": "String", "value": "DOP"}, {"displayName": "EGP", "required": false, "type": "String", "value": "EGP"}, {"displayName": "EUR", "required": false, "type": "String", "value": "EUR"}, {"displayName": "FJD", "required": false, "type": "String", "value": "FJD"}, {"displayName": "GBP", "required": false, "type": "String", "value": "GBP"}, {"displayName": "GEL", "required": false, "type": "String", "value": "GEL"}, {"displayName": "GHS", "required": false, "type": "String", "value": "GHS"}, {"displayName": "GTQ", "required": false, "type": "String", "value": "GTQ"}, {"displayName": "GYD", "required": false, "type": "String", "value": "GYD"}, {"displayName": "HKD", "required": false, "type": "String", "value": "HKD"}, {"displayName": "HNL", "required": false, "type": "String", "value": "HNL"}, {"displayName": "HRK", "required": false, "type": "String", "value": "HRK"}, {"displayName": "HUF", "required": false, "type": "String", "value": "HUF"}, {"displayName": "IDR", "required": false, "type": "String", "value": "IDR"}, {"displayName": "ILS", "required": false, "type": "String", "value": "ILS"}, {"displayName": "INR", "required": false, "type": "String", "value": "INR"}, {"displayName": "ISK", "required": false, "type": "String", "value": "ISK"}, {"displayName": "JMD", "required": false, "type": "String", "value": "JMD"}, {"displayName": "JPY", "required": false, "type": "String", "value": "JPY"}, {"displayName": "KES", "required": false, "type": "String", "value": "KES"}, {"displayName": "KRW", "required": false, "type": "String", "value": "KRW"}, {"displayName": "KWD", "required": false, "type": "String", "value": "KWD"}, {"displayName": "KYD", "required": false, "type": "String", "value": "KYD"}, {"displayName": "KZT", "required": false, "type": "String", "value": "KZT"}, {"displayName": "LAK", "required": false, "type": "String", "value": "LAK"}, {"displayName": "LBP", "required": false, "type": "String", "value": "LBP"}, {"displayName": "LKR", "required": false, "type": "String", "value": "LKR"}, {"displayName": "LTL", "required": false, "type": "String", "value": "LTL"}, {"displayName": "LVL", "required": false, "type": "String", "value": "LVL"}, {"displayName": "MAD", "required": false, "type": "String", "value": "MAD"}, {"displayName": "MDL", "required": false, "type": "String", "value": "MDL"}, {"displayName": "MGA", "required": false, "type": "String", "value": "MGA"}, {"displayName": "MUR", "required": false, "type": "String", "value": "MUR"}, {"displayName": "MVR", "required": false, "type": "String", "value": "MVR"}, {"displayName": "MWK", "required": false, "type": "String", "value": "MWK"}, {"displayName": "MXN", "required": false, "type": "String", "value": "MXN"}, {"displayName": "MYR", "required": false, "type": "String", "value": "MYR"}, {"displayName": "MZN", "required": false, "type": "String", "value": "MZN"}, {"displayName": "NAD", "required": false, "type": "String", "value": "NAD"}, {"displayName": "NGN", "required": false, "type": "String", "value": "NGN"}, {"displayName": "NOK", "required": false, "type": "String", "value": "NOK"}, {"displayName": "NPR", "required": false, "type": "String", "value": "NPR"}, {"displayName": "NZD", "required": false, "type": "String", "value": "NZD"}, {"displayName": "OMR", "required": false, "type": "String", "value": "OMR"}, {"displayName": "PEN", "required": false, "type": "String", "value": "PEN"}, {"displayName": "PHP", "required": false, "type": "String", "value": "PHP"}, {"displayName": "PKR", "required": false, "type": "String", "value": "PKR"}, {"displayName": "PLN", "required": false, "type": "String", "value": "PLN"}, {"displayName": "QAR", "required": false, "type": "String", "value": "QAR"}, {"displayName": "RON", "required": false, "type": "String", "value": "RON"}, {"displayName": "RSD", "required": false, "type": "String", "value": "RSD"}, {"displayName": "RUB", "required": false, "type": "String", "value": "RUB"}, {"displayName": "RWF", "required": false, "type": "String", "value": "RWF"}, {"displayName": "SAR", "required": false, "type": "String", "value": "SAR"}, {"displayName": "SCR", "required": false, "type": "String", "value": "SCR"}, {"displayName": "SEK", "required": false, "type": "String", "value": "SEK"}, {"displayName": "SGD", "required": false, "type": "String", "value": "SGD"}, {"displayName": "THB", "required": false, "type": "String", "value": "THB"}, {"displayName": "TND", "required": false, "type": "String", "value": "TND"}, {"displayName": "TRY", "required": false, "type": "String", "value": "TRY"}, {"displayName": "TTD", "required": false, "type": "String", "value": "TTD"}, {"displayName": "TWD", "required": false, "type": "String", "value": "TWD"}, {"displayName": "TZS", "required": false, "type": "String", "value": "TZS"}, {"displayName": "UAH", "required": false, "type": "String", "value": "UAH"}, {"displayName": "UGX", "required": false, "type": "String", "value": "UGX"}, {"displayName": "USD", "required": false, "type": "String", "value": "USD"}, {"displayName": "UYU", "required": false, "type": "String", "value": "UYU"}, {"displayName": "VEF", "required": false, "type": "String", "value": "VEF"}, {"displayName": "VND", "required": false, "type": "String", "value": "VND"}, {"displayName": "VUV", "required": false, "type": "String", "value": "VUV"}, {"displayName": "XAF", "required": false, "type": "String", "value": "XAF"}, {"displayName": "XCD", "required": false, "type": "String", "value": "XCD"}, {"displayName": "XOF", "required": false, "type": "String", "value": "XOF"}, {"displayName": "ZAR", "required": false, "type": "String", "value": "ZAR"}, {"displayName": "ZMK", "required": false, "type": "String", "value": "ZMK"}], "required": true, "type": "String"}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": false, "type": "Number", "validation": {"information": [{"details": "The opening balance, in the account currency", "field": "Balance"}], "warnings": []}}, "institution": {"description": "The institution of the bank account", "displayName": "Institution", "required": false, "type": "String"}}, "required": true, "type": "Object"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "Name of the bank account as it appears in Kashflow.", "displayName": "Account Name", "required": true, "type": "String"}, "balance": {"description": "The opening balance, in the account currency.", "displayName": "Balance", "required": false, "type": "Number"}, "currency": {"description": "The currency of the bank account.", "displayName": "Currency", "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 7 characters.", "field": "NominalCode"}]}}, "accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 31 characters.", "field": "AccountName"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "Currency"}], "warnings": [{"details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'", "field": "Currency"}, {"details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": false, "type": "Number"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "Name of account as it appears in the chart of accounts or general ledger.", "displayName": "Account Name", "required": true, "type": "String"}, "accountNumber": {"description": "User-defined account number to help the user in identifying the account within the chart-of-accounts and in deciding what should be posted to the account.", "displayName": "Account Number", "required": true, "type": "String"}, "currency": {"description": "Currency of the bank account.", "displayName": "Currency", "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "AccountName"}, {"details": "Should not be longer than 50 characters.", "field": "AccountName"}], "warnings": []}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}, {"details": "Must match the company's base currency.", "field": "Currency"}], "warnings": []}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [{"details": "Should be a 6 digit number.", "field": "SortCode"}], "warnings": []}}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String", "validation": {"information": [{"details": "Should not be longer than 25 characters.", "field": "AccountNumber"}], "warnings": []}}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String", "validation": {"information": [{"details": "Should be in the international bank account number format.", "field": "IBan"}], "warnings": []}}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "Should be a number between 1 and 99999999.", "field": "NominalCode"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountType": {"description": "The type of account", "displayName": "Account Type", "required": true, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String"}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String"}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": true, "type": "String"}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String"}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": true, "type": "Number"}, "availableBalance": {"description": "The available balance of the bank account", "displayName": "Available Balance", "required": true, "type": "Number"}, "overdraftLimit": {"description": "The pre-arranged overdraft limit of the account", "displayName": "Overdraft Limit", "required": true, "type": "Number"}, "institution": {"description": "The institution of the bank account", "displayName": "Institution", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Fixed Asset", "name": "Accounts Receivable", "nominalCode": "610", "status": "Active", "type": "Asset"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-chartOfAccounts-model: + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Name"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Asset.Assets.Cash", "required": false, "type": "String", "value": "Asset.Assets.Cash"}, {"displayName": "Asset.Assets.Bank", "required": false, "type": "String", "value": "Asset.Assets.Bank"}, {"displayName": "Asset.Assets.PaymentServices", "required": false, "type": "String", "value": "Asset.Assets.PaymentServices"}, {"displayName": "Asset.Assets.AccountsReceivable", "required": false, "type": "String", "value": "Asset.Assets.AccountsReceivable"}, {"displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccountsPayable"}, {"displayName": "Asset.Assets.VAT", "required": false, "type": "String", "value": "Asset.Assets.VAT"}, {"displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.EmployeesPayable"}, {"displayName": "Asset.Assets.PrepaidExpenses", "required": false, "type": "String", "value": "Asset.Assets.PrepaidExpenses"}, {"displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccruedExpenses"}, {"displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.IncomeTaxesPayable"}, {"displayName": "Asset.Assets.FixedAssets", "required": false, "type": "String", "value": "Asset.Assets.FixedAssets"}, {"displayName": "Asset.Assets.OtherAssets", "required": false, "type": "String", "value": "Asset.Assets.OtherAssets"}, {"displayName": "Asset.Assets.AccumulatedDeprecation", "required": false, "type": "String", "value": "Asset.Assets.AccumulatedDeprecation"}, {"displayName": "Asset.Assets.Inventory", "required": false, "type": "String", "value": "Asset.Assets.Inventory"}, {"displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.CapitalStock"}, {"displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.RetainedEarnings"}, {"displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.LongTermDebt"}, {"displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt"}, {"displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false, "type": "String", "value": "Unknown.EquityAndLiabilities.Intercompany"}, {"displayName": "Unknown.General.General", "required": false, "type": "String", "value": "Unknown.General.General"}, {"displayName": "Income.NetIncome.Revenue", "required": false, "type": "String", "value": "Income.NetIncome.Revenue"}, {"displayName": "Expense.NetIncome.CostOfGoods", "required": false, "type": "String", "value": "Expense.NetIncome.CostOfGoods"}, {"displayName": "Expense.NetIncome.OtherCosts", "required": false, "type": "String", "value": "Expense.NetIncome.OtherCosts"}, {"displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false, "type": "String", "value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses"}, {"displayName": "Expense.NetIncome.DeprecationCosts", "required": false, "type": "String", "value": "Expense.NetIncome.DeprecationCosts"}, {"displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false, "type": "String", "value": "Expense.NetIncome.ResearchAndDevelopment"}, {"displayName": "Expense.NetIncome.EmployeeCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmployeeCosts"}, {"displayName": "Expense.NetIncome.EmploymentCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmploymentCosts"}, {"displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.ExceptionalCosts"}, {"displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.ExceptionalIncome"}, {"displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.IncomeTaxes"}, {"displayName": "Income.ExceptionalIncome.InterestIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.InterestIncome"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "FullyQualifiedCategory"}], "warnings": []}}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Pending", "required": false, "type": "String", "value": "Pending"}, {"displayName": "Unknown", "required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Name"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Asset.Assets.Cash", "required": false, "type": "String", "value": "Asset.Assets.Cash"}, {"displayName": "Asset.Assets.Bank", "required": false, "type": "String", "value": "Asset.Assets.Bank"}, {"displayName": "Asset.Assets.PaymentServices", "required": false, "type": "String", "value": "Asset.Assets.PaymentServices"}, {"displayName": "Asset.Assets.AccountsReceivable", "required": false, "type": "String", "value": "Asset.Assets.AccountsReceivable"}, {"displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccountsPayable"}, {"displayName": "Asset.Assets.VAT", "required": false, "type": "String", "value": "Asset.Assets.VAT"}, {"displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.EmployeesPayable"}, {"displayName": "Asset.Assets.PrepaidExpenses", "required": false, "type": "String", "value": "Asset.Assets.PrepaidExpenses"}, {"displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccruedExpenses"}, {"displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.IncomeTaxesPayable"}, {"displayName": "Asset.Assets.FixedAssets", "required": false, "type": "String", "value": "Asset.Assets.FixedAssets"}, {"displayName": "Asset.Assets.OtherAssets", "required": false, "type": "String", "value": "Asset.Assets.OtherAssets"}, {"displayName": "Asset.Assets.AccumulatedDeprecation", "required": false, "type": "String", "value": "Asset.Assets.AccumulatedDeprecation"}, {"displayName": "Asset.Assets.Inventory", "required": false, "type": "String", "value": "Asset.Assets.Inventory"}, {"displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.CapitalStock"}, {"displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.RetainedEarnings"}, {"displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.LongTermDebt"}, {"displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt"}, {"displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false, "type": "String", "value": "Unknown.EquityAndLiabilities.Intercompany"}, {"displayName": "Unknown.General.General", "required": false, "type": "String", "value": "Unknown.General.General"}, {"displayName": "Income.NetIncome.Revenue", "required": false, "type": "String", "value": "Income.NetIncome.Revenue"}, {"displayName": "Expense.NetIncome.CostOfGoods", "required": false, "type": "String", "value": "Expense.NetIncome.CostOfGoods"}, {"displayName": "Expense.NetIncome.OtherCosts", "required": false, "type": "String", "value": "Expense.NetIncome.OtherCosts"}, {"displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false, "type": "String", "value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses"}, {"displayName": "Expense.NetIncome.DeprecationCosts", "required": false, "type": "String", "value": "Expense.NetIncome.DeprecationCosts"}, {"displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false, "type": "String", "value": "Expense.NetIncome.ResearchAndDevelopment"}, {"displayName": "Expense.NetIncome.EmployeeCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmployeeCosts"}, {"displayName": "Expense.NetIncome.EmploymentCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmploymentCosts"}, {"displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.ExceptionalCosts"}, {"displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.ExceptionalIncome"}, {"displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.IncomeTaxes"}, {"displayName": "Income.ExceptionalIncome.InterestIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.InterestIncome"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "FullyQualifiedCategory"}], "warnings": []}}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Pending", "required": false, "type": "String", "value": "Pending"}, {"displayName": "Unknown", "required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "If alphanumeric is supported, must be between 1 and 10 characters. Otherwise format is x-xxxx", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 60 characters", "field": "Name"}]}}, "description": {"description": "Description of the account", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 255 characters", "field": "Description"}]}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Bank", "required": false, "type": "String", "value": "Asset.Bank"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.AccountReceivable"}, {"displayName": "Other Current Asset", "required": false, "type": "String", "value": "Asset.OtherCurrentAsset"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.FixedAsset"}, {"displayName": "Other Asset", "required": false, "type": "String", "value": "Asset.OtherAsset"}, {"displayName": "Cash", "required": false, "type": "String", "value": "Asset.CashAndBank"}, {"displayName": "Equipment Machinery", "required": false, "type": "String", "value": "Asset.Property Plant and Equipment"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.CreditCard"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.AccountsPayable"}, {"displayName": "Other Current Liability", "required": false, "type": "String", "value": "Liability.OtherCurrentLiability"}, {"displayName": "Long Term Liability", "required": false, "type": "String", "value": "Liability.LongTermLiability"}, {"displayName": "Other Liability", "required": false, "type": "String", "value": "Liability.OtherLiability"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Owner's Equity"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "OtherIncome"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense"}, {"displayName": "Sales Marketing", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "General Administrative", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "General Administrative", "required": false, "type": "String", "value": "Expense.Overhead"}, {"displayName": "Repairs Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Other Expense", "required": false, "type": "String", "value": "OtherExpense"}, {"displayName": "Cost of Sales", "required": false, "type": "String", "value": "CostOfSales"}, {"displayName": "Other", "required": false, "type": "String", "value": "Cost Of Goods Sold.Cost of Sales"}], "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 7 characters.", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 31 characters.", "field": "Name"}]}}, "description": {"description": "Description of the account", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 200 characters.", "field": "Description"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "Currency"}], "warnings": [{"details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'", "field": "Currency"}, {"details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Account Receivable", "required": false, "type": "String", "value": "Asset.AccountsReceivable"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.FixedAsset"}, {"displayName": "Other Current Asset", "required": false, "type": "String", "value": "Asset.OtherCurrentAsset"}, {"displayName": "Other Asset", "required": false, "type": "String", "value": "Asset.OtherAsset"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income.Income"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "Income.OtherIncome"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.AccountsPayable"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.CreditCard"}, {"displayName": "Long Term Liability", "required": false, "type": "String", "value": "Liability.LongTermLiability"}, {"displayName": "Other Current Liability", "required": false, "type": "String", "value": "Liability.OtherCurrentLiability"}, {"displayName": "Cost Of Goods Sold", "required": false, "type": "String", "value": "Liability.CostOfGoodsSold"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity.Equity"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "Other Expense", "required": false, "type": "String", "value": "Expense.OtherExpense"}], "required": true, "type": "String"}, "currentBalance": {"description": "The current balance in the account", "displayName": "Current Balance", "required": false, "type": "Number"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "If included must have a length between 1 and 7 characters", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 100 characters", "field": "Name"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "When not specified company base currency will be used", "field": "Currency"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Cash On Hand", "required": false, "type": "String", "value": "Asset.Bank.CashOnHand"}, {"displayName": "Checking", "required": false, "type": "String", "value": "Asset.Bank.Checking"}, {"displayName": "Money Market", "required": false, "type": "String", "value": "Asset.Bank.MoneyMarket"}, {"displayName": "Rents Held In Trust", "required": false, "type": "String", "value": "Asset.Bank.RentsHeldInTrust"}, {"displayName": "Savings", "required": false, "type": "String", "value": "Asset.Bank.Savings"}, {"displayName": "Trust Accounts", "required": false, "type": "String", "value": "Asset.Bank.TrustAccounts"}, {"displayName": "Cash And Cash Equivalents", "required": false, "type": "String", "value": "Asset.Bank.CashAndCashEquivalents"}, {"displayName": "Other Earmarked Bank Accounts", "required": false, "type": "String", "value": "Asset.Bank.OtherEarmarkedBankAccounts"}, {"displayName": "Allowance For Bad Debts", "required": false, "type": "String", "value": "Asset.Other Current Asset.AllowanceForBadDebts"}, {"displayName": "Development Costs", "required": false, "type": "String", "value": "Asset.Other Current Asset.DevelopmentCosts"}, {"displayName": "Employee Cash Advances", "required": false, "type": "String", "value": "Asset.Other Current Asset.EmployeeCashAdvances"}, {"displayName": "Other Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherCurrentAssets"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Other Current Asset.Inventory"}, {"displayName": "Investment Mortgage Real Estate Loans", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans"}, {"displayName": "Investment Other", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_Other"}, {"displayName": "Investment Tax Exempt Securities", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_TaxExemptSecurities"}, {"displayName": "Investment US Government Obligations", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_USGovernmentObligations"}, {"displayName": "Loans To Officers", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOfficers"}, {"displayName": "Loans To Others", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOthers"}, {"displayName": "Loans To Stockholders", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToStockholders"}, {"displayName": "Prepaid Expenses", "required": false, "type": "String", "value": "Asset.Other Current Asset.PrepaidExpenses"}, {"displayName": "Retainage", "required": false, "type": "String", "value": "Asset.Other Current Asset.Retainage"}, {"displayName": "Undeposited Funds", "required": false, "type": "String", "value": "Asset.Other Current Asset.UndepositedFunds"}, {"displayName": "Assets Available For Sale", "required": false, "type": "String", "value": "Asset.Other Current Asset.AssetsAvailableForSale"}, {"displayName": "Balance With Govt Authorities", "required": false, "type": "String", "value": "Asset.Other Current Asset.BalWithGovtAuthorities"}, {"displayName": "Called Up Share Capital Not Paid", "required": false, "type": "String", "value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid"}, {"displayName": "Expenditure Authorisations And Letters Of Credit", "required": false, "type": "String", "value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit"}, {"displayName": "Global Tax Deferred", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxDeferred"}, {"displayName": "Global Tax Refund", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxRefund"}, {"displayName": "Internal Transfers", "required": false, "type": "String", "value": "Asset.Other Current Asset.InternalTransfers"}, {"displayName": "Other Consumables", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherConsumables"}, {"displayName": "Provisions Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.ProvisionsCurrentAssets"}, {"displayName": "Short Term Investments In Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties"}, {"displayName": "Short Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Trade And Other Receivables", "required": false, "type": "String", "value": "Asset.Other Current Asset.TradeAndOtherReceivables"}, {"displayName": "Accumulated Depletion", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepletion"}, {"displayName": "Accumulated Depreciation", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepreciation"}, {"displayName": "Depletable Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.DepletableAssets"}, {"displayName": "Fixed Asset Computers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetComputers"}, {"displayName": "Fixed Asset Copiers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetCopiers"}, {"displayName": "Fixed Asset Furniture", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetFurniture"}, {"displayName": "Fixed Asset Phone", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhone"}, {"displayName": "Fixed Asset Photo Video", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhotoVideo"}, {"displayName": "Fixed Asset Software", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetSoftware"}, {"displayName": "Fixed Asset Other Tools Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment"}, {"displayName": "Furniture And Fixtures", "required": false, "type": "String", "value": "Asset.Fixed Asset.FurnitureAndFixtures"}, {"displayName": "Land", "required": false, "type": "String", "value": "Asset.Fixed Asset.Land"}, {"displayName": "Leasehold Improvements", "required": false, "type": "String", "value": "Asset.Fixed Asset.LeaseholdImprovements"}, {"displayName": "Other Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.OtherFixedAssets"}, {"displayName": "Accumulated Amortization", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedAmortization"}, {"displayName": "Buildings", "required": false, "type": "String", "value": "Asset.Fixed Asset.Buildings"}, {"displayName": "Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssets"}, {"displayName": "Machinery And Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.MachineryAndEquipment"}, {"displayName": "Vehicles", "required": false, "type": "String", "value": "Asset.Fixed Asset.Vehicles"}, {"displayName": "Assets In Course Of Construction", "required": false, "type": "String", "value": "Asset.Fixed Asset.AssetsInCourseOfConstruction"}, {"displayName": "Capital Wip", "required": false, "type": "String", "value": "Asset.Fixed Asset.CapitalWip"}, {"displayName": "Cumulative Depreciation On Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets"}, {"displayName": "Intangible Assets Under Development", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment"}, {"displayName": "Land Asset", "required": false, "type": "String", "value": "Asset.Fixed Asset.LandAsset"}, {"displayName": "Non Current Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.NonCurrentAssets"}, {"displayName": "Participating Interests", "required": false, "type": "String", "value": "Asset.Fixed Asset.ParticipatingInterests"}, {"displayName": "Provisions Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.ProvisionsFixedAssets"}, {"displayName": "Lease Buyout", "required": false, "type": "String", "value": "Asset.Other Asset.LeaseBuyout"}, {"displayName": "Other Long Term Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermAssets"}, {"displayName": "Security Deposits", "required": false, "type": "String", "value": "Asset.Other Asset.SecurityDeposits"}, {"displayName": "Accumulated Amortization Of Other Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets"}, {"displayName": "Goodwill", "required": false, "type": "String", "value": "Asset.Other Asset.Goodwill"}, {"displayName": "Licenses", "required": false, "type": "String", "value": "Asset.Other Asset.Licenses"}, {"displayName": "Organizational Costs", "required": false, "type": "String", "value": "Asset.Other Asset.OrganizationalCosts"}, {"displayName": "Assets Held For Sale", "required": false, "type": "String", "value": "Asset.Other Asset.AssetsHeldForSale"}, {"displayName": "Available For Sale Financial Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AvailableForSaleFinancialAssets"}, {"displayName": "Deferred Tax", "required": false, "type": "String", "value": "Asset.Other Asset.DeferredTax"}, {"displayName": "Investments", "required": false, "type": "String", "value": "Asset.Other Asset.Investments"}, {"displayName": "Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermInvestments"}, {"displayName": "Long Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Other Intangible Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherIntangibleAssets"}, {"displayName": "Other Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermInvestments"}, {"displayName": "Other Long Term Loans And Advances", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermLoansAndAdvances"}, {"displayName": "Prepayments And Accrued Income", "required": false, "type": "String", "value": "Asset.Other Asset.PrepaymentsAndAccruedIncome"}, {"displayName": "Provisions Non-Current Assets", "required": false, "type": "String", "value": "Asset.Other Asset.ProvisionsNonCurrentAssets"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.Accounts Receivable.AccountsReceivable"}, {"displayName": "Advertising/Promotional", "required": false, "type": "String", "value": "Expense.Expense.AdvertisingPromotional"}, {"displayName": "Bad Debts", "required": false, "type": "String", "value": "Expense.Expense.BadDebts"}, {"displayName": "Bank Charges", "required": false, "type": "String", "value": "Expense.Expense.BankCharges"}, {"displayName": "Charitable Contributions", "required": false, "type": "String", "value": "Expense.Expense.CharitableContributions"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Entertainment", "required": false, "type": "String", "value": "Expense.Expense.Entertainment"}, {"displayName": "Entertainment Meals", "required": false, "type": "String", "value": "Expense.Expense.EntertainmentMeals"}, {"displayName": "Equipment Rental", "required": false, "type": "String", "value": "Expense.Expense.EquipmentRental"}, {"displayName": "Finance Costs", "required": false, "type": "String", "value": "Expense.Expense.FinanceCosts"}, {"displayName": "Global Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.GlobalTaxExpense"}, {"displayName": "Insurance", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "Interest Paid", "required": false, "type": "String", "value": "Expense.Expense.InterestPaid"}, {"displayName": "Legal And Professional Fees", "required": false, "type": "String", "value": "Expense.Expense.LegalProfessionalFees"}, {"displayName": "Office Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeExpenses"}, {"displayName": "Office/General Administrative Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeGeneralAdministrativeExpenses"}, {"displayName": "Other Business Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherBusinessExpenses"}, {"displayName": "Other Miscellaneous Service Cost", "required": false, "type": "String", "value": "Expense.Expense.OtherMiscellaneousServiceCost"}, {"displayName": "Promotional Meals", "required": false, "type": "String", "value": "Expense.Expense.PromotionalMeals"}, {"displayName": "Rent Or Lease Of Buildings", "required": false, "type": "String", "value": "Expense.Expense.RentOrLeaseOfBuildings"}, {"displayName": "Repair And Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Shipping, Freight And Delivery", "required": false, "type": "String", "value": "Expense.Expense.ShippingFreightDelivery"}, {"displayName": "Supplies And Materials", "required": false, "type": "String", "value": "Expense.Expense.SuppliesMaterials"}, {"displayName": "Travel", "required": false, "type": "String", "value": "Expense.Expense.Travel"}, {"displayName": "Travel Meals", "required": false, "type": "String", "value": "Expense.Expense.TravelMeals"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Auto", "required": false, "type": "String", "value": "Expense.Expense.Auto"}, {"displayName": "Cost Of Labor", "required": false, "type": "String", "value": "Expense.Expense.CostOfLabor"}, {"displayName": "Dues And Subscriptions", "required": false, "type": "String", "value": "Expense.Expense.DuesSubscriptions"}, {"displayName": "Payroll Expenses", "required": false, "type": "String", "value": "Expense.Expense.PayrollExpenses"}, {"displayName": "Taxes Paid", "required": false, "type": "String", "value": "Expense.Expense.TaxesPaid"}, {"displayName": "Unapplied Cash Bill Payment Expense", "required": false, "type": "String", "value": "Expense.Expense.UnappliedCashBillPaymentExpense"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Amortization Expense", "required": false, "type": "String", "value": "Expense.Expense.AmortizationExpense"}, {"displayName": "Appropriations To Depreciation", "required": false, "type": "String", "value": "Expense.Expense.AppropriationsToDepreciation"}, {"displayName": "Borrowing Cost", "required": false, "type": "String", "value": "Expense.Expense.BorrowingCost"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Distribution Costs", "required": false, "type": "String", "value": "Expense.Expense.DistributionCosts"}, {"displayName": "External Services", "required": false, "type": "String", "value": "Expense.Expense.ExternalServices"}, {"displayName": "Extraordinary Charges", "required": false, "type": "String", "value": "Expense.Expense.ExtraordinaryCharges"}, {"displayName": "Income Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.IncomeTaxExpense"}, {"displayName": "Loss On Discontinued Operations Net Of Tax", "required": false, "type": "String", "value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax"}, {"displayName": "Management Compensation", "required": false, "type": "String", "value": "Expense.Expense.ManagementCompensation"}, {"displayName": "Other Current Operating Charges", "required": false, "type": "String", "value": "Expense.Expense.OtherCurrentOperatingCharges"}, {"displayName": "Other External Services", "required": false, "type": "String", "value": "Expense.Expense.OtherExternalServices"}, {"displayName": "Other Rental Costs", "required": false, "type": "String", "value": "Expense.Expense.OtherRentalCosts"}, {"displayName": "Other Selling Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherSellingExpenses"}, {"displayName": "Project Studies Surveys Assessments", "required": false, "type": "String", "value": "Expense.Expense.ProjectStudiesSurveysAssessments"}, {"displayName": "Purchases Rebates", "required": false, "type": "String", "value": "Expense.Expense.PurchasesRebates"}, {"displayName": "Shipping And Delivery Expense", "required": false, "type": "String", "value": "Expense.Expense.ShippingAndDeliveryExpense"}, {"displayName": "Staff Costs", "required": false, "type": "String", "value": "Expense.Expense.StaffCosts"}, {"displayName": "Sundry", "required": false, "type": "String", "value": "Expense.Expense.Sundry"}, {"displayName": "Travel Expenses General And Admin Expenses", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses"}, {"displayName": "Travel Expenses Selling Expense", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesSellingExpense"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Expense.Other Expense.Depreciation"}, {"displayName": "Exchange Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.ExchangeGainOrLoss"}, {"displayName": "Other Miscellaneous Expense", "required": false, "type": "String", "value": "Expense.Other Expense.OtherMiscellaneousExpense"}, {"displayName": "Penalties And Settlements", "required": false, "type": "String", "value": "Expense.Other Expense.PenaltiesSettlements"}, {"displayName": "Amortization", "required": false, "type": "String", "value": "Expense.Other Expense.Amortization"}, {"displayName": "Gas And Fuel", "required": false, "type": "String", "value": "Expense.Other Expense.GasAndFuel"}, {"displayName": "Home Office", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOffice"}, {"displayName": "Home Owner Rental Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOwnerRentalInsurance"}, {"displayName": "Other Home Office Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherHomeOfficeExpenses"}, {"displayName": "Mortgage Interest", "required": false, "type": "String", "value": "Expense.Other Expense.MortgageInterest"}, {"displayName": "Rent And Lease", "required": false, "type": "String", "value": "Expense.Other Expense.RentAndLease"}, {"displayName": "Repairs And Maintenance", "required": false, "type": "String", "value": "Expense.Other Expense.RepairsAndMaintenance"}, {"displayName": "Parking And Tolls", "required": false, "type": "String", "value": "Expense.Other Expense.ParkingAndTolls"}, {"displayName": "Vehicle", "required": false, "type": "String", "value": "Expense.Other Expense.Vehicle"}, {"displayName": "Vehicle Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleInsurance"}, {"displayName": "Vehicle Lease", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLease"}, {"displayName": "Vehicle Loan Interest", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoanInterest"}, {"displayName": "Vehicle Loan", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoan"}, {"displayName": "Vehicle Registration", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRegistration"}, {"displayName": "Vehicle Repairs", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRepairs"}, {"displayName": "Other Vehicle Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherVehicleExpenses"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Other Expense.Utilities"}, {"displayName": "Wash And Road Services", "required": false, "type": "String", "value": "Expense.Other Expense.WashAndRoadServices"}, {"displayName": "Deferred Tax Expense", "required": false, "type": "String", "value": "Expense.Other Expense.DeferredTaxExpense"}, {"displayName": "Depletion", "required": false, "type": "String", "value": "Expense.Other Expense.Depletion"}, {"displayName": "Exceptional Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExceptionalItems"}, {"displayName": "Extraordinary Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExtraordinaryItems"}, {"displayName": "Income Tax Other Expense", "required": false, "type": "String", "value": "Expense.Other Expense.IncomeTaxOtherExpense"}, {"displayName": "Mat Credit", "required": false, "type": "String", "value": "Expense.Other Expense.MatCredit"}, {"displayName": "Prior Period Items", "required": false, "type": "String", "value": "Expense.Other Expense.PriorPeriodItems"}, {"displayName": "Tax Roundoff Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.TaxRoundoffGainOrLoss"}, {"displayName": "Equipment Rental - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.EquipmentRentalCos"}, {"displayName": "Other Costs Of Sales - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos"}, {"displayName": "Shipping, Freight And Delivery - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos"}, {"displayName": "Supplies And Materials - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs"}, {"displayName": "Cost Of Labor - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfLaborCos"}, {"displayName": "Cost Of Sales", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfSales"}, {"displayName": "Freight And Delivery Cost", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost"}, {"displayName": "Non Profit Income", "required": false, "type": "String", "value": "Income.Income.NonProfitIncome"}, {"displayName": "Other Primary Income", "required": false, "type": "String", "value": "Income.Income.OtherPrimaryIncome"}, {"displayName": "Sales Of ProductIncome", "required": false, "type": "String", "value": "Income.Income.SalesOfProductIncome"}, {"displayName": "Service Fee Income", "required": false, "type": "String", "value": "Income.Income.ServiceFeeIncome"}, {"displayName": "Discounts Refunds Given", "required": false, "type": "String", "value": "Income.Income.DiscountsRefundsGiven"}, {"displayName": "Unapplied Cash Payment Income", "required": false, "type": "String", "value": "Income.Income.UnappliedCashPaymentIncome"}, {"displayName": "Cash Receipt Income", "required": false, "type": "String", "value": "Income.Income.CashReceiptIncome"}, {"displayName": "Operating Grants", "required": false, "type": "String", "value": "Income.Income.OperatingGrants"}, {"displayName": "Other Current Operating Income", "required": false, "type": "String", "value": "Income.Income.OtherCurrentOperatingIncome"}, {"displayName": "Own Work Capitalized", "required": false, "type": "String", "value": "Income.Income.OwnWorkCapitalized"}, {"displayName": "Revenue General", "required": false, "type": "String", "value": "Income.Income.RevenueGeneral"}, {"displayName": "Sales Retail", "required": false, "type": "String", "value": "Income.Income.SalesRetail"}, {"displayName": "Sales Wholesale", "required": false, "type": "String", "value": "Income.Income.SalesWholesale"}, {"displayName": "Savings By Tax Scheme", "required": false, "type": "String", "value": "Income.Income.SavingsByTaxScheme"}, {"displayName": "Dividend Income", "required": false, "type": "String", "value": "Income.Other Income.DividendIncome"}, {"displayName": "Interest Earned", "required": false, "type": "String", "value": "Income.Other Income.InterestEarned"}, {"displayName": "Other Investment Income", "required": false, "type": "String", "value": "Income.Other Income.OtherInvestmentIncome"}, {"displayName": "Other Miscellaneous Income", "required": false, "type": "String", "value": "Income.Other Income.OtherMiscellaneousIncome"}, {"displayName": "Tax Exempt Interest", "required": false, "type": "String", "value": "Income.Other Income.TaxExemptInterest"}, {"displayName": "Gain Loss On Sale Of Fixed Assets", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfFixedAssets"}, {"displayName": "Gain Loss On Sale Of Investments", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfInvestments"}, {"displayName": "Loss On Disposal Of Assets", "required": false, "type": "String", "value": "Income.Other Income.LossOnDisposalOfAssets"}, {"displayName": "Other Operating Income", "required": false, "type": "String", "value": "Income.Other Income.OtherOperatingIncome"}, {"displayName": "Unrealised Loss On Securities Net Of Tax", "required": false, "type": "String", "value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.Accounts Payable.AccountsPayable"}, {"displayName": "Outstanding Dues Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise"}, {"displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.Credit Card.CreditCard"}, {"displayName": "Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.NotesPayable"}, {"displayName": "Other Long Term Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermLiabilities"}, {"displayName": "Shareholder Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.ShareholderNotesPayable"}, {"displayName": "Accruals And Deferred Income", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccrualsAndDeferredIncome"}, {"displayName": "Accrued Long Lerm Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedLongLermLiabilities"}, {"displayName": "Accrued Vacation Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedVacationPayable"}, {"displayName": "Bank Loans", "required": false, "type": "String", "value": "Liability.Long Term Liability.BankLoans"}, {"displayName": "Debts Related To Participating Interests", "required": false, "type": "String", "value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests"}, {"displayName": "Deferred Tax Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.DeferredTaxLiabilities"}, {"displayName": "Government And Other Public Authorities", "required": false, "type": "String", "value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities"}, {"displayName": "Group And Associates", "required": false, "type": "String", "value": "Liability.Long Term Liability.GroupAndAssociates"}, {"displayName": "Liabilities Related To Assets Held For Sale", "required": false, "type": "String", "value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale"}, {"displayName": "Long Term Borrowings", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermBorrowings"}, {"displayName": "Long Term Debit", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermDebit"}, {"displayName": "Long Term Employee Benefit Obligations", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations"}, {"displayName": "Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases"}, {"displayName": "Other Long Term Provisions", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermProvisions"}, {"displayName": "Provision For Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionForLiabilities"}, {"displayName": "Provisions Non Current Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities"}, {"displayName": "Staff And Related Long Term Liability Accounts", "required": false, "type": "String", "value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts"}, {"displayName": "Direct Deposit Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DirectDepositPayable"}, {"displayName": "Line Of Credit", "required": false, "type": "String", "value": "Liability.Other Current Liability.LineOfCredit"}, {"displayName": "Loan Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.LoanPayable"}, {"displayName": "Global Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxPayable"}, {"displayName": "Global Tax Suspense", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxSuspense"}, {"displayName": "Other Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.OtherCurrentLiabilities"}, {"displayName": "Payroll Clearing", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollClearing"}, {"displayName": "Payroll Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollTaxPayable"}, {"displayName": "Prepaid Expenses Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PrepaidExpensesPayable"}, {"displayName": "Rents In Trust Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.RentsInTrustLiability"}, {"displayName": "Trust Accounts Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.TrustAccountsLiabilities"}, {"displayName": "Federal Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.FederalIncomeTaxPayable"}, {"displayName": "Insurance Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.InsurancePayable"}, {"displayName": "Sales Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.SalesTaxPayable"}, {"displayName": "State Local Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable"}, {"displayName": "Accrued Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.AccruedLiabilities"}, {"displayName": "Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentLiabilities"}, {"displayName": "Current Portion EmployeeBenefits Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations"}, {"displayName": "Current Portion Of Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases"}, {"displayName": "Current Tax Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentTaxLiability"}, {"displayName": "Dividends Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DividendsPayable"}, {"displayName": "Duties And Taxes", "required": false, "type": "String", "value": "Liability.Other Current Liability.DutiesAndTaxes"}, {"displayName": "Interest Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.InterestPayables"}, {"displayName": "Provision For Warranty Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionForWarrantyObligations"}, {"displayName": "Provisions Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities"}, {"displayName": "Short Term Borrowings", "required": false, "type": "String", "value": "Liability.Other Current Liability.ShortTermBorrowings"}, {"displayName": "Social Security Agencies", "required": false, "type": "String", "value": "Liability.Other Current Liability.SocialSecurityAgencies"}, {"displayName": "Staff And Related Liability Accounts", "required": false, "type": "String", "value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts"}, {"displayName": "Sundry Debtors And Creditors", "required": false, "type": "String", "value": "Liability.Other Current Liability.SundryDebtorsAndCreditors"}, {"displayName": "Trade And Other Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.TradeAndOtherPayables"}, {"displayName": "Opening Balance Equity", "required": false, "type": "String", "value": "Equity.Equity.OpeningBalanceEquity"}, {"displayName": "Partners Equity", "required": false, "type": "String", "value": "Equity.Equity.PartnersEquity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Accumulated Adjustment", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedAdjustment"}, {"displayName": "Owners Equity", "required": false, "type": "String", "value": "Equity.Equity.OwnersEquity"}, {"displayName": "Paid In Capital Or Surplus", "required": false, "type": "String", "value": "Equity.Equity.PaidInCapitalOrSurplus"}, {"displayName": "Partner Contributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerContributions"}, {"displayName": "Partner Distributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerDistributions"}, {"displayName": "Preferred Stock", "required": false, "type": "String", "value": "Equity.Equity.PreferredStock"}, {"displayName": "Common Stock", "required": false, "type": "String", "value": "Equity.Equity.CommonStock"}, {"displayName": "Treasury Stock", "required": false, "type": "String", "value": "Equity.Equity.TreasuryStock"}, {"displayName": "Estimated Taxes", "required": false, "type": "String", "value": "Equity.Equity.EstimatedTaxes"}, {"displayName": "Healthcare", "required": false, "type": "String", "value": "Equity.Equity.Healthcare"}, {"displayName": "Personal Income", "required": false, "type": "String", "value": "Equity.Equity.PersonalIncome"}, {"displayName": "Personal Expense", "required": false, "type": "String", "value": "Equity.Equity.PersonalExpense"}, {"displayName": "Accumulated Other Comprehensive Income", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedOtherComprehensiveIncome"}, {"displayName": "Called Up Share Capital", "required": false, "type": "String", "value": "Equity.Equity.CalledUpShareCapital"}, {"displayName": "Capital Reserves", "required": false, "type": "String", "value": "Equity.Equity.CapitalReserves"}, {"displayName": "Dividend Disbursed", "required": false, "type": "String", "value": "Equity.Equity.DividendDisbursed"}, {"displayName": "Equity In Earnings Of Subsiduaries", "required": false, "type": "String", "value": "Equity.Equity.EquityInEarningsOfSubsiduaries"}, {"displayName": "Investment Grants", "required": false, "type": "String", "value": "Equity.Equity.InvestmentGrants"}, {"displayName": "Money Received Against Share Warrants", "required": false, "type": "String", "value": "Equity.Equity.MoneyReceivedAgainstShareWarrants"}, {"displayName": "Other Free Reserves", "required": false, "type": "String", "value": "Equity.Equity.OtherFreeReserves"}, {"displayName": "Share Application Money Pending Allotment", "required": false, "type": "String", "value": "Equity.Equity.ShareApplicationMoneyPendingAllotment"}, {"displayName": "Share Capital", "required": false, "type": "String", "value": "Equity.Equity.ShareCapital"}, {"displayName": "Funds", "required": false, "type": "String", "value": "Equity.Equity.Funds"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "If included must have a length between 1 and 7 characters", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 100 characters", "field": "Name"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "When not specified company base currency will be used", "field": "Currency"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Cash On Hand", "required": false, "type": "String", "value": "Asset.Bank.CashOnHand"}, {"displayName": "Checking", "required": false, "type": "String", "value": "Asset.Bank.Checking"}, {"displayName": "Money Market", "required": false, "type": "String", "value": "Asset.Bank.MoneyMarket"}, {"displayName": "Rents Held In Trust", "required": false, "type": "String", "value": "Asset.Bank.RentsHeldInTrust"}, {"displayName": "Savings", "required": false, "type": "String", "value": "Asset.Bank.Savings"}, {"displayName": "Trust Accounts", "required": false, "type": "String", "value": "Asset.Bank.TrustAccounts"}, {"displayName": "Cash And Cash Equivalents", "required": false, "type": "String", "value": "Asset.Bank.CashAndCashEquivalents"}, {"displayName": "Other Earmarked Bank Accounts", "required": false, "type": "String", "value": "Asset.Bank.OtherEarmarkedBankAccounts"}, {"displayName": "Allowance For Bad Debts", "required": false, "type": "String", "value": "Asset.Other Current Asset.AllowanceForBadDebts"}, {"displayName": "Development Costs", "required": false, "type": "String", "value": "Asset.Other Current Asset.DevelopmentCosts"}, {"displayName": "Employee Cash Advances", "required": false, "type": "String", "value": "Asset.Other Current Asset.EmployeeCashAdvances"}, {"displayName": "Other Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherCurrentAssets"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Other Current Asset.Inventory"}, {"displayName": "Investment Mortgage Real Estate Loans", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans"}, {"displayName": "Investment Other", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_Other"}, {"displayName": "Investment Tax Exempt Securities", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_TaxExemptSecurities"}, {"displayName": "Investment US Government Obligations", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_USGovernmentObligations"}, {"displayName": "Loans To Officers", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOfficers"}, {"displayName": "Loans To Others", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOthers"}, {"displayName": "Loans To Stockholders", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToStockholders"}, {"displayName": "Prepaid Expenses", "required": false, "type": "String", "value": "Asset.Other Current Asset.PrepaidExpenses"}, {"displayName": "Retainage", "required": false, "type": "String", "value": "Asset.Other Current Asset.Retainage"}, {"displayName": "Undeposited Funds", "required": false, "type": "String", "value": "Asset.Other Current Asset.UndepositedFunds"}, {"displayName": "Assets Available For Sale", "required": false, "type": "String", "value": "Asset.Other Current Asset.AssetsAvailableForSale"}, {"displayName": "Balance With Govt Authorities", "required": false, "type": "String", "value": "Asset.Other Current Asset.BalWithGovtAuthorities"}, {"displayName": "Called Up Share Capital Not Paid", "required": false, "type": "String", "value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid"}, {"displayName": "Expenditure Authorisations And Letters Of Credit", "required": false, "type": "String", "value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit"}, {"displayName": "Global Tax Deferred", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxDeferred"}, {"displayName": "Global Tax Refund", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxRefund"}, {"displayName": "Internal Transfers", "required": false, "type": "String", "value": "Asset.Other Current Asset.InternalTransfers"}, {"displayName": "Other Consumables", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherConsumables"}, {"displayName": "Provisions Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.ProvisionsCurrentAssets"}, {"displayName": "Short Term Investments In Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties"}, {"displayName": "Short Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Trade And Other Receivables", "required": false, "type": "String", "value": "Asset.Other Current Asset.TradeAndOtherReceivables"}, {"displayName": "Accumulated Depletion", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepletion"}, {"displayName": "Accumulated Depreciation", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepreciation"}, {"displayName": "Depletable Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.DepletableAssets"}, {"displayName": "Fixed Asset Computers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetComputers"}, {"displayName": "Fixed Asset Copiers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetCopiers"}, {"displayName": "Fixed Asset Furniture", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetFurniture"}, {"displayName": "Fixed Asset Phone", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhone"}, {"displayName": "Fixed Asset Photo Video", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhotoVideo"}, {"displayName": "Fixed Asset Software", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetSoftware"}, {"displayName": "Fixed Asset Other Tools Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment"}, {"displayName": "Furniture And Fixtures", "required": false, "type": "String", "value": "Asset.Fixed Asset.FurnitureAndFixtures"}, {"displayName": "Land", "required": false, "type": "String", "value": "Asset.Fixed Asset.Land"}, {"displayName": "Leasehold Improvements", "required": false, "type": "String", "value": "Asset.Fixed Asset.LeaseholdImprovements"}, {"displayName": "Other Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.OtherFixedAssets"}, {"displayName": "Accumulated Amortization", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedAmortization"}, {"displayName": "Buildings", "required": false, "type": "String", "value": "Asset.Fixed Asset.Buildings"}, {"displayName": "Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssets"}, {"displayName": "Machinery And Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.MachineryAndEquipment"}, {"displayName": "Vehicles", "required": false, "type": "String", "value": "Asset.Fixed Asset.Vehicles"}, {"displayName": "Assets In Course Of Construction", "required": false, "type": "String", "value": "Asset.Fixed Asset.AssetsInCourseOfConstruction"}, {"displayName": "Capital Wip", "required": false, "type": "String", "value": "Asset.Fixed Asset.CapitalWip"}, {"displayName": "Cumulative Depreciation On Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets"}, {"displayName": "Intangible Assets Under Development", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment"}, {"displayName": "Land Asset", "required": false, "type": "String", "value": "Asset.Fixed Asset.LandAsset"}, {"displayName": "Non Current Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.NonCurrentAssets"}, {"displayName": "Participating Interests", "required": false, "type": "String", "value": "Asset.Fixed Asset.ParticipatingInterests"}, {"displayName": "Provisions Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.ProvisionsFixedAssets"}, {"displayName": "Lease Buyout", "required": false, "type": "String", "value": "Asset.Other Asset.LeaseBuyout"}, {"displayName": "Other Long Term Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermAssets"}, {"displayName": "Security Deposits", "required": false, "type": "String", "value": "Asset.Other Asset.SecurityDeposits"}, {"displayName": "Accumulated Amortization Of Other Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets"}, {"displayName": "Goodwill", "required": false, "type": "String", "value": "Asset.Other Asset.Goodwill"}, {"displayName": "Licenses", "required": false, "type": "String", "value": "Asset.Other Asset.Licenses"}, {"displayName": "Organizational Costs", "required": false, "type": "String", "value": "Asset.Other Asset.OrganizationalCosts"}, {"displayName": "Assets Held For Sale", "required": false, "type": "String", "value": "Asset.Other Asset.AssetsHeldForSale"}, {"displayName": "Available For Sale Financial Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AvailableForSaleFinancialAssets"}, {"displayName": "Deferred Tax", "required": false, "type": "String", "value": "Asset.Other Asset.DeferredTax"}, {"displayName": "Investments", "required": false, "type": "String", "value": "Asset.Other Asset.Investments"}, {"displayName": "Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermInvestments"}, {"displayName": "Long Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Other Intangible Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherIntangibleAssets"}, {"displayName": "Other Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermInvestments"}, {"displayName": "Other Long Term Loans And Advances", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermLoansAndAdvances"}, {"displayName": "Prepayments And Accrued Income", "required": false, "type": "String", "value": "Asset.Other Asset.PrepaymentsAndAccruedIncome"}, {"displayName": "Provisions Non-Current Assets", "required": false, "type": "String", "value": "Asset.Other Asset.ProvisionsNonCurrentAssets"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.Accounts Receivable.AccountsReceivable"}, {"displayName": "Advertising/Promotional", "required": false, "type": "String", "value": "Expense.Expense.AdvertisingPromotional"}, {"displayName": "Bad Debts", "required": false, "type": "String", "value": "Expense.Expense.BadDebts"}, {"displayName": "Bank Charges", "required": false, "type": "String", "value": "Expense.Expense.BankCharges"}, {"displayName": "Charitable Contributions", "required": false, "type": "String", "value": "Expense.Expense.CharitableContributions"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Entertainment", "required": false, "type": "String", "value": "Expense.Expense.Entertainment"}, {"displayName": "Entertainment Meals", "required": false, "type": "String", "value": "Expense.Expense.EntertainmentMeals"}, {"displayName": "Equipment Rental", "required": false, "type": "String", "value": "Expense.Expense.EquipmentRental"}, {"displayName": "Finance Costs", "required": false, "type": "String", "value": "Expense.Expense.FinanceCosts"}, {"displayName": "Global Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.GlobalTaxExpense"}, {"displayName": "Insurance", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "Interest Paid", "required": false, "type": "String", "value": "Expense.Expense.InterestPaid"}, {"displayName": "Legal And Professional Fees", "required": false, "type": "String", "value": "Expense.Expense.LegalProfessionalFees"}, {"displayName": "Office Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeExpenses"}, {"displayName": "Office/General Administrative Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeGeneralAdministrativeExpenses"}, {"displayName": "Other Business Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherBusinessExpenses"}, {"displayName": "Other Miscellaneous Service Cost", "required": false, "type": "String", "value": "Expense.Expense.OtherMiscellaneousServiceCost"}, {"displayName": "Promotional Meals", "required": false, "type": "String", "value": "Expense.Expense.PromotionalMeals"}, {"displayName": "Rent Or Lease Of Buildings", "required": false, "type": "String", "value": "Expense.Expense.RentOrLeaseOfBuildings"}, {"displayName": "Repair And Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Shipping, Freight And Delivery", "required": false, "type": "String", "value": "Expense.Expense.ShippingFreightDelivery"}, {"displayName": "Supplies And Materials", "required": false, "type": "String", "value": "Expense.Expense.SuppliesMaterials"}, {"displayName": "Travel", "required": false, "type": "String", "value": "Expense.Expense.Travel"}, {"displayName": "Travel Meals", "required": false, "type": "String", "value": "Expense.Expense.TravelMeals"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Auto", "required": false, "type": "String", "value": "Expense.Expense.Auto"}, {"displayName": "Cost Of Labor", "required": false, "type": "String", "value": "Expense.Expense.CostOfLabor"}, {"displayName": "Dues And Subscriptions", "required": false, "type": "String", "value": "Expense.Expense.DuesSubscriptions"}, {"displayName": "Payroll Expenses", "required": false, "type": "String", "value": "Expense.Expense.PayrollExpenses"}, {"displayName": "Taxes Paid", "required": false, "type": "String", "value": "Expense.Expense.TaxesPaid"}, {"displayName": "Unapplied Cash Bill Payment Expense", "required": false, "type": "String", "value": "Expense.Expense.UnappliedCashBillPaymentExpense"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Amortization Expense", "required": false, "type": "String", "value": "Expense.Expense.AmortizationExpense"}, {"displayName": "Appropriations To Depreciation", "required": false, "type": "String", "value": "Expense.Expense.AppropriationsToDepreciation"}, {"displayName": "Borrowing Cost", "required": false, "type": "String", "value": "Expense.Expense.BorrowingCost"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Distribution Costs", "required": false, "type": "String", "value": "Expense.Expense.DistributionCosts"}, {"displayName": "External Services", "required": false, "type": "String", "value": "Expense.Expense.ExternalServices"}, {"displayName": "Extraordinary Charges", "required": false, "type": "String", "value": "Expense.Expense.ExtraordinaryCharges"}, {"displayName": "Income Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.IncomeTaxExpense"}, {"displayName": "Loss On Discontinued Operations Net Of Tax", "required": false, "type": "String", "value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax"}, {"displayName": "Management Compensation", "required": false, "type": "String", "value": "Expense.Expense.ManagementCompensation"}, {"displayName": "Other Current Operating Charges", "required": false, "type": "String", "value": "Expense.Expense.OtherCurrentOperatingCharges"}, {"displayName": "Other External Services", "required": false, "type": "String", "value": "Expense.Expense.OtherExternalServices"}, {"displayName": "Other Rental Costs", "required": false, "type": "String", "value": "Expense.Expense.OtherRentalCosts"}, {"displayName": "Other Selling Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherSellingExpenses"}, {"displayName": "Project Studies Surveys Assessments", "required": false, "type": "String", "value": "Expense.Expense.ProjectStudiesSurveysAssessments"}, {"displayName": "Purchases Rebates", "required": false, "type": "String", "value": "Expense.Expense.PurchasesRebates"}, {"displayName": "Shipping And Delivery Expense", "required": false, "type": "String", "value": "Expense.Expense.ShippingAndDeliveryExpense"}, {"displayName": "Staff Costs", "required": false, "type": "String", "value": "Expense.Expense.StaffCosts"}, {"displayName": "Sundry", "required": false, "type": "String", "value": "Expense.Expense.Sundry"}, {"displayName": "Travel Expenses General And Admin Expenses", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses"}, {"displayName": "Travel Expenses Selling Expense", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesSellingExpense"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Expense.Other Expense.Depreciation"}, {"displayName": "Exchange Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.ExchangeGainOrLoss"}, {"displayName": "Other Miscellaneous Expense", "required": false, "type": "String", "value": "Expense.Other Expense.OtherMiscellaneousExpense"}, {"displayName": "Penalties And Settlements", "required": false, "type": "String", "value": "Expense.Other Expense.PenaltiesSettlements"}, {"displayName": "Amortization", "required": false, "type": "String", "value": "Expense.Other Expense.Amortization"}, {"displayName": "Gas And Fuel", "required": false, "type": "String", "value": "Expense.Other Expense.GasAndFuel"}, {"displayName": "Home Office", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOffice"}, {"displayName": "Home Owner Rental Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOwnerRentalInsurance"}, {"displayName": "Other Home Office Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherHomeOfficeExpenses"}, {"displayName": "Mortgage Interest", "required": false, "type": "String", "value": "Expense.Other Expense.MortgageInterest"}, {"displayName": "Rent And Lease", "required": false, "type": "String", "value": "Expense.Other Expense.RentAndLease"}, {"displayName": "Repairs And Maintenance", "required": false, "type": "String", "value": "Expense.Other Expense.RepairsAndMaintenance"}, {"displayName": "Parking And Tolls", "required": false, "type": "String", "value": "Expense.Other Expense.ParkingAndTolls"}, {"displayName": "Vehicle", "required": false, "type": "String", "value": "Expense.Other Expense.Vehicle"}, {"displayName": "Vehicle Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleInsurance"}, {"displayName": "Vehicle Lease", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLease"}, {"displayName": "Vehicle Loan Interest", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoanInterest"}, {"displayName": "Vehicle Loan", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoan"}, {"displayName": "Vehicle Registration", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRegistration"}, {"displayName": "Vehicle Repairs", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRepairs"}, {"displayName": "Other Vehicle Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherVehicleExpenses"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Other Expense.Utilities"}, {"displayName": "Wash And Road Services", "required": false, "type": "String", "value": "Expense.Other Expense.WashAndRoadServices"}, {"displayName": "Deferred Tax Expense", "required": false, "type": "String", "value": "Expense.Other Expense.DeferredTaxExpense"}, {"displayName": "Depletion", "required": false, "type": "String", "value": "Expense.Other Expense.Depletion"}, {"displayName": "Exceptional Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExceptionalItems"}, {"displayName": "Extraordinary Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExtraordinaryItems"}, {"displayName": "Income Tax Other Expense", "required": false, "type": "String", "value": "Expense.Other Expense.IncomeTaxOtherExpense"}, {"displayName": "Mat Credit", "required": false, "type": "String", "value": "Expense.Other Expense.MatCredit"}, {"displayName": "Prior Period Items", "required": false, "type": "String", "value": "Expense.Other Expense.PriorPeriodItems"}, {"displayName": "Tax Roundoff Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.TaxRoundoffGainOrLoss"}, {"displayName": "Equipment Rental - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.EquipmentRentalCos"}, {"displayName": "Other Costs Of Sales - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos"}, {"displayName": "Shipping, Freight And Delivery - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos"}, {"displayName": "Supplies And Materials - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs"}, {"displayName": "Cost Of Labor - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfLaborCos"}, {"displayName": "Cost Of Sales", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfSales"}, {"displayName": "Freight And Delivery Cost", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost"}, {"displayName": "Non Profit Income", "required": false, "type": "String", "value": "Income.Income.NonProfitIncome"}, {"displayName": "Other Primary Income", "required": false, "type": "String", "value": "Income.Income.OtherPrimaryIncome"}, {"displayName": "Sales Of ProductIncome", "required": false, "type": "String", "value": "Income.Income.SalesOfProductIncome"}, {"displayName": "Service Fee Income", "required": false, "type": "String", "value": "Income.Income.ServiceFeeIncome"}, {"displayName": "Discounts Refunds Given", "required": false, "type": "String", "value": "Income.Income.DiscountsRefundsGiven"}, {"displayName": "Unapplied Cash Payment Income", "required": false, "type": "String", "value": "Income.Income.UnappliedCashPaymentIncome"}, {"displayName": "Cash Receipt Income", "required": false, "type": "String", "value": "Income.Income.CashReceiptIncome"}, {"displayName": "Operating Grants", "required": false, "type": "String", "value": "Income.Income.OperatingGrants"}, {"displayName": "Other Current Operating Income", "required": false, "type": "String", "value": "Income.Income.OtherCurrentOperatingIncome"}, {"displayName": "Own Work Capitalized", "required": false, "type": "String", "value": "Income.Income.OwnWorkCapitalized"}, {"displayName": "Revenue General", "required": false, "type": "String", "value": "Income.Income.RevenueGeneral"}, {"displayName": "Sales Retail", "required": false, "type": "String", "value": "Income.Income.SalesRetail"}, {"displayName": "Sales Wholesale", "required": false, "type": "String", "value": "Income.Income.SalesWholesale"}, {"displayName": "Savings By Tax Scheme", "required": false, "type": "String", "value": "Income.Income.SavingsByTaxScheme"}, {"displayName": "Dividend Income", "required": false, "type": "String", "value": "Income.Other Income.DividendIncome"}, {"displayName": "Interest Earned", "required": false, "type": "String", "value": "Income.Other Income.InterestEarned"}, {"displayName": "Other Investment Income", "required": false, "type": "String", "value": "Income.Other Income.OtherInvestmentIncome"}, {"displayName": "Other Miscellaneous Income", "required": false, "type": "String", "value": "Income.Other Income.OtherMiscellaneousIncome"}, {"displayName": "Tax Exempt Interest", "required": false, "type": "String", "value": "Income.Other Income.TaxExemptInterest"}, {"displayName": "Gain Loss On Sale Of Fixed Assets", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfFixedAssets"}, {"displayName": "Gain Loss On Sale Of Investments", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfInvestments"}, {"displayName": "Loss On Disposal Of Assets", "required": false, "type": "String", "value": "Income.Other Income.LossOnDisposalOfAssets"}, {"displayName": "Other Operating Income", "required": false, "type": "String", "value": "Income.Other Income.OtherOperatingIncome"}, {"displayName": "Unrealised Loss On Securities Net Of Tax", "required": false, "type": "String", "value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.Accounts Payable.AccountsPayable"}, {"displayName": "Outstanding Dues Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise"}, {"displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.Credit Card.CreditCard"}, {"displayName": "Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.NotesPayable"}, {"displayName": "Other Long Term Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermLiabilities"}, {"displayName": "Shareholder Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.ShareholderNotesPayable"}, {"displayName": "Accruals And Deferred Income", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccrualsAndDeferredIncome"}, {"displayName": "Accrued Long Lerm Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedLongLermLiabilities"}, {"displayName": "Accrued Vacation Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedVacationPayable"}, {"displayName": "Bank Loans", "required": false, "type": "String", "value": "Liability.Long Term Liability.BankLoans"}, {"displayName": "Debts Related To Participating Interests", "required": false, "type": "String", "value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests"}, {"displayName": "Deferred Tax Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.DeferredTaxLiabilities"}, {"displayName": "Government And Other Public Authorities", "required": false, "type": "String", "value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities"}, {"displayName": "Group And Associates", "required": false, "type": "String", "value": "Liability.Long Term Liability.GroupAndAssociates"}, {"displayName": "Liabilities Related To Assets Held For Sale", "required": false, "type": "String", "value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale"}, {"displayName": "Long Term Borrowings", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermBorrowings"}, {"displayName": "Long Term Debit", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermDebit"}, {"displayName": "Long Term Employee Benefit Obligations", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations"}, {"displayName": "Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases"}, {"displayName": "Other Long Term Provisions", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermProvisions"}, {"displayName": "Provision For Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionForLiabilities"}, {"displayName": "Provisions Non Current Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities"}, {"displayName": "Staff And Related Long Term Liability Accounts", "required": false, "type": "String", "value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts"}, {"displayName": "Direct Deposit Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DirectDepositPayable"}, {"displayName": "Line Of Credit", "required": false, "type": "String", "value": "Liability.Other Current Liability.LineOfCredit"}, {"displayName": "Loan Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.LoanPayable"}, {"displayName": "Global Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxPayable"}, {"displayName": "Global Tax Suspense", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxSuspense"}, {"displayName": "Other Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.OtherCurrentLiabilities"}, {"displayName": "Payroll Clearing", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollClearing"}, {"displayName": "Payroll Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollTaxPayable"}, {"displayName": "Prepaid Expenses Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PrepaidExpensesPayable"}, {"displayName": "Rents In Trust Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.RentsInTrustLiability"}, {"displayName": "Trust Accounts Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.TrustAccountsLiabilities"}, {"displayName": "Federal Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.FederalIncomeTaxPayable"}, {"displayName": "Insurance Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.InsurancePayable"}, {"displayName": "Sales Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.SalesTaxPayable"}, {"displayName": "State Local Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable"}, {"displayName": "Accrued Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.AccruedLiabilities"}, {"displayName": "Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentLiabilities"}, {"displayName": "Current Portion EmployeeBenefits Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations"}, {"displayName": "Current Portion Of Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases"}, {"displayName": "Current Tax Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentTaxLiability"}, {"displayName": "Dividends Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DividendsPayable"}, {"displayName": "Duties And Taxes", "required": false, "type": "String", "value": "Liability.Other Current Liability.DutiesAndTaxes"}, {"displayName": "Interest Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.InterestPayables"}, {"displayName": "Provision For Warranty Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionForWarrantyObligations"}, {"displayName": "Provisions Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities"}, {"displayName": "Short Term Borrowings", "required": false, "type": "String", "value": "Liability.Other Current Liability.ShortTermBorrowings"}, {"displayName": "Social Security Agencies", "required": false, "type": "String", "value": "Liability.Other Current Liability.SocialSecurityAgencies"}, {"displayName": "Staff And Related Liability Accounts", "required": false, "type": "String", "value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts"}, {"displayName": "Sundry Debtors And Creditors", "required": false, "type": "String", "value": "Liability.Other Current Liability.SundryDebtorsAndCreditors"}, {"displayName": "Trade And Other Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.TradeAndOtherPayables"}, {"displayName": "Opening Balance Equity", "required": false, "type": "String", "value": "Equity.Equity.OpeningBalanceEquity"}, {"displayName": "Partners Equity", "required": false, "type": "String", "value": "Equity.Equity.PartnersEquity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Accumulated Adjustment", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedAdjustment"}, {"displayName": "Owners Equity", "required": false, "type": "String", "value": "Equity.Equity.OwnersEquity"}, {"displayName": "Paid In Capital Or Surplus", "required": false, "type": "String", "value": "Equity.Equity.PaidInCapitalOrSurplus"}, {"displayName": "Partner Contributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerContributions"}, {"displayName": "Partner Distributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerDistributions"}, {"displayName": "Preferred Stock", "required": false, "type": "String", "value": "Equity.Equity.PreferredStock"}, {"displayName": "Common Stock", "required": false, "type": "String", "value": "Equity.Equity.CommonStock"}, {"displayName": "Treasury Stock", "required": false, "type": "String", "value": "Equity.Equity.TreasuryStock"}, {"displayName": "Estimated Taxes", "required": false, "type": "String", "value": "Equity.Equity.EstimatedTaxes"}, {"displayName": "Healthcare", "required": false, "type": "String", "value": "Equity.Equity.Healthcare"}, {"displayName": "Personal Income", "required": false, "type": "String", "value": "Equity.Equity.PersonalIncome"}, {"displayName": "Personal Expense", "required": false, "type": "String", "value": "Equity.Equity.PersonalExpense"}, {"displayName": "Accumulated Other Comprehensive Income", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedOtherComprehensiveIncome"}, {"displayName": "Called Up Share Capital", "required": false, "type": "String", "value": "Equity.Equity.CalledUpShareCapital"}, {"displayName": "Capital Reserves", "required": false, "type": "String", "value": "Equity.Equity.CapitalReserves"}, {"displayName": "Dividend Disbursed", "required": false, "type": "String", "value": "Equity.Equity.DividendDisbursed"}, {"displayName": "Equity In Earnings Of Subsiduaries", "required": false, "type": "String", "value": "Equity.Equity.EquityInEarningsOfSubsiduaries"}, {"displayName": "Investment Grants", "required": false, "type": "String", "value": "Equity.Equity.InvestmentGrants"}, {"displayName": "Money Received Against Share Warrants", "required": false, "type": "String", "value": "Equity.Equity.MoneyReceivedAgainstShareWarrants"}, {"displayName": "Other Free Reserves", "required": false, "type": "String", "value": "Equity.Equity.OtherFreeReserves"}, {"displayName": "Share Application Money Pending Allotment", "required": false, "type": "String", "value": "Equity.Equity.ShareApplicationMoneyPendingAllotment"}, {"displayName": "Share Capital", "required": false, "type": "String", "value": "Equity.Equity.ShareCapital"}, {"displayName": "Funds", "required": false, "type": "String", "value": "Equity.Equity.Funds"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Should not be longer than 200 characters.", "field": "Name"}], "warnings": []}}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Should be a number between 1 and 99999999.", "field": "NominalCode"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Sales", "required": false, "type": "String", "value": "SALES"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "OTHER_INCOME"}, {"displayName": "Direct Expenses", "required": false, "type": "String", "value": "DIRECT_EXPENSES"}, {"displayName": "Overheads", "required": false, "type": "String", "value": "OVERHEADS"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "DEPRECIATION"}, {"displayName": "Current Assets", "required": false, "type": "String", "value": "CURRENT_ASSETS"}, {"displayName": "Fixed Assets", "required": false, "type": "String", "value": "FIXED_ASSETS"}, {"displayName": "Future Assets", "required": false, "type": "String", "value": "FUTURE_ASSETS"}, {"displayName": "Bank", "required": false, "type": "String", "value": "BANK"}, {"displayName": "Current Liability", "required": false, "type": "String", "value": "CURRENT_LIABILITY"}, {"displayName": "Future Liability", "required": false, "type": "String", "value": "FUTURE_LIABILITY"}, {"displayName": "Equity", "required": false, "type": "String", "value": "EQUITY"}, {"displayName": "Credit Card / Loan", "required": false, "type": "String", "value": "LINE_OF_CREDIT"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be unique within the entity.", "field": "NominalCode"}, {"details": "Must be at most 24 characters in length, although restrictions may vary between entities.", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "type": {"description": "The type, or base category, of the account", "displayName": "Account Type", "options": [{"displayName": "Asset", "required": false, "type": "String", "value": "Asset"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income"}, {"displayName": "Liability", "required": false, "type": "String", "value": "Liability"}], "required": true, "type": "String"}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "required": true, "type": "String", "validation": {"information": [{"details": "Any category that is part of the hierarchy of one of: 'Assets', 'Equity', 'Liabilities', 'Total Expenses' and 'Total Income' is permitted.", "field": "FullyQualifiedCategory"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String"}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String"}, "description": {"description": "Description of the account", "displayName": "Description", "required": true, "type": "String"}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "required": true, "type": "String"}, "fullyQualifiedName": {"description": "The full name of the account e.g. Liability.Current.VAT or Income.Revenue.Sales", "displayName": "Fully Qualified Name", "required": true, "type": "String"}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": true, "type": "String"}, "currentBalance": {"description": "The current balance in the account", "displayName": "Current Balance", "required": true, "type": "Number"}, "type": {"description": "The type, or base category, of the account", "displayName": "Account Type", "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "required": true, "type": "String"}, "isBankAccount": {"description": "Confirms whether the nominal account represents a bank account or not", "displayName": "Is Bank Account?", "required": true, "type": "Boolean"}, "validDatatypeLinks": {"description": "Describes which fields on other data types are valid links to this account in the originating system", "displayName": "Valid Datatype Links", "required": true, "type": "Array"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "Identifier for the nominal account.", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 10 characters.", "field": "NominalCode"}]}}, "name": {"description": "Name of account as it appears in the chart of accounts or general ledger.", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Payments are enabled to this account if the name ends in .PaymentsEnabled.", "field": "Name"}], "warnings": []}}, "description": {"description": "Description for the nominal account.", "displayName": "Description", "required": false, "type": "String"}, "fullyQualifiedCategory": {"description": "Account type and category for nominal account.", "displayName": "Fully Qualified Category", "options": [{"displayName": "Current Asset", "required": false, "type": "String", "value": "Asset.Current"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.Fixed"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Inventory"}, {"displayName": "Non-current Asset", "required": false, "type": "String", "value": "Asset.NonCurrent"}, {"displayName": "Prepayment", "required": false, "type": "String", "value": "Asset.Prepayment"}, {"displayName": "Direct Costs", "required": false, "type": "String", "value": "Expense.DirectCosts"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "Overhead", "required": false, "type": "String", "value": "Expense.Overhead"}, {"displayName": "Superannuation", "required": false, "type": "String", "value": "Expense.Superannuation"}, {"displayName": "Wages", "required": false, "type": "String", "value": "Expense.Wages"}, {"displayName": "Sales", "required": false, "type": "String", "value": "Income.Sales"}, {"displayName": "Revenue", "required": false, "type": "String", "value": "Income.Revenue"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "Income.Other"}, {"displayName": "Current Liability", "required": false, "type": "String", "value": "Liability.Current"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Liability.Depreciation"}, {"displayName": "Liability", "required": false, "type": "String", "value": "Liability.Liability"}, {"displayName": "Non Current Liability", "required": false, "type": "String", "value": "Liability.NonCurrent"}, {"displayName": "Pay As You Go Liability", "required": false, "type": "String", "value": "Liability.PayAsYouGo"}, {"displayName": "Superannuation Liability", "required": false, "type": "String", "value": "Liability.Superannuation"}, {"displayName": "Wages Payable Liability", "required": false, "type": "String", "value": "Liability.WagesPayable"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity.Equity"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-customer: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contacts": [{"modifiedDate": "2022-10-23T00:00:00Z", "phone": [{"number": "+44 25691 154789", "type": "Primary"}], "status": "Archived"}], "defaultCurrency": "EUR", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-customer: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "contacts": [{"address": {"city": "Hortenseville", "country": "United Kingdom", "line1": "Apt. 145", "line2": "317 Williamson Freeway", "postalCode": "CV4 2HR", "region": "Scotland", "type": "Delivery"}, "email": "Werner_Langworth@hotmail.com", "name": "Werner Langworth", "phone": [], "status": "Active"}, {"address": {"city": "South Ali", "country": "United Kingdom", "line1": "Suite 075", "line2": "9921 Dickens Walk", "postalCode": "TI04 4OO", "region": "Scotland", "type": "Delivery"}, "email": "Belle51@yahoo.com", "name": "Belle Glover", "phone": [], "status": "Active"}], "customerName": "Arjun Kuvalis", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "c8180244-74ac-40cf-a5df-6d83661c44d7", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "phone": "014605 64820", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "2022-07-03T01:27:00", "status": "Active", "taxNumber": "7505220209.583549"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "contacts": [{"address": {"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}, "email": "", "name": "", "phone": [], "status": "Active"}], "customerName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "0e2f7751-7696-ed11-bff5-6045bd0d2ad6", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "phone": "", "sourceModifiedDate": "2023-01-17T14:50:54Z", "status": "Active", "taxNumber": ""} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"country": "NL", "type": "Billing"}], "contacts": [], "customerName": "Ab Netherlands", "defaultCurrency": "EUR", "id": "555f8251-c65a-433a-a813-5dbe04321d1e", "modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-14T15:26:37Z", "status": "Active"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "GB", "line1": "Ink Rooms", "postalCode": "WC1X 0BE", "type": "Billing"}], "contacts": [], "customerName": "Abdi 99", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "5f20075a-a28e-434d-81a6-2db0dc170e87", "modifiedDate": "2022-10-26T13:33:08Z", "registrationNumber": "123456789", "sourceModifiedDate": "2020-02-26T11:23:50Z", "status": "Active", "taxNumber": "GB339 0727 47"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}, "name": "Test 1", "phone": [], "status": "Unknown"}], "customerName": "-", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-17T06:02:46Z", "status": "Active"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [{"city": "Some city", "country": "Country 1", "line1": "Line 1", "line2": "Line 2", "postalCode": "SW1 2JQ", "region": "A region", "type": "Billing"}], "contactName": "test person name", "contacts": [{"email": "test14A@example.com", "name": "test person1", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"email": "test14B@example.com", "name": "test person2", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "987654321", "type": "Unknown"}], "status": "Active"}, {"email": "test14@example.com", "name": "test person name", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "customerName": "A test customer 14 (updated)", "defaultCurrency": "GBP", "emailAddress": "test14@example.com", "id": "634509", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "phone": "01876 541245", "sourceModifiedDate": "2022-05-18T09:23:56", "status": "Active"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "contacts": [{"email": "", "name": "", "phone": [], "status": "Active"}], "customerName": "Chekko Customer Test 01", "emailAddress": "", "id": "92227673", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "0001-01-01T00:00:00", "status": "Active", "taxNumber": ""} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [], "contactName": "Mr Test Customer", "contacts": [], "customerName": "119 Test Customer", "defaultCurrency": "GBP", "id": "773", "modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-01-11T12:28:49", "status": "Active"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [{"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Delivery"}, {"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"email": "kristy@samplename.com", "name": "Abercrombie, Kristy", "phone": [{"number": "415-555-6579", "type": "Primary"}], "status": "Active"}, {"name": "Kristy Abercrombie", "phone": [], "status": "Active"}, {"name": "Steve Darcangelo", "phone": [], "status": "Active"}], "customerName": "Abercrombie, Kristy", "defaultCurrency": "GBP", "emailAddress": "kristy@samplename.com", "id": "150000-933272658", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:55Z", "phone": "415-555-6579", "sourceModifiedDate": "2023-12-16T05:06:42", "status": "Active"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [], "contactName": "Abraham's Company", "contacts": [{"email": "ab@email.com", "name": "Abe", "phone": [{"number": "01111111111", "type": "Mobile"}], "status": "Active"}], "customerName": "Abe", "defaultCurrency": "GBP", "emailAddress": "ab@email.com", "id": "9", "modifiedDate": "2023-01-18T11:02:35Z", "registrationNumber": "XXXX9900001", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "taxNumber": "XXXX9900001"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [{"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"address": {"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}, "name": "Abercrombie International Group (deleted)", "phone": [], "status": "Archived"}], "customerName": "Abercrombie International Group", "defaultCurrency": "GBP", "id": "66", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2016-09-12T18:53:19Z", "status": "Archived"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [{"city": "Blackpool", "country": "", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "Great Britain", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Billing"}], "contactName": "Lee Dalkin", "contacts": [{"email": "newbusinessadvice@sage.com", "name": "Lee Dalkin", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"email": "", "name": "Malcolm Leverret", "phone": [], "status": "Active"}, {"email": "Jim@a1designservices.co.uk", "name": "Jim Thomas", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"email": "Jullian@a1designservices.co.uk", "name": "Jullian Plawsworth", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "modifiedDate": "2022-10-14T09:35:53Z", "phone": "01742 876 234", "registrationNumber": "", "sourceModifiedDate": "2022-04-27T15:17:36Z", "status": "Active", "taxNumber": "GB238 3839 38"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [{"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "GB", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Unknown"}], "contactName": "Ian Cairns", "contacts": [], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:41Z", "phone": "01742 876 234", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "taxNumber": "GB238 3839 38"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [{"city": "Aruba City", "country": "Aruba (AW)", "line1": "Aruba Address line 1", "line2": "Aruba Address line 2", "postalCode": "Aruba Post", "region": "Aruba Province", "type": "Billing"}], "contactName": "Main Contact", "contacts": [{"phone": [{"number": "contact mobile number", "type": "Mobile"}, {"number": "contact fax number", "type": "Fax"}], "status": "Unknown"}], "customerName": "100 test name", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "260f6a3f94a243738f2d5e08496a41a8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "contact phone number", "sourceModifiedDate": "2021-05-10T16:31:51Z", "status": "Active"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [{"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}], "contactName": "Yuna Conn", "contacts": [{"address": {"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}, "name": "Conn, Yuna", "phone": [{"number": "520-393-4468", "type": "Primary"}], "status": "Unknown"}], "customerName": "33Across", "defaultCurrency": "USD", "id": "188", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:21Z", "phone": "520-393-4468", "sourceModifiedDate": "2022-09-06T12:58:27", "status": "Active", "taxNumber": ""} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "contacts": [], "customerName": "ABC Textiles", "defaultCurrency": "USD", "emailAddress": "c.taylor@codat.io", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4", "modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2019-10-17T07:59:04Z", "status": "Active"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "7110701885" + responses: + "200": + application/json: {"addresses": [], "contacts": [], "customerName": "24 Locks", "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [], "contactName": "Contact (First Name) Contact (Last Name)", "contacts": [{"email": "contactperson@whateveryouwantidontcare12345.com", "name": "Contact (First Name) Contact (Last Name)", "phone": [{"number": "Work Phone", "type": "Landline"}, {"number": "Mobile", "type": "Mobile"}], "status": "Active"}], "customerName": "A B", "defaultCurrency": "GBP", "emailAddress": "contactperson@whateveryouwantidontcare12345.com", "id": "104957000000032105", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "Work Phone", "sourceModifiedDate": "2022-06-09T14:36:47", "status": "Active"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + customerId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-customers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "contacts": [{"address": {"city": "Hortenseville", "country": "United Kingdom", "line1": "Apt. 145", "line2": "317 Williamson Freeway", "postalCode": "CV4 2HR", "region": "Scotland", "type": "Delivery"}, "email": "Werner_Langworth@hotmail.com", "name": "Werner Langworth", "phone": [], "status": "Active"}, {"address": {"city": "South Ali", "country": "United Kingdom", "line1": "Suite 075", "line2": "9921 Dickens Walk", "postalCode": "TI04 4OO", "region": "Scotland", "type": "Delivery"}, "email": "Belle51@yahoo.com", "name": "Belle Glover", "phone": [], "status": "Active"}], "customerName": "Arjun Kuvalis", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "c8180244-74ac-40cf-a5df-6d83661c44d7", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "phone": "014605 64820", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "2022-07-03T01:27:00", "status": "Active", "taxNumber": "7505220209.583549"}, {"addresses": [{"city": "East Khalid", "country": "United Kingdom", "line1": "Apt. 184", "line2": "60578 Louie Springs", "postalCode": "XW89 7NT", "region": "Wales", "type": "Billing"}], "contactName": "Miguel Hahn", "contacts": [{"address": {"city": "Reingerton", "country": "United Kingdom", "line1": "Suite 400", "line2": "21930 Milan Lane", "postalCode": "QG10 2DL", "region": "Wales", "type": "Delivery"}, "email": "Miguel.Hahn@gmail.com", "name": "Miguel Hahn", "phone": [{"number": "018555 09614", "type": "Landline"}], "status": "Active"}], "customerName": "Breitenberg, Emard and Schiller", "defaultCurrency": "GBP", "emailAddress": "contact@BreitenbergEmardandSchiller.biz", "id": "6d162ee4-47b4-46c6-a2e6-aa9edd0fe6b0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "phone": "0800 445 6957", "registrationNumber": "KME0AMIL", "sourceModifiedDate": "2022-12-03T11:05:01", "status": "Archived", "taxNumber": "8560920952.553111"}], "totalResults": 20} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "contacts": [{"address": {"city": "", "country": "", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}, "email": "", "name": "", "phone": [], "status": "Active"}], "customerName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "0e2f7751-7696-ed11-bff5-6045bd0d2ad6", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "phone": "", "sourceModifiedDate": "2023-01-17T14:50:54Z", "status": "Active", "taxNumber": ""}, {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "contacts": [{"address": {"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}, "email": "", "name": "", "phone": [], "status": "Active"}], "customerName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "0ef95175-48c4-eb11-9f0a-0022481b4343", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "phone": "", "sourceModifiedDate": "2021-06-03T08:48:36Z", "status": "Active", "taxNumber": ""}], "totalResults": 42} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "NL", "type": "Billing"}], "contacts": [], "customerName": "Ab Netherlands", "defaultCurrency": "EUR", "id": "555f8251-c65a-433a-a813-5dbe04321d1e", "modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-14T15:26:37Z", "status": "Active"}, {"addresses": [{"country": "NL", "type": "Billing"}], "contacts": [], "customerName": "anna test 2", "defaultCurrency": "EUR", "id": "9fd1f78e-67aa-4af7-8a10-df1fc5fb5841", "modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2022-05-24T11:53:21Z", "status": "Active"}], "totalResults": 71} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "GB", "line1": "Ink Rooms", "postalCode": "WC1X 0BE", "type": "Billing"}], "contacts": [], "customerName": "Abdi 99", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "5f20075a-a28e-434d-81a6-2db0dc170e87", "modifiedDate": "2022-10-26T13:33:08Z", "registrationNumber": "123456789", "sourceModifiedDate": "2020-02-26T11:23:50Z", "status": "Active", "taxNumber": "GB339 0727 47"}, {"addresses": [{"country": "GB", "type": "Billing"}], "contactName": "abeee", "contacts": [{"address": {"country": "GB ", "line1": "", "type": "Unknown"}, "modifiedDate": "2020-02-24T12:00:51.027Z", "name": "abeee", "phone": [], "status": "Active"}], "customerName": "Abdulbasit Al-haj", "defaultCurrency": "GBP", "emailAddress": "a.alhaj@codat.io", "id": "1d9dc1a7-92d6-441b-93fd-42c9fb321b1c", "modifiedDate": "2022-10-26T13:33:08Z", "sourceModifiedDate": "2020-02-24T12:00:50Z", "status": "Active"}], "totalResults": 53} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}, "name": "Test 1", "phone": [], "status": "Unknown"}], "customerName": "-", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-17T06:02:46Z", "status": "Active"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}, "name": "Test 1", "phone": [], "status": "Unknown"}], "customerName": "-", "id": "9677150", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-24T06:19:23Z", "status": "Active"}], "totalResults": 159} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Some city", "country": "Country 1", "line1": "Line 1", "line2": "Line 2", "postalCode": "SW1 2JQ", "region": "A region", "type": "Billing"}], "contactName": "test person name", "contacts": [{"email": "test14A@example.com", "name": "test person1", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"email": "test14B@example.com", "name": "test person2", "phone": [{"number": "1234 56789", "type": "Primary"}, {"number": "9876 54321", "type": "Unknown"}], "status": "Active"}, {"email": "test14@example.com", "name": "test person name", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "customerName": "A test customer 14 (updated)", "defaultCurrency": "GBP", "emailAddress": "test14@example.com", "id": "634509", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "phone": "01876 541245", "sourceModifiedDate": "2022-05-18T09:23:56", "status": "Active"}, {"addresses": [{"city": "Some city", "country": "Country 1", "line1": "Line 1", "line2": "Line 2", "postalCode": "SW1 2JQ", "region": "A region", "type": "Billing"}], "contactName": "test person name", "contacts": [{"email": "test9@example.com", "name": "test person1", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"email": "test10@example.com", "name": "test person2", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "987654321", "type": "Unknown"}], "status": "Active"}, {"email": "test8@example.com", "name": "test person name", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "customerName": "A test customer name 2", "defaultCurrency": "GBP", "emailAddress": "test8@example.com", "id": "634486", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "phone": "01876 541245", "sourceModifiedDate": "2022-05-11T11:39:58", "status": "Active"}], "totalResults": 39} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "contacts": [{"email": "", "name": "", "phone": [], "status": "Active"}], "customerName": "Chekko Customer Test 01", "emailAddress": "", "id": "92227673", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "0001-01-01T00:00:00", "status": "Active", "taxNumber": ""}, {"addresses": [{"city": "Billing line 4", "country": "United Kingdom", "line1": "Billing Address", "line2": "Billing line 2 Billing line 3", "postalCode": "123321", "type": "Billing"}, {"city": "Delivery line4", "country": "United Kingdom", "line1": "Delivery Address", "line2": "Delivery line2 Delivery line3", "postalCode": "123321", "type": "Delivery"}], "contactName": "Mr Diogo Sousa", "contacts": [{"address": {"city": "Billing line 4", "country": "United Kingdom", "line1": "Billing Address", "line2": "Billing line 2 Billing line 3", "postalCode": "123321", "type": "Billing"}, "email": "diogomail@mail.com", "name": "Mr Diogo Sousa", "phone": [{"number": "123123123", "type": "Landline"}, {"number": "321321321", "type": "Mobile"}], "status": "Active"}, {"address": {"city": "Delivery line4", "country": "United Kingdom", "line1": "Delivery Address", "line2": "Delivery line2 Delivery line3", "postalCode": "123321", "type": "Delivery"}, "name": "Mr Diogo Sousa", "phone": [], "status": "Active"}], "customerName": "Diogo Sousa", "emailAddress": "diogomail@mail.com", "id": "88459410", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "123123123", "sourceModifiedDate": "2021-05-04T13:22:19", "status": "Active", "taxNumber": ""}], "totalResults": 10} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Mr Test Customer", "contacts": [], "customerName": "119 Test Customer", "defaultCurrency": "GBP", "id": "773", "modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-01-11T12:28:49", "status": "Active"}, {"addresses": [], "contactName": "European Company", "contacts": [], "customerName": "1248 European Company", "defaultCurrency": "GBP", "id": "172722", "modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-07-27T14:29:16", "status": "Active"}], "totalResults": 4} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Delivery"}, {"city": "Bayshore", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "postalCode": "94326", "region": "CA", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"email": "kristy@samplename.com", "name": "Abercrombie, Kristy", "phone": [{"number": "415-555-6579", "type": "Primary"}], "status": "Active"}, {"name": "Kristy Abercrombie", "phone": [], "status": "Active"}, {"name": "Steve Darcangelo", "phone": [], "status": "Active"}], "customerName": "Abercrombie, Kristy", "defaultCurrency": "GBP", "emailAddress": "kristy@samplename.com", "id": "150000-933272658", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:55Z", "phone": "415-555-6579", "sourceModifiedDate": "2023-12-16T05:06:42", "status": "Active"}, {"addresses": [{"city": "Millbrae", "line1": "Robert Allard", "line2": "92834 Chandler St.", "postalCode": "94030", "region": "CA", "type": "Delivery"}, {"city": "Millbrae", "line1": "Robert Allard", "line2": "92834 Chandler St.", "postalCode": "94030", "region": "CA", "type": "Billing"}], "contactName": "Amanda Roberts", "contacts": [{"email": "rallard@myemail.com", "name": "Allard, Robert", "phone": [{"number": "650-555-3422", "type": "Primary"}, {"number": "650-555-9804", "type": "Fax"}, {"number": "650-555-8349", "type": "Unknown"}], "status": "Active"}, {"name": "Robert Allard", "phone": [], "status": "Active"}, {"name": "Rachel Fisher", "phone": [], "status": "Active"}], "customerName": "Allard, Robert", "defaultCurrency": "GBP", "emailAddress": "rallard@myemail.com", "id": "800000D0-1182061376", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:07:55Z", "phone": "650-555-3422", "sourceModifiedDate": "2023-12-16T05:06:42", "status": "Active"}], "totalResults": 64} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Abraham's Company", "contacts": [{"email": "ab@email.com", "name": "Abe", "phone": [{"number": "01111111111", "type": "Mobile"}], "status": "Active"}], "customerName": "Abe", "defaultCurrency": "GBP", "emailAddress": "ab@email.com", "id": "9", "modifiedDate": "2023-01-18T11:02:35Z", "registrationNumber": "XXXX9900001", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "taxNumber": "XXXX9900001"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "4 Privet Drive", "postalCode": "WD25 7LR", "type": "Billing"}, {"city": "London", "country": "United Kingdom", "line1": "4 Privet Drive", "postalCode": "WD25 7LR", "type": "Delivery"}], "contactName": "Adeel test", "contacts": [{"address": {"city": "London", "country": "United Kingdom", "line1": "4 Privet Drive", "postalCode": "WD25 7LR", "type": "Billing"}, "email": "adeel@adeel.com", "name": "Adeel test", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "07546543216", "type": "Mobile"}], "status": "Active"}], "customerName": "adeel qbo child test", "defaultCurrency": "GBP", "emailAddress": "adeel@adeel.com", "id": "49", "modifiedDate": "2023-01-18T11:02:35Z", "phone": "123456789", "sourceModifiedDate": "2022-08-22T09:21:09Z", "status": "Active"}], "totalResults": 40} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}], "contactName": "Kristy Abercrombie", "contacts": [{"address": {"city": "New York, NY", "line1": "123 Main St", "type": "Billing"}, "name": "Abercrombie International Group (deleted)", "phone": [], "status": "Archived"}], "customerName": "Abercrombie International Group", "defaultCurrency": "GBP", "id": "66", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2016-09-12T18:53:19Z", "status": "Archived"}, {"addresses": [{"type": "Billing"}, {"type": "Delivery"}], "contactName": "Natalie Watts", "contacts": [{"address": {"type": "Billing"}, "email": "n.watts@google.com", "name": "Abercrombie International Group", "phone": [], "status": "Active"}], "customerName": "Abercrombie International Group", "defaultCurrency": "USD", "emailAddress": "n.watts@google.com", "id": "67", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:56Z", "registrationNumber": "XXXXVat123456", "sourceModifiedDate": "2023-03-29T01:12:55Z", "status": "Active", "taxNumber": "XXXXVat123456"}], "totalResults": 243} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Blackpool", "country": "", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "Great Britain", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Billing"}], "contactName": "Lee Dalkin", "contacts": [{"email": "newbusinessadvice@sage.com", "name": "Lee Dalkin", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"email": "", "name": "Malcolm Leverret", "phone": [], "status": "Active"}, {"email": "Jim@a1designservices.co.uk", "name": "Jim Thomas", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"email": "Jullian@a1designservices.co.uk", "name": "Jullian Plawsworth", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "modifiedDate": "2022-10-14T09:35:53Z", "phone": "01742 876 234", "registrationNumber": "", "sourceModifiedDate": "2022-04-27T15:17:36Z", "status": "Active", "taxNumber": "GB238 3839 38"}, {"addresses": [{"city": "Blackpool", "country": "Great Britain", "line1": "77a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Billing"}], "contactName": "Lee Dalkin", "contacts": [{"email": "newbusinessadvice@sage.com", "name": "Lee Dalkin", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"email": "", "name": "Malcolm Leverret", "phone": [], "status": "Active"}, {"email": "Jim@a1designservices.co.uk", "name": "Jim Thomas", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"email": "Jullian@a1designservices.co.uk", "name": "Jullian Plawsworth", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "customerName": "A2 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D002", "modifiedDate": "2022-10-14T09:35:53Z", "phone": "01742 876 234", "registrationNumber": "", "sourceModifiedDate": "2020-09-23T10:28:58Z", "status": "Active", "taxNumber": "GB238 3839 40"}], "totalResults": 43} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Delivery"}, {"city": "Manchester", "country": "GB", "line1": "23a Union Street", "line2": "", "postalCode": "M2 6JK", "region": "", "type": "Delivery"}, {"city": "Blackpool", "country": "GB", "line1": "67a Station Road", "line2": "", "postalCode": "BP12 7HT", "region": "Lancashire", "type": "Unknown"}], "contactName": "Ian Cairns", "contacts": [], "customerName": "A1 Design Services", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "A1D001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:41Z", "phone": "01742 876 234", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "taxNumber": "GB238 3839 38"}, {"addresses": [{"city": "Whitley Bay", "country": "GB", "line1": "Swanson Industries", "line2": "Dukes Industrial Estate", "postalCode": "NE56 4ER", "region": "North Tyneside", "type": "Delivery"}, {"city": "Hebburn", "country": "GB", "line1": "Unit 34", "line2": "Holystone Ind Estate", "postalCode": "NE31 1VB", "region": "Tyne & Wear", "type": "Delivery"}, {"city": "Hebburn", "country": "GB", "line1": "Unit 34", "line2": "Holystone Ind Estate", "postalCode": "NE31 1VB", "region": "Tyne & Wear", "type": "Unknown"}], "contactName": "Mike Hall", "contacts": [], "customerName": "ABS Garages Ltd", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "ABS001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:41Z", "phone": "0191 254 5909", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "taxNumber": "GB745 4584 68"}], "totalResults": 30} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Aruba City", "country": "Aruba (AW)", "line1": "Aruba Address line 1", "line2": "Aruba Address line 2", "postalCode": "Aruba Post", "region": "Aruba Province", "type": "Billing"}], "contactName": "Main Contact", "contacts": [{"phone": [{"number": "contact mobile number", "type": "Mobile"}, {"number": "contact fax number", "type": "Fax"}], "status": "Unknown"}], "customerName": "100 test name", "defaultCurrency": "GBP", "emailAddress": "email@codat.io", "id": "260f6a3f94a243738f2d5e08496a41a8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "contact phone number", "sourceModifiedDate": "2021-05-10T16:31:51Z", "status": "Active"}, {"addresses": [{"city": "POST - Aruba City", "country": "Aruba (AW)", "line1": "POST - Aruba Address line 1", "line2": "POST - Aruba Address line 2", "postalCode": "Aruba Post", "region": "Aruba Province", "type": "Billing"}], "contactName": "Main Contact", "contacts": [], "customerName": "100 test name DS", "defaultCurrency": "GBP", "emailAddress": "DCemail@codat.io", "id": "44a5d9461d9e4f6d90a5ace251c5cf35", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "contact phone number", "sourceModifiedDate": "2021-06-10T14:22:46Z", "status": "Active"}], "totalResults": 168} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}], "contactName": "Yuna Conn", "contacts": [{"address": {"city": "Albuquerque", "country": "United States", "line1": "155 Westend Point", "line2": "", "postalCode": "87140", "region": "NM", "type": "Unknown"}, "name": "Conn, Yuna", "phone": [{"number": "520-393-4468", "type": "Primary"}], "status": "Unknown"}], "customerName": "33Across", "defaultCurrency": "USD", "id": "188", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:21Z", "phone": "520-393-4468", "sourceModifiedDate": "2022-09-06T12:58:27", "status": "Active", "taxNumber": ""}, {"addresses": [{"city": "Sparwood", "country": "Canada", "line1": "7 Lerdahl Junction", "line2": "", "postalCode": "L4R", "region": "British Columbia", "type": "Unknown"}], "contactName": "Lauri O'Heagertie", "contacts": [{"address": {"city": "Sparwood", "country": "Canada", "line1": "7 Lerdahl Junction", "line2": "", "postalCode": "L4R", "region": "British Columbia", "type": "Unknown"}, "name": "O'Heagertie, Lauri", "phone": [{"number": "410-309-3976", "type": "Primary"}], "status": "Unknown"}], "customerName": "3Way International Logistics", "defaultCurrency": "CAD", "id": "324", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:21Z", "phone": "410-309-3976", "sourceModifiedDate": "2020-10-20T05:01:49", "status": "Active", "taxNumber": ""}], "totalResults": 530} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "contacts": [], "customerName": "ABC Textiles", "defaultCurrency": "USD", "emailAddress": "c.taylor@codat.io", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4", "modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2019-10-17T07:59:04Z", "status": "Active"}, {"addresses": [{"city": "Coffee City", "country": "United Kingdom", "line1": "11 Coffee Lane", "line2": "Coffee Town", "postalCode": "CC1 1CC", "region": "Hampshire", "type": "Billing"}], "contactName": "Coffee Carl", "contacts": [{"name": "Coffee Carl", "phone": [{"number": "07733", "type": "Mobile"}], "status": "Active"}], "customerName": "Coffee Cart", "defaultCurrency": "GBP", "emailAddress": "coffee.cart@example.com", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjM3MTUzNDI2", "modifiedDate": "2022-11-16T18:15:30Z", "phone": "0201111", "sourceModifiedDate": "2020-03-17T19:12:39Z", "status": "Active"}], "totalResults": 10} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contacts": [], "customerName": "24 Locks", "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active"}, {"addresses": [], "contacts": [], "customerName": "7-Eleven", "emailAddress": "", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active"}], "totalResults": 48} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Contact (First Name) Contact (Last Name)", "contacts": [{"email": "contactperson@whateveryouwantidontcare12345.com", "name": "Contact (First Name) Contact (Last Name)", "phone": [{"number": "Work Phone", "type": "Landline"}, {"number": "Mobile", "type": "Mobile"}], "status": "Active"}], "customerName": "A B", "defaultCurrency": "GBP", "emailAddress": "contactperson@whateveryouwantidontcare12345.com", "id": "104957000000032105", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "Work Phone", "sourceModifiedDate": "2022-06-09T14:36:47", "status": "Active"}, {"addresses": [], "contactName": "John Doe", "contacts": [{"email": "", "name": "John Doe", "phone": [], "status": "Active"}], "customerName": "Doe, John", "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000000054050", "modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-28T15:09:22", "status": "Active"}], "totalResults": 14} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-customer: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customerId: "7110701885" + query: {} + requestBody: + application/json: {"contacts": [{"modifiedDate": "2022-10-23T00:00:00Z", "phone": [{"number": "01224 658 999", "type": "Fax"}], "status": "Active"}, {"modifiedDate": "2022-10-23T00:00:00Z", "phone": [], "status": "Archived"}, {"modifiedDate": "2022-10-23T00:00:00Z", "phone": [{"number": "+44 25691 154789", "type": "Primary"}], "status": "Archived"}], "defaultCurrency": "EUR", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + create-supplier: + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contactName": "Joe Bloggs", "id": "73593", "status": "Active", "supplierName": "test 20230420 1004"} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "621cf021-cd9c-4f54-a033-15211a509a30", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Success", "statusCode": 550483} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-supplier: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"city": "Cesarmouth", "country": "United Kingdom", "line1": "Suite 431", "line2": "289 Giles Lake", "postalCode": "BG40 9GP", "region": "Northern Ireland", "type": "Delivery"}], "contactName": "Faye Hansen", "defaultCurrency": "GBP", "emailAddress": "hello@Abshire-Kshlerin.info", "id": "owQ2Gqgj9f", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "01338 858162", "registrationNumber": "VYL1XZXR", "sourceModifiedDate": "1660-11-28T23:18:00", "status": "Active", "supplierName": "Abshire - Kshlerin", "taxNumber": "1396267523.0914588"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2020-11-04T11:44:22Z", "status": "Active", "supplierName": "", "taxNumber": ""} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"city": "Bakersfield", "country": "US", "line1": "Unit 51", "postalCode": "933081", "region": "California", "type": "Billing"}], "contactName": "Kelly's Contact Name", "defaultCurrency": "EUR", "emailAddress": "sales@kellysupplies.com", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "07999 999999", "registrationNumber": "8409314368", "sourceModifiedDate": "2022-07-15T12:01:15Z", "status": "Active", "supplierName": "Abe"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "7110701885" + responses: + "200": + application/json: {"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "0185fea2-0298-445b-909a-0db685118a9e", "modifiedDate": "2022-10-26T13:33:13Z", "sourceModifiedDate": "2017-08-02T10:58:54Z", "status": "Active", "supplierName": "a"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "sourceModifiedDate": "2023-04-17T06:02:46", "status": "Active", "supplierName": "-"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [], "id": "api vendor", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "status": "Active", "supplierName": "api vendor"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "emailAddress": "", "id": "6202387", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "2017-05-09T00:00:00", "status": "Unknown", "supplierName": "Dell", "taxNumber": ""} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [], "contactName": "Test Vendor", "defaultCurrency": "GBP", "emailAddress": "", "id": "779", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2022-02-04T14:24:43", "status": "Active", "supplierName": "Test Vendor"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [{"city": "Berkeley", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "postalCode": "94688", "region": "CA", "type": "Billing"}], "contactName": "Angela Cheung", "defaultCurrency": "GBP", "emailAddress": "AC@CheungLimited.com", "id": "A60000-1197760912", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "510 555 5723", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "A Cheung Limited"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [{"country": "Djibouti", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support", "defaultCurrency": "GBP", "id": "41", "modifiedDate": "2023-01-18T11:02:36Z", "sourceModifiedDate": "2022-12-07T10:48:18Z", "status": "Active", "supplierName": "AI Support"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "England", "line1": "100 London Road", "line2": "Angel", "postalCode": "EC1M", "region": "Greater London", "type": "Billing"}], "contactName": "Miss Smith", "defaultCurrency": "GBP", "id": "129", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "0728 38474", "sourceModifiedDate": "2023-04-13T01:51:08Z", "status": "Active", "supplierName": "Ally Johnson"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "776", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [{"city": "Newcastle Upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Delivery"}, {"city": "Newcastle upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Unknown"}], "contactName": "Mark Ramsay", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "CON001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 643 4343", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "supplierName": "Concept Stationery Supplies", "taxNumber": "GB988 3453 23"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [{"country": "United Kingdom (GB)", "type": "Billing"}], "contactName": "Main Contact", "defaultCurrency": "GBP", "id": "65179671e9ef424caff8b9006cd111c8", "modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2020-02-25T17:23:33Z", "status": "Active", "supplierName": "5555 Abdul's Test Name"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"addresses": [{"city": "Dallas", "country": "United States", "line1": "208 S Akard St", "line2": "", "postalCode": "75265", "region": "TX", "type": "Unknown"}], "contactName": "Jones, William", "defaultCurrency": "USD", "id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "214-760-9491", "registrationNumber": "", "sourceModifiedDate": "2023-02-16T09:48:27", "status": "Active", "supplierName": "ADP", "taxNumber": "85-3678274"} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "modifiedDate": "2022-11-16T18:15:24Z", "sourceModifiedDate": "2020-04-07T13:28:02Z", "status": "Active", "supplierName": "Computer Shop"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "7110701885" + responses: + "200": + application/json: {"addresses": [], "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "24 Locks"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"addresses": [], "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000001494001", "modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-16T13:09:56", "status": "Active", "supplierName": "Acme Corporation"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-suppliers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Cesarmouth", "country": "United Kingdom", "line1": "Suite 431", "line2": "289 Giles Lake", "postalCode": "BG40 9GP", "region": "Northern Ireland", "type": "Delivery"}], "contactName": "Faye Hansen", "defaultCurrency": "GBP", "emailAddress": "hello@Abshire-Kshlerin.info", "id": "owQ2Gqgj9f", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "01338 858162", "registrationNumber": "VYL1XZXR", "sourceModifiedDate": "1660-11-28T23:18:00", "status": "Active", "supplierName": "Abshire - Kshlerin", "taxNumber": "1396267523.0914588"}, {"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "FyUkHbZxhn", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "0116 796 3163", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "0177-04-27T11:56:00", "status": "Active", "supplierName": "Arjun Kuvalis", "taxNumber": "7505220209.583549"}], "totalResults": 100} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2020-11-04T11:44:22Z", "status": "Active", "supplierName": "", "taxNumber": ""}, {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "be49ec62-6754-ed11-946f-0022481b67d1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2022-10-25T13:17:36Z", "status": "Active", "supplierName": "", "taxNumber": ""}], "totalResults": 31} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Bakersfield", "country": "US", "line1": "Unit 51", "postalCode": "933081", "region": "California", "type": "Billing"}], "contactName": "Kelly's Contact Name", "defaultCurrency": "EUR", "emailAddress": "sales@kellysupplies.com", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "07999 999999", "registrationNumber": "8409314368", "sourceModifiedDate": "2022-07-15T12:01:15Z", "status": "Active", "supplierName": "Abe"}, {"addresses": [{"city": "city", "country": "RU", "line1": "line1", "line2": "line2", "postalCode": "postal", "region": "region", "type": "Billing"}], "contactName": "Ann's contact name", "defaultCurrency": "USD", "emailAddress": "anna@anna888888.com", "id": "00014c12-2616-481a-a2e8-31bdf2497775", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "55555555", "registrationNumber": "55566677788899944455", "sourceModifiedDate": "2021-06-09T12:04:08Z", "status": "Active", "supplierName": "Ann's test supplier 2", "taxNumber": "RU4444444"}], "totalResults": 73} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "0185fea2-0298-445b-909a-0db685118a9e", "modifiedDate": "2022-10-26T13:33:13Z", "sourceModifiedDate": "2017-08-02T10:58:54Z", "status": "Active", "supplierName": "a"}, {"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "64ae712f-4155-48bb-9fce-98232c51d979", "modifiedDate": "2022-10-26T13:33:13Z", "sourceModifiedDate": "2020-05-01T14:05:46Z", "status": "Active", "supplierName": "aa"}], "totalResults": 118} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "sourceModifiedDate": "2023-04-17T06:02:46", "status": "Active", "supplierName": "-"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "9677150", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "sourceModifiedDate": "2023-04-24T06:19:23", "status": "Active", "supplierName": "-"}], "totalResults": 159} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "id": "api vendor", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "status": "Active", "supplierName": "api vendor"}, {"addresses": [], "id": "DUndsRykrmy8kFsc+FvYk29YkJze4zSjGecoF4YcUEhVU7auJ5JkQA0VjXptZ7XQ+D4n6WoxFIkaGY2V/t4flA==", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "status": "Active", "supplierName": "Chekko Test merchant 100 - Test Very long name: ORIG CO NAME:AMERICAN EXPRESS ORIG ID:9493560001 DESC DATE:220307 CO ENTRY DESCR:ACH PMT SEC:CCD TRACE#:021000023255482 EED:220307 IND ID:A4670 IND NAME:Rick Sanchez"}], "totalResults": 7} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "emailAddress": "", "id": "6202387", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "2017-05-09T00:00:00", "status": "Unknown", "supplierName": "Dell", "taxNumber": ""}, {"addresses": [], "contactName": "", "emailAddress": "", "id": "9338173", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "1990-01-01T00:00:00", "status": "Unknown", "supplierName": "Home", "taxNumber": ""}], "totalResults": 7} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Test Vendor", "defaultCurrency": "GBP", "emailAddress": "", "id": "779", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2022-02-04T14:24:43", "status": "Active", "supplierName": "Test Vendor"}, {"addresses": [], "contactName": "Vendor -.A", "defaultCurrency": "GBP", "emailAddress": "", "id": "726", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2021-03-26T09:53:15", "status": "Active", "supplierName": "Vendor -.A"}], "totalResults": 6} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Berkeley", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "postalCode": "94688", "region": "CA", "type": "Billing"}], "contactName": "Angela Cheung", "defaultCurrency": "GBP", "emailAddress": "AC@CheungLimited.com", "id": "A60000-1197760912", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "510 555 5723", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "A Cheung Limited"}, {"addresses": [{"city": "Middlefield", "line1": "Bank of Anycity, Lisa Holzhauser", "line2": "1935 Main Street", "postalCode": "94482", "region": "CA", "type": "Billing"}], "contactName": "Lisa D. Holzhauser", "defaultCurrency": "GBP", "emailAddress": "lisah@samplename.com", "id": "A40000-1197774038", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "415-555-9135", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "Bank of Anycity"}], "totalResults": 54} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "Djibouti", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support", "defaultCurrency": "GBP", "id": "41", "modifiedDate": "2023-01-18T11:02:36Z", "sourceModifiedDate": "2022-12-07T10:48:18Z", "status": "Active", "supplierName": "AI Support"}, {"addresses": [{"country": "DJ", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support 2", "defaultCurrency": "GBP", "id": "42", "modifiedDate": "2023-01-18T11:02:36Z", "sourceModifiedDate": "2021-08-31T08:45:02Z", "status": "Active", "supplierName": "AI Support 2"}], "totalResults": 23} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "England", "line1": "100 London Road", "line2": "Angel", "postalCode": "EC1M", "region": "Greater London", "type": "Billing"}], "contactName": "Miss Smith", "defaultCurrency": "GBP", "id": "129", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "0728 38474", "sourceModifiedDate": "2023-04-13T01:51:08Z", "status": "Active", "supplierName": "Ally Johnson"}, {"addresses": [], "defaultCurrency": "GBP", "id": "88", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "sourceModifiedDate": "2022-07-06T15:55:28Z", "status": "Active", "supplierName": "Andrew Haberbosch"}], "totalResults": 64} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "776", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""}, {"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "914", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""}], "totalResults": 943} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Newcastle Upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Delivery"}, {"city": "Newcastle upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Unknown"}], "contactName": "Mark Ramsay", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "CON001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 643 4343", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "supplierName": "Concept Stationery Supplies", "taxNumber": "GB988 3453 23"}, {"addresses": [{"city": "Chester le Street", "country": "GB", "line1": "Station Lane Ind Est", "line2": "Birtley", "postalCode": "DH1 3RG", "region": "County Durham", "type": "Delivery"}, {"city": "Chester le Street", "country": "GB", "line1": "Station Lane Ind Est", "line2": "Birtley", "postalCode": "DH1 3RG", "region": "County Durham", "type": "Unknown"}], "contactName": "Stuart Lynn", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "MCN001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 415 3434", "sourceModifiedDate": "2022-12-05T13:37:26Z", "status": "Active", "supplierName": "McNally Computer Supplies", "taxNumber": "GB455 2385 34"}], "totalResults": 15} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "United Kingdom (GB)", "type": "Billing"}], "contactName": "Main Contact", "defaultCurrency": "GBP", "id": "65179671e9ef424caff8b9006cd111c8", "modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2020-02-25T17:23:33Z", "status": "Active", "supplierName": "5555 Abdul's Test Name"}, {"addresses": [{"city": "London", "country": "United Kingdom (GB)", "line1": "1 Place House", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Abdi", "defaultCurrency": "GBP", "emailAddress": "abdisupplier@company.com", "id": "cf7f44d693904944a6a7cf3de0887964", "modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2020-02-13T10:38:19Z", "status": "Active", "supplierName": "Abdi Supplier"}], "totalResults": 64} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Dallas", "country": "United States", "line1": "208 S Akard St", "line2": "", "postalCode": "75265", "region": "TX", "type": "Unknown"}], "contactName": "Jones, William", "defaultCurrency": "USD", "id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "214-760-9491", "registrationNumber": "", "sourceModifiedDate": "2023-02-16T09:48:27", "status": "Active", "supplierName": "ADP", "taxNumber": "85-3678274"}, {"addresses": [{"city": "Drayton Valley", "country": "Canada", "line1": "5 Carey Hill", "line2": "", "postalCode": "G8V", "region": "Alberta", "type": "Unknown"}], "contactName": "Roach, Nathan", "defaultCurrency": "CAD", "id": "29", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "130-202-4796", "registrationNumber": "", "sourceModifiedDate": "2022-06-15T11:38:29", "status": "Active", "supplierName": "Advisor Printing", "taxNumber": ""}], "totalResults": 77} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "modifiedDate": "2022-11-16T18:15:24Z", "sourceModifiedDate": "2020-04-07T13:28:02Z", "status": "Active", "supplierName": "Computer Shop"}, {"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0NzQx", "modifiedDate": "2022-11-16T18:15:24Z", "sourceModifiedDate": "2020-04-07T13:12:40Z", "status": "Active", "supplierName": "Flour Mill"}], "totalResults": 9} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "24 Locks"}, {"addresses": [], "emailAddress": "", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "7-Eleven"}], "totalResults": 48} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000001494001", "modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-16T13:09:56", "status": "Active", "supplierName": "Acme Corporation"}, {"addresses": [], "contactName": "Dre", "defaultCurrency": "CAD", "emailAddress": "", "id": "104957000000648001", "modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-06-10T09:07:16", "status": "Active", "supplierName": "Cool company"}], "totalResults": 6} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-supplier: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + supplierId: "EILBDVJVNUAGVKRQ" + query: {} + requestBody: + application/json: {"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-data-status: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountTransactions": {"currentStatus": "Complete", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "balanceSheet": {"currentStatus": "Complete", "dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankAccounts": {"currentStatus": "Complete", "dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankTransactions": {"currentStatus": "Complete", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accountBalances": {"currentStatus": "Complete", "dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accounts": {"currentStatus": "Complete", "dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactionCategories": {"currentStatus": "Complete", "dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactions": {"currentStatus": "Complete", "dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billCreditNotes": {"currentStatus": "Complete", "dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billPayments": {"currentStatus": "Complete", "dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bills": {"currentStatus": "Complete", "dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "cashFlowStatement": {"currentStatus": "Complete", "dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "chartOfAccounts": {"currentStatus": "Complete", "dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-companyInfo": {"currentStatus": "Complete", "dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-customers": {"currentStatus": "Complete", "dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-disputes": {"currentStatus": "Complete", "dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-locations": {"currentStatus": "Complete", "dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-orders": {"currentStatus": "Complete", "dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-paymentMethods": {"currentStatus": "Complete", "dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-payments": {"currentStatus": "Complete", "dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-productCategories": {"currentStatus": "Complete", "dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-products": {"currentStatus": "Complete", "dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-taxComponents": {"currentStatus": "Complete", "dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-transactions": {"currentStatus": "Complete", "dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "company": {"currentStatus": "Complete", "dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "creditNotes": {"currentStatus": "Complete", "dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "customers": {"currentStatus": "Complete", "dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directCosts": {"currentStatus": "Complete", "dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directIncomes": {"currentStatus": "Complete", "dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "invoices": {"currentStatus": "Complete", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "itemReceipts": {"currentStatus": "Complete", "dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "items": {"currentStatus": "Complete", "dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journalEntries": {"currentStatus": "Complete", "dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journals": {"currentStatus": "Complete", "dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "paymentMethods": {"currentStatus": "Complete", "dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "payments": {"currentStatus": "Complete", "dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "profitAndLoss": {"currentStatus": "Complete", "dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "purchaseOrders": {"currentStatus": "Complete", "dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "salesOrders": {"currentStatus": "Complete", "dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "suppliers": {"currentStatus": "Complete", "dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "taxRates": {"currentStatus": "Complete", "dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "trackingCategories": {"currentStatus": "Complete", "dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "transfers": {"currentStatus": "Complete", "dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-pull-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + datasetId: "71a4c0fb-8e15-45bd-958d-330b4e6e9f07" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-pull-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}}, "pageNumber": 0, "pageSize": 0, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + refresh-all-data-types: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + refresh-data-type: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "invoices" + query: {} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company-info: + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountingPlatformRef": "1700060034_ETD", "addresses": [{"city": "London", "country": "United Kingdom", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X 0BE", "region": "England", "type": "Billing"}, {"city": "London", "country": "UK", "line1": "28 Easton Street", "postalCode": "WC1X 0BE", "type": "Delivery"}], "baseCurrency": "GBP", "companyLegalName": "Codat Ltd", "companyName": "Codat", "createdDate": "2020-03-09T15:19:26", "financialYearStartDate": "2023-04-01T00:00:00", "phoneNumbers": [{"number": "02012 345678", "type": "Landline"}, {"number": "07123 456789", "type": "Mobile"}, {"number": "02012 345678", "type": "Fax"}], "registrationNumber": "5590111724", "sourceUrls": {"Api": "https://api.codat.io"}, "taxNumber": "74111622555799035846", "webLinks": [{"type": "Website", "url": "https://www.codat.io/"}, {"type": "Social", "url": "https://www.linkedin.com/company/codat-limited/"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-push-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + pushOperationKey: "b888f774-3e7c-4135-a18c-6b985523c4bc" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-push-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + create-adjustment-transaction: + Create adjustment: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"currency": "USD", "currencyRate": 1, "date": "2024-05-21T00:00:00+00:00", "id": "3357b3df-5f2e-465d-b9ba-226519dbb8f1", "lines": [{"accountRef": {"id": "80000018-1671793811"}, "amount": 50, "description": "debit line", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "80000003-1674553958"}]}, {"accountRef": {"id": "80000028-1671794219"}, "amount": -50, "description": "credit line", "trackingRefs": [{"dataType": "trackingCategories", "id": "80000003-1674553958"}]}], "reference": "test reference"}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + "400": {} + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"currency": "New Zealand Dollar", "date": "2022-10-23T00:00:00Z", "id": "21cf021c-d9cf-4540-8331-5211a509a308", "lines": [{"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "amount": 50, "description": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}, {"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "amount": 50, "description": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}]}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"currency": "Lebanese Pound", "date": "2022-10-23T00:00:00Z", "id": "c2becc37-6917-475e-8024-985613de0ee8", "lines": []}] + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-company-configuration: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + set-company-configuration: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"bankAccount": {"id": "32"}} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + create-expense-transaction: + Payment: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"bankAccountRef": {"id": "97"}, "contactRef": {"id": "430", "type": "Supplier"}, "currency": "GBP", "currencyRate": 1, "id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "issueDate": "2024-05-21T00:00:00+00:00", "lines": [{"accountRef": {"id": "35"}, "invoiceTo": {"id": "504", "type": "customer"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "DEPARTMENT_5"}]}], "merchantName": "Amazon UK", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "type": "Payment"}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + "400": {} + Refund: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"bankAccountRef": {"id": "97"}, "contactRef": {"id": "430", "type": "Supplier"}, "currency": "GBP", "id": "7008d3f2-aeb4-11ed-afa1-0242ac120002", "issueDate": "2024-02-17T00:00:00+00:00", "lines": [{"accountRef": {"id": "42"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"id": "DEPARTMENT_6"}]}], "merchantName": "Amazon UK", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "type": "Refund"}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + "400": {} + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"bankAccountRef": {"id": "97"}, "contactRef": {"id": "430", "type": "Supplier"}, "currency": "GBP", "currencyRate": 1, "id": "a44135b0-6882-489a-83fe-a0c57a4afb19", "issueDate": "2024-05-21T00:00:00+00:00", "lines": [{"accountRef": {"id": "35"}, "invoiceTo": {"id": "504", "type": "customer"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"id": "DEPARTMENT_3"}, {"dataType": "trackingCategories"}]}], "merchantName": "Amazon UK", "notes": "amazon purchase", "type": "Payment"}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"bankAccountRef": {"id": "97"}, "contactRef": {"id": "430", "type": "Supplier"}, "currency": "GBP", "currencyRate": 1, "id": "a44135b0-6882-489a-83fe-a0c57a4afb19", "issueDate": "2024-05-21T00:00:00+00:00", "lines": [{"accountRef": {"id": "35"}, "invoiceTo": {"id": "504", "type": "customer"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"id": "DEPARTMENT_3"}, {"dataType": "trackingCategories"}]}], "merchantName": "Amazon UK", "notes": "amazon purchase", "type": "Payment"}] + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + update-expense-transaction: + Payment: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"bankAccountRef": {"id": "97"}, "contactRef": {"id": "430", "type": "Supplier"}, "currency": "GBP", "currencyRate": 1, "issueDate": "2024-05-21T00:00:00+00:00", "lines": [{"accountRef": {"id": "35"}, "invoiceTo": {"id": "504", "type": "customer"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "DEPARTMENT_5"}]}], "merchantName": "Amazon UK", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "type": "Payment"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"bankAccountRef": {"id": "787dfb37-5707-4dc0-8a86-8d74e4cc78ea"}, "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd", "type": "Supplier"}, "currency": "GBP", "issueDate": "2022-06-28T00:00:00.000Z", "lines": [{"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}, {"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}, {"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}], "merchantName": "Amazon UK", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "type": "Payment"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-mapping-options: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-reimbursable-expense-transaction: + Create reimbursable expense: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"contactRef": {"id": "752"}, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-05-21", "id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "issueDate": "2024-05-21", "lines": [{"accountRef": {"id": "35"}, "description": "Hotel", "invoiceTo": {"id": "504", "type": "customer"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "DEPARTMENT_5"}]}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "reference": "expenses w/c 01/07"}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + "400": {} + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [{"apAccountRef": {"id": "8000004C-1724173136"}, "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "issueDate": "2022-10-23T00:00:00Z", "lines": [], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"}] + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: [] + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + update-reimbursable-expense-transaction: + Update reimbursable expense: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"contactRef": {"id": "752"}, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-05-21", "issueDate": "2024-05-21", "lines": [{"accountRef": {"id": "35"}, "description": "Hotel", "invoiceTo": {"id": "504", "type": "customer"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "DEPARTMENT_5"}]}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "reference": "expenses w/c 01/07"} + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + "400": {} + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"apAccountRef": {"id": "8000004C-1724173136"}, "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "lines": [{"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "description": "2-night hotel stay", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"} + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"apAccountRef": {"id": "8000004C-1724173136"}, "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "lines": [{"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "description": "2-night hotel stay", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": []}, {"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "description": "2-night hotel stay", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}, {"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}, {"accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "description": "2-night hotel stay", "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}, "itemRef": {"id": "80000002-1675158984"}, "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "trackingRefs": [{"dataType": "trackingCategories", "id": "e9a1b63d-9ff0-40e7-8038-016354b987e6"}]}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-sync-by-id: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-last-successful-sync: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-latest-sync: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-syncs: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-sync-transaction: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-sync-transactions: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" + query: + page: 1 + pageSize: 100 + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" + query: + page: 1 + pageSize: 100 + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + upload-expense-attachment: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + create-transfer-transaction: + Create transfer: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"date": "2021-05-21T00:00:00+00:00", "description": "Sample transfer description", "from": {"accountRef": {"id": "787dfb37-5707-4dc0-8a86-8d74e4cc78ea"}, "amount": 100}, "to": {"accountRef": {"id": "777dfb37-5506-3dc0-6g86-8d34z4cc78ea"}, "amount": 100}} + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + "400": {} + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"date": "2022-10-23T00:00:00Z", "description": "Transfer from bank account Y to bank account Z", "from": {"accountRef": {"id": ""}, "amount": "6384.24"}, "to": {"accountRef": {"id": ""}, "amount": "4174.58"}} + responses: + "200": + application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" + requestBody: + application/json: {"date": "2022-10-23T00:00:00Z", "description": "Transfer from bank account Y to bank account Z", "from": {"accountRef": {"id": ""}, "amount": "690.26"}, "to": {"accountRef": {"id": ""}, "amount": "7964.74"}} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} +generatedTests: {} diff --git a/sync-for-expenses/.speakeasy/gen.yaml b/sync-for-expenses/.speakeasy/gen.yaml index ab72cdbeb..c6fc5166c 100644 --- a/sync-for-expenses/.speakeasy/gen.yaml +++ b/sync-for-expenses/.speakeasy/gen.yaml @@ -9,16 +9,25 @@ generation: requestResponseComponentNamesFeb2024: false auth: oAuth2ClientCredentialsEnabled: false + oAuth2PasswordEnabled: false telemetryEnabled: true python: - version: 6.2.0 + version: 7.0.0 additionalDependencies: dev: {} main: {} author: Codat + authors: + - Speakeasy clientServerStatusCodesAsErrors: true + defaultErrorName: SDKError description: Push expenses to accounting software. + enumFormat: enum + fixFlags: + responseRequiredSep2024: false flattenGlobalSecurity: false + flattenRequests: false + flatteningOrder: parameters-first imports: option: openapi paths: @@ -29,13 +38,9 @@ python: webhooks: models/webhooks inputModelSuffix: input maxMethodParams: 0 + methodArguments: infer-optional-args outputModelSuffix: output packageName: codat-sync-for-expenses projectUrls: {} responseFormat: flat - authors: - - Speakeasy - enumFormat: enum - flattenRequests: false - methodArguments: infer-optional-args templateVersion: v2 diff --git a/sync-for-expenses/.vscode/settings.json b/sync-for-expenses/.vscode/settings.json new file mode 100644 index 000000000..8d79f0abb --- /dev/null +++ b/sync-for-expenses/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "python.testing.pytestArgs": ["tests", "-vv"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "pylint.args": ["--rcfile=pylintrc"] +} diff --git a/sync-for-expenses/CONTRIBUTING.md b/sync-for-expenses/CONTRIBUTING.md new file mode 100644 index 000000000..d585717fc --- /dev/null +++ b/sync-for-expenses/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/sync-for-expenses/README.md b/sync-for-expenses/README.md index 37af97e37..392204721 100755 --- a/sync-for-expenses/README.md +++ b/sync-for-expenses/README.md @@ -4,47 +4,167 @@ Embedded accounting integrations for corporate card providers. + +## Summary + +Sync for Expenses: The API for Sync for Expenses. + +Sync for Expenses is an API and a set of supporting tools. It has been built to +enable corporate card and expense management platforms to provide high-quality +integrations with multiple accounting software through a standardized API. + +[Explore product](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) + +Not seeing the endpoints you're expecting? We've [reorganized our products](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Sync for Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). + +--- + +## Endpoints + +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Configuration | View and manage mapping configuration and defaults for expense transactions. | +| Sync | Monitor the status of data syncs. | +| Expenses | Create and update transactions that represent your customers' spend. | +| Transfers | Create and update transactions that represent the movement of your customers' money. | +| Reimbursements | Create and update transactions that represent your customers' repayable spend. | +| Attachments | Attach receipts to a transaction for a complete audit trail. | +| Transaction status | Monitor the status of individual transactions in data syncs. | +| Manage data | Control and monitor the retrieval of data from an integration. | +| Push operations | View historic push operations. | +| Accounts | Create accounts and view account schemas. | +| Customers | Get, create, and update customers. | +| Suppliers | Get, create, and update suppliers. | + + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [IDE Support](#ide-support) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [File uploads](#file-uploads) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Debugging](#debugging) + + ## SDK Installation +The SDK can be installed with either *pip* or *poetry* package managers. + +### PIP + +*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line. + ```bash pip install codat-sync-for-expenses ``` + +### Poetry + +*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies. + +```bash +poetry add codat-sync-for-expenses +``` ## Example Usage + +## IDE Support + +### PyCharm + +Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin. + +- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + + ## SDK Example Usage ### Example ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +# Synchronous Example +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) + + if res is not None: + # handle response + pass +``` -if res.company is not None: - # handle response - pass +
+The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared + +async def main(): + async with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as s: + res = await s.companies.create_async(request={ + "name": "Technicalium", + }) + + if res is not None: + # handle response + pass + +asyncio.run(main()) ``` ## Available Resources and Operations +
+Available methods + +### [accounts](docs/sdks/accounts/README.md) + +* [create](docs/sdks/accounts/README.md#create) - Create account +* [get_create_model](docs/sdks/accounts/README.md#get_create_model) - Get create account model + +### [adjustments](docs/sdks/adjustments/README.md) + +* [create](docs/sdks/adjustments/README.md#create) - Create adjustment transaction + +### [attachments](docs/sdks/attachments/README.md) + +* [upload](docs/sdks/attachments/README.md#upload) - Upload attachment + +### [bank_accounts](docs/sdks/bankaccounts/README.md) + +* [create](docs/sdks/bankaccounts/README.md#create) - Create bank account +* [get_create_model](docs/sdks/bankaccounts/README.md#get_create_model) - Get create bank account model + + ### [companies](docs/sdks/companies/README.md) * [create](docs/sdks/companies/README.md#create) - Create company @@ -53,6 +173,15 @@ if res.company is not None: * [list](docs/sdks/companies/README.md#list) - List companies * [update](docs/sdks/companies/README.md#update) - Update company +### [company_info](docs/sdks/companyinfo/README.md) + +* [get](docs/sdks/companyinfo/README.md#get) - Get company info + +### [configuration](docs/sdks/configuration/README.md) + +* [get](docs/sdks/configuration/README.md#get) - Get company configuration +* [set](docs/sdks/configuration/README.md#set) - Set company configuration + ### [connections](docs/sdks/connections/README.md) * [create](docs/sdks/connections/README.md#create) - Create connection @@ -62,11 +191,6 @@ if res.company is not None: * [list](docs/sdks/connections/README.md#list) - List connections * [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection -### [accounts](docs/sdks/accounts/README.md) - -* [create](docs/sdks/accounts/README.md#create) - Create account -* [get_create_model](docs/sdks/accounts/README.md#get_create_model) - Get create account model - ### [customers](docs/sdks/customers/README.md) * [create](docs/sdks/customers/README.md#create) - Create customer @@ -74,12 +198,10 @@ if res.company is not None: * [list](docs/sdks/customers/README.md#list) - List customers * [update](docs/sdks/customers/README.md#update) - Update customer -### [suppliers](docs/sdks/suppliers/README.md) +### [expenses](docs/sdks/expenses/README.md) -* [create](docs/sdks/suppliers/README.md#create) - Create supplier -* [get](docs/sdks/suppliers/README.md#get) - Get supplier -* [list](docs/sdks/suppliers/README.md#list) - List suppliers -* [update](docs/sdks/suppliers/README.md#update) - Update supplier +* [create](docs/sdks/expenses/README.md#create) - Create expense transaction +* [update](docs/sdks/expenses/README.md#update) - Update expense transactions ### [manage_data](docs/sdks/managedata/README.md) @@ -89,33 +211,32 @@ if res.company is not None: * [refresh_all_data_types](docs/sdks/managedata/README.md#refresh_all_data_types) - Refresh all data * [refresh_data_type](docs/sdks/managedata/README.md#refresh_data_type) - Refresh data type +### [mapping_options](docs/sdks/mappingoptions/README.md) + +* [get_mapping_options](docs/sdks/mappingoptions/README.md#get_mapping_options) - Mapping options + ### [push_operations](docs/sdks/pushoperations/README.md) * [get](docs/sdks/pushoperations/README.md#get) - Get push operation * [list](docs/sdks/pushoperations/README.md#list) - List push operations -### [configuration](docs/sdks/configuration/README.md) - -* [get](docs/sdks/configuration/README.md#get) - Get company configuration -* [get_mapping_options](docs/sdks/configuration/README.md#get_mapping_options) - Mapping options -* [set](docs/sdks/configuration/README.md#set) - Set company configuration - -### [expenses](docs/sdks/expenses/README.md) - -* [create](docs/sdks/expenses/README.md#create) - Create expense transaction -* [update](docs/sdks/expenses/README.md#update) - Update expense transactions - ### [reimbursements](docs/sdks/reimbursements/README.md) * [create](docs/sdks/reimbursements/README.md#create) - Create reimbursable expense transaction * [update](docs/sdks/reimbursements/README.md#update) - Update reimbursable expense transaction +### [suppliers](docs/sdks/suppliers/README.md) + +* [create](docs/sdks/suppliers/README.md#create) - Create supplier +* [get](docs/sdks/suppliers/README.md#get) - Get supplier +* [list](docs/sdks/suppliers/README.md#list) - List suppliers +* [update](docs/sdks/suppliers/README.md#update) - Update supplier + ### [sync](docs/sdks/sync/README.md) * [get](docs/sdks/sync/README.md#get) - Get sync status * [get_last_successful_sync](docs/sdks/sync/README.md#get_last_successful_sync) - Last successful sync * [get_latest_sync](docs/sdks/sync/README.md#get_latest_sync) - Latest sync status -* [initiate_sync](docs/sdks/sync/README.md#initiate_sync) - Initiate sync * [list](docs/sdks/sync/README.md#list) - List sync statuses ### [transaction_status](docs/sdks/transactionstatus/README.md) @@ -123,17 +244,47 @@ if res.company is not None: * [get](docs/sdks/transactionstatus/README.md#get) - Get sync transaction * [list](docs/sdks/transactionstatus/README.md#list) - List sync transactions -### [attachments](docs/sdks/attachments/README.md) - -* [upload](docs/sdks/attachments/README.md#upload) - Upload attachment - ### [transfers](docs/sdks/transfers/README.md) * [create](docs/sdks/transfers/README.md#create) - Create transfer transaction + +
+ +## File uploads + +Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files. +> + +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared + +with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.attachments.upload(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "sync_id": "6fb40d5e-b13e-11ed-afa1-0242ac120002", + "transaction_id": "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }) + + if res is not None: + # handle response + pass + +``` + + ## Retries @@ -141,53 +292,45 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared from codatsyncexpenses.utils import BackoffStrategy, RetryConfig -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req, - RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }, + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared from codatsyncexpenses.utils import BackoffStrategy, RetryConfig -s = codatsyncexpenses.CodatSyncExpenses( - retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False) +with CodatSyncExpenses( + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) - -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -195,109 +338,77 @@ if res.company is not None: ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. +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: -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| 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 | + +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 `create_async` method may raise the following exceptions: + +| Error Type | Status Code | Content Type | +| ------------------- | --------------------------------- | ---------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ### Example ```python -import codatsyncexpenses -from codatsyncexpenses.models import errors, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import errors, shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = None -try: - res = s.companies.create(req) -except errors.ErrorMessage as e: - # handle exception - raise(e) -except errors.SDKError as e: - # handle exception - raise(e) - -if res.company is not None: - # handle response - pass - +) as s: + res = None + try: + res = s.companies.create(request={ + "name": "Technicalium", + }) + + 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) ``` ## Server Selection -### Select Server by Index - -You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://api.codat.io` | None | - -#### Example - -```python -import codatsyncexpenses -from codatsyncexpenses.models import shared - -s = codatsyncexpenses.CodatSyncExpenses( - server_idx=0, - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) - -if res.company is not None: - # handle response - pass - -``` - - ### 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: ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( server_url="https://api.codat.io", security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) - -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -305,16 +416,81 @@ if res.company is not None: ## Custom HTTP Client -The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object. +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. For example, you could specify a header for every request that this sdk makes as follows: ```python -import codatsyncexpenses -import requests +from codat_sync_for_expenses import CodatSyncExpenses +import httpx -http_client = requests.Session() -http_client.headers.update({'x-custom-header': 'someValue'}) -s = codatsyncexpenses.CodatSyncExpenses(client=http_client) +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = CodatSyncExpenses(client=http_client) +``` + +or you could wrap the client with your own custom logic: +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = CodatSyncExpenses(async_client=CustomClient(httpx.AsyncClient())) ``` @@ -325,34 +501,45 @@ s = codatsyncexpenses.CodatSyncExpenses(client=http_client) This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------- | ------------- | ------------- | -| `auth_header` | apiKey | API key | +| Name | Type | Scheme | +| ------------- | ------ | ------- | +| `auth_header` | apiKey | API key | You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example: ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) + + if res is not None: + # handle response + pass -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) +``` + -res = s.companies.create(req) + +## Debugging -if res.company is not None: - # handle response - pass +You can setup your SDK to emit debug logs for SDK requests and responses. +You can pass your own logger class directly into your SDK. +```python +from codat_sync_for_expenses import CodatSyncExpenses +import logging + +logging.basicConfig(level=logging.DEBUG) +s = CodatSyncExpenses(debug_logger=logging.getLogger("codat_sync_for_expenses")) ``` - + diff --git a/sync-for-expenses/RELEASES.md b/sync-for-expenses/RELEASES.md index 90f7c1712..a1a8f43ad 100644 --- a/sync-for-expenses/RELEASES.md +++ b/sync-for-expenses/RELEASES.md @@ -726,4 +726,14 @@ Based on: ### Generated - [python v6.2.0] sync-for-expenses ### Releases -- [PyPI v6.2.0] https://pypi.org/project/codat-sync-for-expenses/6.2.0 - sync-for-expenses \ No newline at end of file +- [PyPI v6.2.0] https://pypi.org/project/codat-sync-for-expenses/6.2.0 - sync-for-expenses + +## 2024-11-26 16:27:02 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.447.0 (2.463.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v7.0.0] sync-for-expenses +### Releases +- [PyPI v7.0.0] https://pypi.org/project/codat-sync-for-expenses/7.0.0 - sync-for-expenses \ No newline at end of file diff --git a/sync-for-expenses/USAGE.md b/sync-for-expenses/USAGE.md index 123790a39..84b28e3bd 100644 --- a/sync-for-expenses/USAGE.md +++ b/sync-for-expenses/USAGE.md @@ -1,24 +1,46 @@ ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +# Synchronous Example +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) + if res is not None: + # handle response + pass +``` + +
+ +The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -res = s.companies.create(req) +async def main(): + async with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as s: + res = await s.companies.create_async(request={ + "name": "Technicalium", + }) -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass +asyncio.run(main()) ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/models/errors/errormessage.md b/sync-for-expenses/docs/models/errors/errormessage.md index 4c73e63ee..c24cd9acc 100644 --- a/sync-for-expenses/docs/models/errors/errormessage.md +++ b/sync-for-expenses/docs/models/errors/errormessage.md @@ -1,6 +1,6 @@ # ErrorMessage -The request made is not valid. +Your `query` parameter was not correctly formed ## Fields @@ -13,4 +13,4 @@ The request made is not valid. | `error` | *Optional[str]* | :heavy_minus_sign: | A brief description of the error. | | `service` | *Optional[str]* | :heavy_minus_sign: | Codat's service the returned the error. | | `status_code` | *Optional[int]* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `validation` | [Optional[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file +| `validation` | [OptionalNullable[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createaccountresponse.md b/sync-for-expenses/docs/models/operations/createaccountresponse.md deleted file mode 100644 index e7025bac2..000000000 --- a/sync-for-expenses/docs/models/operations/createaccountresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_account_response` | [Optional[shared.CreateAccountResponse]](../../models/shared/createaccountresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createadjustmenttransactionrequest.md b/sync-for-expenses/docs/models/operations/createadjustmenttransactionrequest.md new file mode 100644 index 000000000..49ef25831 --- /dev/null +++ b/sync-for-expenses/docs/models/operations/createadjustmenttransactionrequest.md @@ -0,0 +1,9 @@ +# CreateAdjustmentTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `request_body` | List[[shared.AdjustmentTransactionRequest](../../models/shared/adjustmenttransactionrequest.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createbankaccountrequest.md b/sync-for-expenses/docs/models/operations/createbankaccountrequest.md new file mode 100644 index 000000000..d37dc696c --- /dev/null +++ b/sync-for-expenses/docs/models/operations/createbankaccountrequest.md @@ -0,0 +1,12 @@ +# CreateBankAccountRequest + + +## 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 | +| `bank_account` | [OptionalNullable[shared.BankAccount]](../../models/shared/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `allow_sync_on_push_complete` | *Optional[bool]* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createconnectionresponse.md b/sync-for-expenses/docs/models/operations/createconnectionresponse.md deleted file mode 100644 index 5bafc316c..000000000 --- a/sync-for-expenses/docs/models/operations/createconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateConnectionResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createcustomerrequest.md b/sync-for-expenses/docs/models/operations/createcustomerrequest.md index 1d5367283..67427843b 100644 --- a/sync-for-expenses/docs/models/operations/createcustomerrequest.md +++ b/sync-for-expenses/docs/models/operations/createcustomerrequest.md @@ -7,6 +7,6 @@ | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | `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 | -| `customer` | [Optional[shared.Customer]](../../models/shared/customer.md) | :heavy_minus_sign: | N/A | | +| `customer` | [OptionalNullable[shared.Customer]](../../models/shared/customer.md) | :heavy_minus_sign: | N/A | | | `allow_sync_on_push_complete` | *Optional[bool]* | :heavy_minus_sign: | Allow a sync upon push completion. | | | `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createcustomerresponse.md b/sync-for-expenses/docs/models/operations/createcustomerresponse.md deleted file mode 100644 index 36222dc08..000000000 --- a/sync-for-expenses/docs/models/operations/createcustomerresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateCustomerResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_customer_response` | [Optional[shared.CreateCustomerResponse]](../../models/shared/createcustomerresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createexpensetransactionrequest.md b/sync-for-expenses/docs/models/operations/createexpensetransactionrequest.md index 3c14bf266..304c37888 100644 --- a/sync-for-expenses/docs/models/operations/createexpensetransactionrequest.md +++ b/sync-for-expenses/docs/models/operations/createexpensetransactionrequest.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 | -| `create_expense_request` | [Optional[shared.CreateExpenseRequest]](../../models/shared/createexpenserequest.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 | +| `request_body` | List[[shared.ExpenseTransaction](../../models/shared/expensetransaction.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createexpensetransactionresponse.md b/sync-for-expenses/docs/models/operations/createexpensetransactionresponse.md deleted file mode 100644 index 19e7d2aa9..000000000 --- a/sync-for-expenses/docs/models/operations/createexpensetransactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateExpenseTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_expense_response` | [Optional[shared.CreateExpenseResponse]](../../models/shared/createexpenseresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createpartnerexpenseconnectionresponse.md b/sync-for-expenses/docs/models/operations/createpartnerexpenseconnectionresponse.md deleted file mode 100644 index 8cd462a51..000000000 --- a/sync-for-expenses/docs/models/operations/createpartnerexpenseconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreatePartnerExpenseConnectionResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | Success | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionrequest.md b/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionrequest.md index 7c49dc7de..b0790dbfc 100644 --- a/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionrequest.md +++ b/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionrequest.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 | -| `create_reimbursable_expense_request` | [Optional[shared.CreateReimbursableExpenseRequest]](../../models/shared/createreimbursableexpenserequest.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 | +| `request_body` | List[[shared.ReimbursableExpenseTransaction](../../models/shared/reimbursableexpensetransaction.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionresponse.md b/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionresponse.md deleted file mode 100644 index 4ce9ba7ed..000000000 --- a/sync-for-expenses/docs/models/operations/createreimbursableexpensetransactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateReimbursableExpenseTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_reimbursable_expense_response` | [Optional[shared.CreateReimbursableExpenseResponse]](../../models/shared/createreimbursableexpenseresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createsupplierrequest.md b/sync-for-expenses/docs/models/operations/createsupplierrequest.md index 1b020e666..8526143b7 100644 --- a/sync-for-expenses/docs/models/operations/createsupplierrequest.md +++ b/sync-for-expenses/docs/models/operations/createsupplierrequest.md @@ -7,6 +7,6 @@ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `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 | -| `supplier` | [Optional[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `supplier` | [OptionalNullable[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | | `allow_sync_on_push_complete` | *Optional[bool]* | :heavy_minus_sign: | Allow a sync upon push completion. | | | `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createsupplierresponse.md b/sync-for-expenses/docs/models/operations/createsupplierresponse.md deleted file mode 100644 index f86dd97c9..000000000 --- a/sync-for-expenses/docs/models/operations/createsupplierresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateSupplierResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_supplier_response` | [Optional[shared.CreateSupplierResponse]](../../models/shared/createsupplierresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createtransfertransactionrequest.md b/sync-for-expenses/docs/models/operations/createtransfertransactionrequest.md index 37eb3fb59..dc6bf51a9 100644 --- a/sync-for-expenses/docs/models/operations/createtransfertransactionrequest.md +++ b/sync-for-expenses/docs/models/operations/createtransfertransactionrequest.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 | -| `transaction_id` | *str* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | -| `create_transfer_request` | [Optional[shared.CreateTransferRequest]](../../models/shared/createtransferrequest.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 | +| `transaction_id` | *str* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | +| `transfer_transaction_request` | [Optional[shared.TransferTransactionRequest]](../../models/shared/transfertransactionrequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createtransfertransactionresponse.md b/sync-for-expenses/docs/models/operations/createtransfertransactionresponse.md deleted file mode 100644 index 232e257af..000000000 --- a/sync-for-expenses/docs/models/operations/createtransfertransactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateTransferTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_transfer_response` | [Optional[shared.CreateTransferResponse]](../../models/shared/createtransferresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/deletecompanyresponse.md b/sync-for-expenses/docs/models/operations/deletecompanyresponse.md deleted file mode 100644 index 7dfc00111..000000000 --- a/sync-for-expenses/docs/models/operations/deletecompanyresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteCompanyResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/deleteconnectionresponse.md b/sync-for-expenses/docs/models/operations/deleteconnectionresponse.md deleted file mode 100644 index 373abf82a..000000000 --- a/sync-for-expenses/docs/models/operations/deleteconnectionresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteConnectionResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getcompanyconfigurationresponse.md b/sync-for-expenses/docs/models/operations/getcompanyconfigurationresponse.md deleted file mode 100644 index 2d592d881..000000000 --- a/sync-for-expenses/docs/models/operations/getcompanyconfigurationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCompanyConfigurationResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `company_configuration` | [Optional[shared.CompanyConfiguration]](../../models/shared/companyconfiguration.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/groupreference.md b/sync-for-expenses/docs/models/operations/getcompanyinforequest.md similarity index 65% rename from sync-for-expenses/docs/models/shared/groupreference.md rename to sync-for-expenses/docs/models/operations/getcompanyinforequest.md index 31666edf4..bd218de01 100644 --- a/sync-for-expenses/docs/models/shared/groupreference.md +++ b/sync-for-expenses/docs/models/operations/getcompanyinforequest.md @@ -1,8 +1,8 @@ -# GroupReference +# GetCompanyInfoRequest ## Fields | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getconnectionresponse.md b/sync-for-expenses/docs/models/operations/getconnectionresponse.md deleted file mode 100644 index f1358ac2e..000000000 --- a/sync-for-expenses/docs/models/operations/getconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetConnectionResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getcreatebankaccountsmodelrequest.md b/sync-for-expenses/docs/models/operations/getcreatebankaccountsmodelrequest.md new file mode 100644 index 000000000..a45e1bb79 --- /dev/null +++ b/sync-for-expenses/docs/models/operations/getcreatebankaccountsmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateBankAccountsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getcreatechartofaccountsmodelresponse.md b/sync-for-expenses/docs/models/operations/getcreatechartofaccountsmodelresponse.md deleted file mode 100644 index c54480aae..000000000 --- a/sync-for-expenses/docs/models/operations/getcreatechartofaccountsmodelresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCreateChartOfAccountsModelResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getcustomerrequest.md b/sync-for-expenses/docs/models/operations/getcustomerrequest.md index 48c68a5d4..701b68159 100644 --- a/sync-for-expenses/docs/models/operations/getcustomerrequest.md +++ b/sync-for-expenses/docs/models/operations/getcustomerrequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `customer_id` | *str* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file +| `customer_id` | *str* | :heavy_check_mark: | Unique identifier for a customer. | 13d946f0-c5d5-42bc-b092-97ece17923ab | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getcustomerresponse.md b/sync-for-expenses/docs/models/operations/getcustomerresponse.md deleted file mode 100644 index 8991196c1..000000000 --- a/sync-for-expenses/docs/models/operations/getcustomerresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCustomerResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customer` | [Optional[shared.Customer]](../../models/shared/customer.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getdatastatusdatastatuses.md b/sync-for-expenses/docs/models/operations/getdatastatusdatastatuses.md new file mode 100644 index 000000000..f3e954e3c --- /dev/null +++ b/sync-for-expenses/docs/models/operations/getdatastatusdatastatuses.md @@ -0,0 +1,52 @@ +# GetDataStatusDataStatuses + +OK + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `balance_sheet` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bank_accounts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bank_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_account_balances` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_accounts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_transaction_categories` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bill_credit_notes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bill_payments` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bills` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `cash_flow_statement` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `chart_of_accounts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_company_info` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_customers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_disputes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_locations` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_orders` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_payment_methods` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_payments` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_product_categories` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_products` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_tax_components` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `company` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `credit_notes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `customers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `direct_costs` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `direct_incomes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `invoices` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `item_receipts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `items` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `journal_entries` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `journals` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `payment_methods` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `payments` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `profit_and_loss` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `purchase_orders` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `sales_orders` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `suppliers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `tax_rates` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `tracking_categories` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `transfers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getdatastatusresponse.md b/sync-for-expenses/docs/models/operations/getdatastatusresponse.md deleted file mode 100644 index 6cb313174..000000000 --- a/sync-for-expenses/docs/models/operations/getdatastatusresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetDataStatusResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `data_statuses` | Dict[str, [shared.DataStatus](../../models/shared/datastatus.md)] | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getlastsuccessfulsyncresponse.md b/sync-for-expenses/docs/models/operations/getlastsuccessfulsyncresponse.md deleted file mode 100644 index afd005b68..000000000 --- a/sync-for-expenses/docs/models/operations/getlastsuccessfulsyncresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLastSuccessfulSyncResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `company_sync_status` | [Optional[shared.CompanySyncStatus]](../../models/shared/companysyncstatus.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getlatestsyncresponse.md b/sync-for-expenses/docs/models/operations/getlatestsyncresponse.md deleted file mode 100644 index 2b631cac5..000000000 --- a/sync-for-expenses/docs/models/operations/getlatestsyncresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLatestSyncResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `company_sync_status` | [Optional[shared.CompanySyncStatus]](../../models/shared/companysyncstatus.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getmappingoptionsresponse.md b/sync-for-expenses/docs/models/operations/getmappingoptionsresponse.md deleted file mode 100644 index fd3d47cf0..000000000 --- a/sync-for-expenses/docs/models/operations/getmappingoptionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMappingOptionsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `mapping_options` | [Optional[shared.MappingOptions]](../../models/shared/mappingoptions.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getpulloperationresponse.md b/sync-for-expenses/docs/models/operations/getpulloperationresponse.md deleted file mode 100644 index 2223df457..000000000 --- a/sync-for-expenses/docs/models/operations/getpulloperationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPullOperationResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getpushoperationresponse.md b/sync-for-expenses/docs/models/operations/getpushoperationresponse.md deleted file mode 100644 index 17e937758..000000000 --- a/sync-for-expenses/docs/models/operations/getpushoperationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPushOperationResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `push_operation` | [Optional[shared.PushOperation]](../../models/shared/pushoperation.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getsyncbyidresponse.md b/sync-for-expenses/docs/models/operations/getsyncbyidresponse.md deleted file mode 100644 index ae491be82..000000000 --- a/sync-for-expenses/docs/models/operations/getsyncbyidresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSyncByIDResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `company_sync_status` | [Optional[shared.CompanySyncStatus]](../../models/shared/companysyncstatus.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getsynctransactionresponse.md b/sync-for-expenses/docs/models/operations/getsynctransactionresponse.md deleted file mode 100644 index c6ec7e336..000000000 --- a/sync-for-expenses/docs/models/operations/getsynctransactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSyncTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `transaction_response` | List[[shared.Transaction](../../models/shared/transaction.md)] | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/initiatesyncrequest.md b/sync-for-expenses/docs/models/operations/initiatesyncrequest.md deleted file mode 100644 index 6b45d34dc..000000000 --- a/sync-for-expenses/docs/models/operations/initiatesyncrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# InitiateSyncRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `initiate_sync` | [Optional[shared.InitiateSync]](../../models/shared/initiatesync.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/initiatesyncresponse.md b/sync-for-expenses/docs/models/operations/initiatesyncresponse.md deleted file mode 100644 index 55bb1f2d6..000000000 --- a/sync-for-expenses/docs/models/operations/initiatesyncresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# InitiateSyncResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `sync_initiated` | [Optional[shared.SyncInitiated]](../../models/shared/syncinitiated.md) | :heavy_minus_sign: | Returns the newly created syncId | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listcompaniesrequest.md b/sync-for-expenses/docs/models/operations/listcompaniesrequest.md index 8dfaf69d5..9fc1a9c7e 100644 --- a/sync-for-expenses/docs/models/operations/listcompaniesrequest.md +++ b/sync-for-expenses/docs/models/operations/listcompaniesrequest.md @@ -8,4 +8,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listcompaniesresponse.md b/sync-for-expenses/docs/models/operations/listcompaniesresponse.md deleted file mode 100644 index 634d146a1..000000000 --- a/sync-for-expenses/docs/models/operations/listcompaniesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCompaniesResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `companies` | [Optional[shared.Companies]](../../models/shared/companies.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listconnectionsrequest.md b/sync-for-expenses/docs/models/operations/listconnectionsrequest.md index e13ad736b..949d3e3b6 100644 --- a/sync-for-expenses/docs/models/operations/listconnectionsrequest.md +++ b/sync-for-expenses/docs/models/operations/listconnectionsrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listconnectionsresponse.md b/sync-for-expenses/docs/models/operations/listconnectionsresponse.md deleted file mode 100644 index bf806ddc5..000000000 --- a/sync-for-expenses/docs/models/operations/listconnectionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListConnectionsResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connections` | [Optional[shared.Connections]](../../models/shared/connections.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listcustomersrequest.md b/sync-for-expenses/docs/models/operations/listcustomersrequest.md index 0d9a2bf1c..8b6276cb4 100644 --- a/sync-for-expenses/docs/models/operations/listcustomersrequest.md +++ b/sync-for-expenses/docs/models/operations/listcustomersrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listcustomersresponse.md b/sync-for-expenses/docs/models/operations/listcustomersresponse.md deleted file mode 100644 index a5145c0c7..000000000 --- a/sync-for-expenses/docs/models/operations/listcustomersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCustomersResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `customers` | [Optional[shared.Customers]](../../models/shared/customers.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listpulloperationsrequest.md b/sync-for-expenses/docs/models/operations/listpulloperationsrequest.md index bdf3bef92..90a05e642 100644 --- a/sync-for-expenses/docs/models/operations/listpulloperationsrequest.md +++ b/sync-for-expenses/docs/models/operations/listpulloperationsrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listpulloperationsresponse.md b/sync-for-expenses/docs/models/operations/listpulloperationsresponse.md deleted file mode 100644 index 45665c995..000000000 --- a/sync-for-expenses/docs/models/operations/listpulloperationsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListPullOperationsResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operations` | [Optional[shared.PullOperations]](../../models/shared/pulloperations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listpushoperationsrequest.md b/sync-for-expenses/docs/models/operations/listpushoperationsrequest.md index 3e934bc15..68a41042d 100644 --- a/sync-for-expenses/docs/models/operations/listpushoperationsrequest.md +++ b/sync-for-expenses/docs/models/operations/listpushoperationsrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listpushoperationsresponse.md b/sync-for-expenses/docs/models/operations/listpushoperationsresponse.md deleted file mode 100644 index 7ee262c4c..000000000 --- a/sync-for-expenses/docs/models/operations/listpushoperationsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListPushOperationsResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `push_operations` | [Optional[shared.PushOperations]](../../models/shared/pushoperations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listsuppliersrequest.md b/sync-for-expenses/docs/models/operations/listsuppliersrequest.md index 53fa35624..0590ff1a1 100644 --- a/sync-for-expenses/docs/models/operations/listsuppliersrequest.md +++ b/sync-for-expenses/docs/models/operations/listsuppliersrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listsuppliersresponse.md b/sync-for-expenses/docs/models/operations/listsuppliersresponse.md deleted file mode 100644 index e6e2c8267..000000000 --- a/sync-for-expenses/docs/models/operations/listsuppliersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListSuppliersResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `suppliers` | [Optional[shared.Suppliers]](../../models/shared/suppliers.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listsyncsresponse.md b/sync-for-expenses/docs/models/operations/listsyncsresponse.md deleted file mode 100644 index 9105ae46f..000000000 --- a/sync-for-expenses/docs/models/operations/listsyncsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListSyncsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `classes` | List[[shared.CompanySyncStatus](../../models/shared/companysyncstatus.md)] | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/listsynctransactionsresponse.md b/sync-for-expenses/docs/models/operations/listsynctransactionsresponse.md deleted file mode 100644 index b14152f3f..000000000 --- a/sync-for-expenses/docs/models/operations/listsynctransactionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListSyncTransactionsResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `transactions` | [Optional[shared.Transactions]](../../models/shared/transactions.md) | :heavy_minus_sign: | Success | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/refreshalldatatypesresponse.md b/sync-for-expenses/docs/models/operations/refreshalldatatypesresponse.md deleted file mode 100644 index 4f79210f0..000000000 --- a/sync-for-expenses/docs/models/operations/refreshalldatatypesresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# RefreshAllDataTypesResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/refreshdatatyperesponse.md b/sync-for-expenses/docs/models/operations/refreshdatatyperesponse.md deleted file mode 100644 index 79184cefc..000000000 --- a/sync-for-expenses/docs/models/operations/refreshdatatyperesponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RefreshDataTypeResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/setcompanyconfigurationresponse.md b/sync-for-expenses/docs/models/operations/setcompanyconfigurationresponse.md deleted file mode 100644 index 9a20b3fe1..000000000 --- a/sync-for-expenses/docs/models/operations/setcompanyconfigurationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SetCompanyConfigurationResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `company_configuration` | [Optional[shared.CompanyConfiguration]](../../models/shared/companyconfiguration.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/unlinkconnectionresponse.md b/sync-for-expenses/docs/models/operations/unlinkconnectionresponse.md deleted file mode 100644 index 927c8dae6..000000000 --- a/sync-for-expenses/docs/models/operations/unlinkconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UnlinkConnectionResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatecustomerrequest.md b/sync-for-expenses/docs/models/operations/updatecustomerrequest.md index 8c3f44280..f01d10ce8 100644 --- a/sync-for-expenses/docs/models/operations/updatecustomerrequest.md +++ b/sync-for-expenses/docs/models/operations/updatecustomerrequest.md @@ -7,8 +7,8 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | -| `customer_id` | *str* | :heavy_check_mark: | Unique identifier for a customer. | | -| `customer` | [Optional[shared.Customer]](../../models/shared/customer.md) | :heavy_minus_sign: | N/A | | +| `customer_id` | *str* | :heavy_check_mark: | Unique identifier for a customer. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `customer` | [OptionalNullable[shared.Customer]](../../models/shared/customer.md) | :heavy_minus_sign: | N/A | | | `allow_sync_on_push_complete` | *Optional[bool]* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | | `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatecustomerresponse.md b/sync-for-expenses/docs/models/operations/updatecustomerresponse.md deleted file mode 100644 index b8900289c..000000000 --- a/sync-for-expenses/docs/models/operations/updatecustomerresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateCustomerResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `update_customer_response` | [Optional[shared.UpdateCustomerResponse]](../../models/shared/updatecustomerresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updateexpensetransactionresponse.md b/sync-for-expenses/docs/models/operations/updateexpensetransactionresponse.md deleted file mode 100644 index 07256fb71..000000000 --- a/sync-for-expenses/docs/models/operations/updateexpensetransactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateExpenseTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `update_expense_response` | [Optional[shared.UpdateExpenseResponse]](../../models/shared/updateexpenseresponse.md) | :heavy_minus_sign: | Accepted | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionrequest.md b/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionrequest.md index e151a21bf..b6a8a1329 100644 --- a/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionrequest.md +++ b/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionrequest.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 | -| `transaction_id` | *str* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | -| `create_reimbursable_expense_request` | [Optional[shared.CreateReimbursableExpenseRequest]](../../models/shared/createreimbursableexpenserequest.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 | +| `transaction_id` | *str* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | +| `update_reimbursable_expense_transaction_request` | [Optional[shared.UpdateReimbursableExpenseTransactionRequest]](../../models/shared/updatereimbursableexpensetransactionrequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionresponse.md b/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionresponse.md deleted file mode 100644 index 2ad18f8d7..000000000 --- a/sync-for-expenses/docs/models/operations/updatereimbursableexpensetransactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateReimbursableExpenseTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `create_reimbursable_expense_response` | [Optional[shared.CreateReimbursableExpenseResponse]](../../models/shared/createreimbursableexpenseresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatesupplierrequest.md b/sync-for-expenses/docs/models/operations/updatesupplierrequest.md index f8a8afd4b..688abbe4b 100644 --- a/sync-for-expenses/docs/models/operations/updatesupplierrequest.md +++ b/sync-for-expenses/docs/models/operations/updatesupplierrequest.md @@ -8,7 +8,7 @@ | `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 | | `supplier_id` | *str* | :heavy_check_mark: | Unique identifier for a supplier. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `supplier` | [Optional[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `supplier` | [OptionalNullable[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | | `allow_sync_on_push_complete` | *Optional[bool]* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | | `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatesupplierresponse.md b/sync-for-expenses/docs/models/operations/updatesupplierresponse.md deleted file mode 100644 index 150ad2a09..000000000 --- a/sync-for-expenses/docs/models/operations/updatesupplierresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateSupplierResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `update_supplier_response` | [Optional[shared.UpdateSupplierResponse]](../../models/shared/updatesupplierresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/uploadexpenseattachmentresponse.md b/sync-for-expenses/docs/models/operations/uploadexpenseattachmentresponse.md deleted file mode 100644 index 10e6d2663..000000000 --- a/sync-for-expenses/docs/models/operations/uploadexpenseattachmentresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UploadExpenseAttachmentResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `attachment` | [Optional[shared.Attachment]](../../models/shared/attachment.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountingaccount.md b/sync-for-expenses/docs/models/shared/accountingaccount.md index 110315bc3..26b2f8b94 100644 --- a/sync-for-expenses/docs/models/shared/accountingaccount.md +++ b/sync-for-expenses/docs/models/shared/accountingaccount.md @@ -2,8 +2,6 @@ > **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. -View the coverage for accounts in the Data coverage explorer. - ## Overview Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. @@ -37,18 +35,18 @@ To determine the list of allowed categories for a specific integration, you can: | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | -| `current_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | -| `description` | *Optional[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | -| `fully_qualified_category` | *Optional[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | -| `fully_qualified_name` | *Optional[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `current_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fully_qualified_category` | *OptionalNullable[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | | `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | | `is_bank_account` | *Optional[bool]* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | | `metadata` | [Optional[shared.CreateAccountResponseMetadata]](../../models/shared/createaccountresponsemetadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | -| `nominal_code` | *Optional[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 Receivable | +| `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 | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | | `status` | [Optional[shared.AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `type` | [Optional[shared.AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | | `valid_datatype_links` | List[[shared.CreateAccountResponseValidDataTypeLinks](../../models/shared/createaccountresponsevaliddatatypelinks.md)] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountingaddress.md b/sync-for-expenses/docs/models/shared/accountingaddress.md index f9fa117c8..2fbc694ab 100644 --- a/sync-for-expenses/docs/models/shared/accountingaddress.md +++ b/sync-for-expenses/docs/models/shared/accountingaddress.md @@ -6,9 +6,9 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `type` | [shared.AccountingAddressType](../../models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | -| `city` | *Optional[str]* | :heavy_minus_sign: | City of the customer address. | -| `country` | *Optional[str]* | :heavy_minus_sign: | Country of the customer address. | -| `line1` | *Optional[str]* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *Optional[str]* | :heavy_minus_sign: | Line 2 of the customer address. | -| `postal_code` | *Optional[str]* | :heavy_minus_sign: | Postal code or zip code. | -| `region` | *Optional[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file +| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | City of the customer address. | +| `country` | *OptionalNullable[str]* | :heavy_minus_sign: | Country of the customer address. | +| `line1` | *OptionalNullable[str]* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *OptionalNullable[str]* | :heavy_minus_sign: | Line 2 of the customer address. | +| `postal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Postal code or zip code. | +| `region` | *OptionalNullable[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/updatecompanyresponse.md b/sync-for-expenses/docs/models/shared/accountingbankaccount.md similarity index 59% rename from sync-for-expenses/docs/models/operations/updatecompanyresponse.md rename to sync-for-expenses/docs/models/shared/accountingbankaccount.md index 13e3f91ea..62a02f042 100644 --- a/sync-for-expenses/docs/models/operations/updatecompanyresponse.md +++ b/sync-for-expenses/docs/models/shared/accountingbankaccount.md @@ -1,11 +1,41 @@ -# UpdateCompanyResponse +# ~~AccountingBankAccount~~ + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting software. +* The currency and balance of the account. +* The sort code and account number. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "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",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `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.

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

## Unknown currencies

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

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

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

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

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountingcustomer.md b/sync-for-expenses/docs/models/shared/accountingcustomer.md index 34bebd153..026a4abb1 100644 --- a/sync-for-expenses/docs/models/shared/accountingcustomer.md +++ b/sync-for-expenses/docs/models/shared/accountingcustomer.md @@ -1,7 +1,5 @@ # ~~AccountingCustomer~~ -> View the coverage for customers in the Data coverage explorer. - ## Overview A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). @@ -17,17 +15,17 @@ Customers' data links to accounts receivable [invoices](https://docs.codat.io/sy | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.CustomerStatus](../../models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `addresses` | List[[shared.CreateCustomerResponseAccountingAddress](../../models/shared/createcustomerresponseaccountingaddress.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | +| `addresses` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | | `contacts` | List[[shared.Contact](../../models/shared/contact.md)] | :heavy_minus_sign: | An array of Contacts. | | -| `customer_name` | *Optional[str]* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | +| `customer_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | | `default_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 | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting platform. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address the customer can be contacted by. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | | `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | -| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountingsupplier.md b/sync-for-expenses/docs/models/shared/accountingsupplier.md index ad1f945f7..91f163eae 100644 --- a/sync-for-expenses/docs/models/shared/accountingsupplier.md +++ b/sync-for-expenses/docs/models/shared/accountingsupplier.md @@ -1,7 +1,5 @@ # ~~AccountingSupplier~~ -> View the coverage for suppliers in the Data coverage explorer. - ## Overview From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). @@ -15,15 +13,15 @@ From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | | `addresses` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `default_currency` | *Optional[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | | `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountmappinginfo.md b/sync-for-expenses/docs/models/shared/accountmappinginfo.md index abcee6c8b..9f9808346 100644 --- a/sync-for-expenses/docs/models/shared/accountmappinginfo.md +++ b/sync-for-expenses/docs/models/shared/accountmappinginfo.md @@ -7,6 +7,10 @@ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | `account_type` | [Optional[shared.AccountMappingInfoAccountType]](../../models/shared/accountmappinginfoaccounttype.md) | :heavy_minus_sign: | Type of the account. | Expense | | `currency` | *Optional[str]* | :heavy_minus_sign: | Currency of the account. | GBP | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of account. | 6 | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the account as it appears in the companies accounting software. | Purchases | +| `fully_qualified_category` | *Optional[str]* | :heavy_minus_sign: | Full account type and category of the account | Expense.DirectCosts | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of account. | 127f3b99-8dc2-4b7e-854c-91ef9bd2757b | +| `is_bank_account` | *Optional[bool]* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the account as it appears in the company's accounting software. | Purchases | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code used to identify each nominal account in the accounting software. | 300 | +| `valid_for` | List[[shared.ValidFor](../../models/shared/validfor.md)] | :heavy_minus_sign: | Supported endpoints for the account. | | | `valid_transaction_types` | List[[shared.ValidTransactionTypes](../../models/shared/validtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountprototype.md b/sync-for-expenses/docs/models/shared/accountprototype.md index a4cf8c94a..03d002e05 100644 --- a/sync-for-expenses/docs/models/shared/accountprototype.md +++ b/sync-for-expenses/docs/models/shared/accountprototype.md @@ -6,14 +6,14 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | -| `current_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | -| `description` | *Optional[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | -| `fully_qualified_category` | *Optional[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | -| `fully_qualified_name` | *Optional[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `current_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fully_qualified_category` | *OptionalNullable[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | | `is_bank_account` | *Optional[bool]* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | -| `nominal_code` | *Optional[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 Receivable | +| `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 | | `status` | [Optional[shared.AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `type` | [Optional[shared.AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | | `valid_datatype_links` | List[[shared.ValidDataTypeLinks](../../models/shared/validdatatypelinks.md)] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountref.md b/sync-for-expenses/docs/models/shared/accountref.md deleted file mode 100644 index 167b8047c..000000000 --- a/sync-for-expenses/docs/models/shared/accountref.md +++ /dev/null @@ -1,11 +0,0 @@ -# AccountRef - -Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' from the Accounts data type. | -| `name` | *Optional[str]* | :heavy_minus_sign: | 'name' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/accountreference.md b/sync-for-expenses/docs/models/shared/accountreference.md new file mode 100644 index 000000000..227c43444 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/accountreference.md @@ -0,0 +1,10 @@ +# AccountReference + +Reference of the account you are transferring money from. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `id` | *str* | :heavy_check_mark: | 'id' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/adjustmenttransactionline.md b/sync-for-expenses/docs/models/shared/adjustmenttransactionline.md new file mode 100644 index 000000000..74acaa0f6 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/adjustmenttransactionline.md @@ -0,0 +1,12 @@ +# AdjustmentTransactionLine + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [shared.RecordRef](../../models/shared/recordref.md) | :heavy_check_mark: | N/A | | +| `amount` | *Decimal* | :heavy_check_mark: | Amount of the line. A positive line represents a debit; a negative line represents a credit. | 50 | +| `description` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +| `invoice_to` | [OptionalNullable[shared.InvoiceTo]](../../models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | +| `tracking_refs` | List[[shared.TrackingRefAdjustmentTransaction](../../models/shared/trackingrefadjustmenttransaction.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/adjustmenttransactionrequest.md b/sync-for-expenses/docs/models/shared/adjustmenttransactionrequest.md new file mode 100644 index 000000000..867190174 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/adjustmenttransactionrequest.md @@ -0,0 +1,13 @@ +# AdjustmentTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | | +| `date_` | *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 | +| `id` | *str* | :heavy_check_mark: | Your unique identifier for the transaction. | | +| `lines` | List[[shared.AdjustmentTransactionLine](../../models/shared/adjustmenttransactionline.md)] | :heavy_check_mark: | Array of transaction lines. | | +| `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. \| | | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the adjustment transaction. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/groupitems.md b/sync-for-expenses/docs/models/shared/adjustmenttransactionresponse.md similarity index 74% rename from sync-for-expenses/docs/models/shared/groupitems.md rename to sync-for-expenses/docs/models/shared/adjustmenttransactionresponse.md index 9977a30a3..9f2fce3ad 100644 --- a/sync-for-expenses/docs/models/shared/groupitems.md +++ b/sync-for-expenses/docs/models/shared/adjustmenttransactionresponse.md @@ -1,8 +1,8 @@ -# GroupItems +# AdjustmentTransactionResponse ## Fields | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file +| `sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique id of sync created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/apaccountref.md b/sync-for-expenses/docs/models/shared/apaccountref.md new file mode 100644 index 000000000..bcc81692d --- /dev/null +++ b/sync-for-expenses/docs/models/shared/apaccountref.md @@ -0,0 +1,8 @@ +# ApAccountRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. | 8000004C-1724173136 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/bankaccount.md b/sync-for-expenses/docs/models/shared/bankaccount.md index 6c1048e80..446eb908f 100644 --- a/sync-for-expenses/docs/models/shared/bankaccount.md +++ b/sync-for-expenses/docs/models/shared/bankaccount.md @@ -1,8 +1,39 @@ # BankAccount +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting software. +* The currency and balance of the account. +* The sort code and account number. + ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | The id of the account from which purchases are made | 32 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `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.

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

## Unknown currencies

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

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

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

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

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/bankaccountdetails.md b/sync-for-expenses/docs/models/shared/bankaccountdetails.md new file mode 100644 index 000000000..3501548d5 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/bankaccountdetails.md @@ -0,0 +1,8 @@ +# BankAccountDetails + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | The id of the account from which purchases are made | 32 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/bankaccountstatus.md b/sync-for-expenses/docs/models/shared/bankaccountstatus.md new file mode 100644 index 000000000..b4d504d31 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/bankaccountstatus.md @@ -0,0 +1,13 @@ +# BankAccountStatus + +Status of the bank account. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | +| `PENDING` | Pending | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/bankaccounttype.md b/sync-for-expenses/docs/models/shared/bankaccounttype.md new file mode 100644 index 000000000..a995a4e52 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/bankaccounttype.md @@ -0,0 +1,14 @@ +# BankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/clientratelimitresetwebhookdata.md b/sync-for-expenses/docs/models/shared/clientratelimitresetwebhookdata.md index efbbe87f9..e585938fa 100644 --- a/sync-for-expenses/docs/models/shared/clientratelimitresetwebhookdata.md +++ b/sync-for-expenses/docs/models/shared/clientratelimitresetwebhookdata.md @@ -7,5 +7,5 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | -| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | +| `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. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getcompanyresponse.md b/sync-for-expenses/docs/models/shared/clientratelimitwebhook.md similarity index 82% rename from sync-for-expenses/docs/models/operations/getcompanyresponse.md rename to sync-for-expenses/docs/models/shared/clientratelimitwebhook.md index a64f3c90c..063e072ec 100644 --- a/sync-for-expenses/docs/models/operations/getcompanyresponse.md +++ b/sync-for-expenses/docs/models/shared/clientratelimitwebhook.md @@ -1,11 +1,11 @@ -# GetCompanyResponse +# ClientRateLimitWebhook ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "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",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `payload` | [Optional[shared.ClientRateLimitWebhookPayload]](../../models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/createcompanyresponse.md b/sync-for-expenses/docs/models/shared/clientratelimitwebhookpayload.md similarity index 68% rename from sync-for-expenses/docs/models/operations/createcompanyresponse.md rename to sync-for-expenses/docs/models/shared/clientratelimitwebhookpayload.md index 2687774f3..449b685f6 100644 --- a/sync-for-expenses/docs/models/operations/createcompanyresponse.md +++ b/sync-for-expenses/docs/models/shared/clientratelimitwebhookpayload.md @@ -1,11 +1,10 @@ -# CreateCompanyResponse +# ClientRateLimitWebhookPayload ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "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",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"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",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | +| `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 | +| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/codatfile.md b/sync-for-expenses/docs/models/shared/codatfile.md index 5ff354d51..1b6592448 100644 --- a/sync-for-expenses/docs/models/shared/codatfile.md +++ b/sync-for-expenses/docs/models/shared/codatfile.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `content` | *bytes* | :heavy_check_mark: | N/A | -| `file_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | +| `file_name` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/company.md b/sync-for-expenses/docs/models/shared/company.md index 4ea964cc6..505d88ed2 100644 --- a/sync-for-expenses/docs/models/shared/company.md +++ b/sync-for-expenses/docs/models/shared/company.md @@ -15,9 +15,11 @@ When you create a company, you can specify a `name` and we will automatically ge | `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 | | `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 | -| `created_by_user_name` | *Optional[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `created_by_user_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `data_connections` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | | `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. | -| `groups` | List[[shared.GroupReference](../../models/shared/groupreference.md)] | :heavy_minus_sign: | An array of groups the company has been assigned to. | | | `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 | -| ~~`platform`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`platformKeys` name used when creating the company. | Xero | \ No newline at end of file +| `products` | List[*str*] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `reference_parent_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | +| `reference_subsidiary_companies` | List[[shared.CompanyReference](../../models/shared/companyreference.md)] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | +| `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-expenses/docs/models/shared/companyconfiguration.md b/sync-for-expenses/docs/models/shared/companyconfiguration.md index 97f6351c0..00c9598fb 100644 --- a/sync-for-expenses/docs/models/shared/companyconfiguration.md +++ b/sync-for-expenses/docs/models/shared/companyconfiguration.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `bank_account` | [shared.BankAccount](../../models/shared/bankaccount.md) | :heavy_check_mark: | N/A | -| `customer` | [shared.CustomerDetails](../../models/shared/customerdetails.md) | :heavy_check_mark: | N/A | -| `supplier` | [shared.SupplierDetails](../../models/shared/supplierdetails.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `bank_account` | [shared.BankAccountDetails](../../models/shared/bankaccountdetails.md) | :heavy_check_mark: | N/A | +| `customer` | [shared.CustomerDetails](../../models/shared/customerdetails.md) | :heavy_check_mark: | N/A | +| `supplier` | [shared.SupplierDetails](../../models/shared/supplierdetails.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/companyinformation.md b/sync-for-expenses/docs/models/shared/companyinformation.md new file mode 100644 index 000000000..8129bc596 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/companyinformation.md @@ -0,0 +1,27 @@ +# CompanyInformation + +Company info provides standard details about a linked company such as their address, phone number, and company registration. + +> **Company information or companies?** +> +> Company information is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accounting_platform_ref` | *OptionalNullable[str]* | :heavy_minus_sign: | Identifier or reference for the company in the accounting software. | | +| `addresses` | List[[shared.AccountingAddress](../../models/shared/accountingaddress.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `base_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. Used by the currency rate. | | +| `company_legal_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Registered legal name of the linked company. | | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the linked company. | | +| `created_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 | +| `financial_year_start_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 | +| `ledger_lock_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 | +| `phone_numbers` | List[[shared.Phone](../../models/shared/phone.md)] | :heavy_minus_sign: | An array of phone numbers. | | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. | | +| `source_urls` | Dict[str, *str*] | :heavy_minus_sign: | URL addresses for the accounting source.

For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). | | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company tax number. | | +| `web_links` | List[[shared.Weblink](../../models/shared/weblink.md)] | :heavy_minus_sign: | An array of weblinks. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/companyinformationtype.md b/sync-for-expenses/docs/models/shared/companyinformationtype.md new file mode 100644 index 000000000..d44732c6d --- /dev/null +++ b/sync-for-expenses/docs/models/shared/companyinformationtype.md @@ -0,0 +1,12 @@ +# CompanyInformationType + +The type of the weblink. + + +## Values + +| Name | Value | +| --------- | --------- | +| `WEBSITE` | Website | +| `SOCIAL` | Social | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/companyreference.md b/sync-for-expenses/docs/models/shared/companyreference.md new file mode 100644 index 000000000..b651f69d5 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/companyreference.md @@ -0,0 +1,12 @@ +# CompanyReference + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `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. | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `links` | [Optional[shared.CompanyReferenceLinks]](../../models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the company | Codat Ltd. | +| `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-expenses/docs/models/shared/companyreferencelinks.md b/sync-for-expenses/docs/models/shared/companyreferencelinks.md new file mode 100644 index 000000000..ee01fd320 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/companyreferencelinks.md @@ -0,0 +1,10 @@ +# CompanyReferenceLinks + +A collection of links for the company. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `portal` | *Optional[str]* | :heavy_minus_sign: | Link to the company page in the portal. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/companyrequestbody.md b/sync-for-expenses/docs/models/shared/companyrequestbody.md index 40bf2f400..3b85563a1 100644 --- a/sync-for-expenses/docs/models/shared/companyrequestbody.md +++ b/sync-for-expenses/docs/models/shared/companyrequestbody.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | 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. | -| `groups` | List[[shared.GroupItems](../../models/shared/groupitems.md)] | :heavy_minus_sign: | Reference to the groups that the company is assigned to. | | \ No newline at end of file +| `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-expenses/docs/models/shared/companysyncstatus.md b/sync-for-expenses/docs/models/shared/companysyncstatus.md index caf0e0539..8e8337f4d 100644 --- a/sync-for-expenses/docs/models/shared/companysyncstatus.md +++ b/sync-for-expenses/docs/models/shared/companysyncstatus.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | d4d73051-ed31-42b6-99f6-d288cd940992 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | d4d73051-ed31-42b6-99f6-d288cd940992 | | `data_pushed` | *Optional[bool]* | :heavy_minus_sign: | Boolean of whether the sync resulted in data being pushed. | | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | Error message of the sync. | | -| `sync_exception_message` | *Optional[str]* | :heavy_minus_sign: | Exception message of the sync. | | -| `sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the sync. | a6a22aff-a43a-411d-a910-2dae73217cce | -| `sync_status` | *Optional[str]* | :heavy_minus_sign: | Text status of the sync. | Completed | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message of the sync. | | +| `sync_exception_message` | *OptionalNullable[str]* | :heavy_minus_sign: | Exception message of the sync. | | +| `sync_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the sync. | a6a22aff-a43a-411d-a910-2dae73217cce | +| `sync_status` | *OptionalNullable[str]* | :heavy_minus_sign: | Text status of the sync. | Complete | | `sync_status_code` | *Optional[int]* | :heavy_minus_sign: | Status code of the sync. | 2000 | | `sync_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-expenses/docs/models/shared/connection.md b/sync-for-expenses/docs/models/shared/connection.md index 5a29ae5cb..da1267119 100644 --- a/sync-for-expenses/docs/models/shared/connection.md +++ b/sync-for-expenses/docs/models/shared/connection.md @@ -25,7 +25,6 @@ Before you can use a data connection to pull or push data, the company must gran | `source_id` | *str* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | | `source_type` | [shared.SourceType](../../models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | | `status` | [shared.DataConnectionStatus](../../models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `additional_properties` | *Optional[Any]* | :heavy_minus_sign: | N/A | | | `connection_info` | Dict[str, *str*] | :heavy_minus_sign: | N/A | | | `data_connection_errors` | List[[shared.DataConnectionError](../../models/shared/dataconnectionerror.md)] | :heavy_minus_sign: | N/A | | | `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 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/contact.md b/sync-for-expenses/docs/models/shared/contact.md index 35a8e7ea2..2e80ace11 100644 --- a/sync-for-expenses/docs/models/shared/contact.md +++ b/sync-for-expenses/docs/models/shared/contact.md @@ -7,7 +7,7 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.CustomerStatus](../../models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | | `address` | [Optional[shared.Items]](../../models/shared/items.md) | :heavy_minus_sign: | N/A | | -| `email` | *Optional[str]* | :heavy_minus_sign: | Email of a contact for a customer. | | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Email of a contact for a customer. | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of a contact for a customer. | | -| `phone` | List[[shared.Phone](../../models/shared/phone.md)] | :heavy_minus_sign: | An array of Phone numbers. | | \ No newline at end of file +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of a contact for a customer. | | +| `phone` | List[[shared.PhoneNumberItems](../../models/shared/phonenumberitems.md)] | :heavy_minus_sign: | An array of Phone numbers. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createaccountresponse.md b/sync-for-expenses/docs/models/shared/createaccountresponse.md index 013b7787a..2757a3460 100644 --- a/sync-for-expenses/docs/models/shared/createaccountresponse.md +++ b/sync-for-expenses/docs/models/shared/createaccountresponse.md @@ -13,9 +13,9 @@ | `status_code` | *int* | :heavy_check_mark: | Push status code. | | | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `data` | [Optional[shared.AccountingAccount]](../../models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | +| `data` | [OptionalNullable[shared.AccountingAccount]](../../models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | | `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | -| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createaccountresponsemetadata.md b/sync-for-expenses/docs/models/shared/createaccountresponsemetadata.md index d2b75fdd6..33f612f3f 100644 --- a/sync-for-expenses/docs/models/shared/createaccountresponsemetadata.md +++ b/sync-for-expenses/docs/models/shared/createaccountresponsemetadata.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `is_deleted` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file +| `is_deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createaccountresponsevaliddatatypelinks.md b/sync-for-expenses/docs/models/shared/createaccountresponsevaliddatatypelinks.md index 083498c8f..00f6b195f 100644 --- a/sync-for-expenses/docs/models/shared/createaccountresponsevaliddatatypelinks.md +++ b/sync-for-expenses/docs/models/shared/createaccountresponsevaliddatatypelinks.md @@ -47,4 +47,4 @@ If you'd like us to extend support to more data types or integrations, suggest o | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | | `links` | List[*str*] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | -| `property` | *Optional[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file +| `property` | *OptionalNullable[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createbankaccountresponse.md b/sync-for-expenses/docs/models/shared/createbankaccountresponse.md new file mode 100644 index 000000000..c783e2fb1 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/createbankaccountresponse.md @@ -0,0 +1,21 @@ +# CreateBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *str* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `data` | [OptionalNullable[shared.AccountingBankAccount]](../../models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createbankaccountresponsebankaccounttype.md b/sync-for-expenses/docs/models/shared/createbankaccountresponsebankaccounttype.md new file mode 100644 index 000000000..b3cdb6f60 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/createbankaccountresponsebankaccounttype.md @@ -0,0 +1,14 @@ +# CreateBankAccountResponseBankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createcustomerresponse.md b/sync-for-expenses/docs/models/shared/createcustomerresponse.md index 31276c18f..d0cc51c87 100644 --- a/sync-for-expenses/docs/models/shared/createcustomerresponse.md +++ b/sync-for-expenses/docs/models/shared/createcustomerresponse.md @@ -13,9 +13,9 @@ | `status_code` | *int* | :heavy_check_mark: | Push status code. | | | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `data` | [Optional[shared.AccountingCustomer]](../../models/shared/accountingcustomer.md) | :heavy_minus_sign: | N/A | | +| `data` | [OptionalNullable[shared.AccountingCustomer]](../../models/shared/accountingcustomer.md) | :heavy_minus_sign: | N/A | | | `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | -| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createcustomerresponseaccountingaddress.md b/sync-for-expenses/docs/models/shared/createcustomerresponseaccountingaddress.md deleted file mode 100644 index 1c73c3931..000000000 --- a/sync-for-expenses/docs/models/shared/createcustomerresponseaccountingaddress.md +++ /dev/null @@ -1,14 +0,0 @@ -# CreateCustomerResponseAccountingAddress - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [shared.AccountingAddressType](../../models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | -| `city` | *Optional[str]* | :heavy_minus_sign: | City of the customer address. | -| `country` | *Optional[str]* | :heavy_minus_sign: | Country of the customer address. | -| `line1` | *Optional[str]* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *Optional[str]* | :heavy_minus_sign: | Line 2 of the customer address. | -| `postal_code` | *Optional[str]* | :heavy_minus_sign: | Postal code or zip code. | -| `region` | *Optional[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createexpenserequest.md b/sync-for-expenses/docs/models/shared/createexpenserequest.md deleted file mode 100644 index 80929e594..000000000 --- a/sync-for-expenses/docs/models/shared/createexpenserequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# CreateExpenseRequest - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `items` | List[[shared.ExpenseTransaction](../../models/shared/expensetransaction.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createexpenseresponse.md b/sync-for-expenses/docs/models/shared/createexpenseresponse.md index 8278ec84b..7a5d81b08 100644 --- a/sync-for-expenses/docs/models/shared/createexpenseresponse.md +++ b/sync-for-expenses/docs/models/shared/createexpenseresponse.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `dataset_id` | *Optional[str]* | :heavy_minus_sign: | Unique id of dataset created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file +| `sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique id of sync created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createreimbursableexpenserequest.md b/sync-for-expenses/docs/models/shared/createreimbursableexpenserequest.md deleted file mode 100644 index b60213896..000000000 --- a/sync-for-expenses/docs/models/shared/createreimbursableexpenserequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# CreateReimbursableExpenseRequest - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `items` | List[List[[shared.ReimbursableExpenseTransaction](../../models/shared/reimbursableexpensetransaction.md)]] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createsupplierresponse.md b/sync-for-expenses/docs/models/shared/createsupplierresponse.md index c372cb5ba..0345ee33f 100644 --- a/sync-for-expenses/docs/models/shared/createsupplierresponse.md +++ b/sync-for-expenses/docs/models/shared/createsupplierresponse.md @@ -13,9 +13,9 @@ | `status_code` | *int* | :heavy_check_mark: | Push status code. | | | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `data` | [Optional[shared.AccountingSupplier]](../../models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `data` | [OptionalNullable[shared.AccountingSupplier]](../../models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | | `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | -| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createtransferrequest.md b/sync-for-expenses/docs/models/shared/createtransferrequest.md deleted file mode 100644 index ad26c9fb0..000000000 --- a/sync-for-expenses/docs/models/shared/createtransferrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateTransferRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `date_` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `description` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | -| `from_` | [Optional[shared.TransferDetails]](../../models/shared/transferdetails.md) | :heavy_minus_sign: | N/A | | -| `to` | [Optional[shared.TransferDetails]](../../models/shared/transferdetails.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/customer.md b/sync-for-expenses/docs/models/shared/customer.md index c96c487b7..2e6bc2e66 100644 --- a/sync-for-expenses/docs/models/shared/customer.md +++ b/sync-for-expenses/docs/models/shared/customer.md @@ -1,7 +1,5 @@ # Customer -> View the coverage for customers in the Data coverage explorer. - ## Overview A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). @@ -15,17 +13,17 @@ Customers' data links to accounts receivable [invoices](https://docs.codat.io/sy | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.CustomerStatus](../../models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `addresses` | List[[shared.AccountingAddress](../../models/shared/accountingaddress.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | +| `addresses` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | | `contacts` | List[[shared.Contact](../../models/shared/contact.md)] | :heavy_minus_sign: | An array of Contacts. | | -| `customer_name` | *Optional[str]* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | +| `customer_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | | `default_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 | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting platform. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address the customer can be contacted by. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | | `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | -| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/customerdetails.md b/sync-for-expenses/docs/models/shared/customerdetails.md index cb7ce06be..a9f2451b9 100644 --- a/sync-for-expenses/docs/models/shared/customerdetails.md +++ b/sync-for-expenses/docs/models/shared/customerdetails.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting platform. | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/data.md b/sync-for-expenses/docs/models/shared/data.md deleted file mode 100644 index 057dcd889..000000000 --- a/sync-for-expenses/docs/models/shared/data.md +++ /dev/null @@ -1,9 +0,0 @@ -# Data - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the failed sync. | a9367074-b5c3-42c4-9be4-be129f43577e | -| `sync_type` | *Optional[str]* | :heavy_minus_sign: | The type of sync being performed. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/dataconnectionerror.md b/sync-for-expenses/docs/models/shared/dataconnectionerror.md index 2c12bb648..413231fec 100644 --- a/sync-for-expenses/docs/models/shared/dataconnectionerror.md +++ b/sync-for-expenses/docs/models/shared/dataconnectionerror.md @@ -5,7 +5,9 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A brief message about the error. | | +| `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 | -| `status_code` | *Optional[str]* | :heavy_minus_sign: | The HTTP status code returned by the error. | | -| `status_text` | *Optional[str]* | :heavy_minus_sign: | A non-numeric status code/text. | | \ 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. | 2022-10-23 00:00:00 +0000 UTC | +| `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. | | +| `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. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/datasetstatus.md b/sync-for-expenses/docs/models/shared/datasetstatus.md new file mode 100644 index 000000000..42a224341 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/datasetstatus.md @@ -0,0 +1,30 @@ +# DatasetStatus + +The current status of the dataset. + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `INITIAL` | Initial | +| `QUEUED` | Queued | +| `FETCHING` | Fetching | +| `MAP_QUEUED` | MapQueued | +| `MAPPING` | Mapping | +| `COMPLETE` | Complete | +| `FETCH_ERROR` | FetchError | +| `MAP_ERROR` | MapError | +| `INTERNAL_ERROR` | InternalError | +| `PROCESSING_QUEUED` | ProcessingQueued | +| `PROCESSING` | Processing | +| `PROCESSING_ERROR` | ProcessingError | +| `VALIDATION_QUEUED` | ValidationQueued | +| `VALIDATING` | Validating | +| `VALIDATION_ERROR` | ValidationError | +| `AUTH_ERROR` | AuthError | +| `CANCELLED` | Cancelled | +| `NOT_SUPPORTED` | NotSupported | +| `RATE_LIMIT_ERROR` | RateLimitError | +| `PERMISSIONS_ERROR` | PermissionsError | +| `PREREQUISITE_NOT_MET` | PrerequisiteNotMet | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/datastatus.md b/sync-for-expenses/docs/models/shared/datastatus.md index 6d6e94948..07be889e4 100644 --- a/sync-for-expenses/docs/models/shared/datastatus.md +++ b/sync-for-expenses/docs/models/shared/datastatus.md @@ -7,7 +7,7 @@ Describes the state of data in the Codat cache for a company and data type | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `current_status` | *str* | :heavy_check_mark: | The current status of the dataset in Codat's cache. | | +| `current_status` | [shared.Status](../../models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | | `data_type` | [shared.DataTypes](../../models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | | `last_successful_sync` | *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 | | `latest_successful_sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | diff --git a/sync-for-expenses/docs/models/shared/errorstatus.md b/sync-for-expenses/docs/models/shared/errorstatus.md new file mode 100644 index 000000000..02c0ec3d9 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/errorstatus.md @@ -0,0 +1,11 @@ +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `ACTIVE` | Active | +| `RESOLVED` | Resolved | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/errorvalidationitem.md b/sync-for-expenses/docs/models/shared/errorvalidationitem.md index 346bb51f1..fca2ef14a 100644 --- a/sync-for-expenses/docs/models/shared/errorvalidationitem.md +++ b/sync-for-expenses/docs/models/shared/errorvalidationitem.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `item_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | -| `validator_name` | *Optional[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file +| `item_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validator_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/contactref.md b/sync-for-expenses/docs/models/shared/expensecontactref.md similarity index 81% rename from sync-for-expenses/docs/models/shared/contactref.md rename to sync-for-expenses/docs/models/shared/expensecontactref.md index fca8b68cb..d1609e63c 100644 --- a/sync-for-expenses/docs/models/shared/contactref.md +++ b/sync-for-expenses/docs/models/shared/expensecontactref.md @@ -1,9 +1,9 @@ -# ContactRef +# ExpenseContactRef ## Fields | Field | Type | Required | Description | Example | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier of supplier or customer. | 40e3e57c-2322-4898-966c-ca41adfd23fd | +| `id` | *str* | :heavy_check_mark: | Identifier of supplier or customer. | 40e3e57c-2322-4898-966c-ca41adfd23fd | | `type` | [Optional[shared.Type]](../../models/shared/type.md) | :heavy_minus_sign: | The type of contact. | Supplier | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/operations/getsupplierresponse.md b/sync-for-expenses/docs/models/shared/expensessyncwebhook.md similarity index 83% rename from sync-for-expenses/docs/models/operations/getsupplierresponse.md rename to sync-for-expenses/docs/models/shared/expensessyncwebhook.md index 5cf12b136..001e360e5 100644 --- a/sync-for-expenses/docs/models/operations/getsupplierresponse.md +++ b/sync-for-expenses/docs/models/shared/expensessyncwebhook.md @@ -1,11 +1,11 @@ -# GetSupplierResponse +# ExpensesSyncWebhook ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `supplier` | [Optional[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | Success | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | expenses.sync.successful | +| `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 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | +| `payload` | [Optional[shared.ExpensesSyncWebhookPayload]](../../models/shared/expensessyncwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/expensessyncwebhookpayload.md b/sync-for-expenses/docs/models/shared/expensessyncwebhookpayload.md new file mode 100644 index 000000000..e849000df --- /dev/null +++ b/sync-for-expenses/docs/models/shared/expensessyncwebhookpayload.md @@ -0,0 +1,10 @@ +# ExpensesSyncWebhookPayload + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `reference_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | +| `sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the sync. | +| `transactions` | List[[shared.Transaction](../../models/shared/transaction.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/expensetransaction.md b/sync-for-expenses/docs/models/shared/expensetransaction.md index b6499c9f6..92fcb1494 100644 --- a/sync-for-expenses/docs/models/shared/expensetransaction.md +++ b/sync-for-expenses/docs/models/shared/expensetransaction.md @@ -3,16 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | -| `id` | *str* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | -| `issue_date` | *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 | -| `type` | [shared.ExpenseTransactionType](../../models/shared/expensetransactiontype.md) | :heavy_check_mark: | The type of transaction. | Payment | -| `bank_account_ref` | [Optional[shared.ExpenseTransactionBankAccountReference]](../../models/shared/expensetransactionbankaccountreference.md) | :heavy_minus_sign: | N/A | | -| `contact_ref` | [Optional[shared.ContactRef]](../../models/shared/contactref.md) | :heavy_minus_sign: | N/A | | -| `currency_rate` | *Optional[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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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, include the required currency rate in the expense transaction. \| | | -| `lines` | List[[shared.ExpenseTransactionLine](../../models/shared/expensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | -| `merchant_name` | *Optional[str]* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | -| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | -| `post_as_draft` | *Optional[bool]* | :heavy_minus_sign: | For supported accouting platforms, setting this optional property to true will post the transaction to a drafted state. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `id` | *str* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | +| `issue_date` | *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 | +| `type` | [shared.ExpenseTransactionType](../../models/shared/expensetransactiontype.md) | :heavy_check_mark: | The type of transaction. | Payment | +| `bank_account_ref` | [Optional[shared.BankAccountReference]](../../models/shared/bankaccountreference.md) | :heavy_minus_sign: | N/A | | +| `contact_ref` | [Optional[shared.ExpenseContactRef]](../../models/shared/expensecontactref.md) | :heavy_minus_sign: | N/A | | +| `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. \| | | +| `lines` | List[[shared.ExpenseTransactionLine](../../models/shared/expensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | +| `merchant_name` | *Optional[str]* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | +| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +| `post_as_draft` | *OptionalNullable[bool]* | :heavy_minus_sign: | This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central. | | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the expense transaction. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/expensetransactionline.md b/sync-for-expenses/docs/models/shared/expensetransactionline.md index 307868ec1..0597510df 100644 --- a/sync-for-expenses/docs/models/shared/expensetransactionline.md +++ b/sync-for-expenses/docs/models/shared/expensetransactionline.md @@ -3,11 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `account_ref` | [shared.RecordRef](../../models/shared/recordref.md) | :heavy_check_mark: | N/A | | -| `net_amount` | *Decimal* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 110.42 | -| `invoice_to` | [Optional[shared.InvoiceTo]](../../models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier of the customer the expense is billable to. The invoiceTo object is currently only supported for QBO. | | -| `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of tax for the line. | 14.43 | -| `tax_rate_ref` | [Optional[shared.RecordRef]](../../models/shared/recordref.md) | :heavy_minus_sign: | N/A | | -| `tracking_refs` | List[[shared.TrackingRef](../../models/shared/trackingref.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `net_amount` | *Decimal* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 100 | +| `account_ref` | [Optional[shared.RecordRef]](../../models/shared/recordref.md) | :heavy_minus_sign: | N/A | | +| `invoice_to` | [OptionalNullable[shared.InvoiceTo]](../../models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | +| `item_ref` | [OptionalNullable[shared.ItemRef]](../../models/shared/itemref.md) | :heavy_minus_sign: | N/A | | +| `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of tax for the line. | 20 | +| `tax_rate_ref` | [Optional[shared.RecordRef]](../../models/shared/recordref.md) | :heavy_minus_sign: | N/A | | +| `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-expenses/docs/models/shared/expensetransactiontype.md b/sync-for-expenses/docs/models/shared/expensetransactiontype.md index ce4e0c626..8fd4ae17c 100644 --- a/sync-for-expenses/docs/models/shared/expensetransactiontype.md +++ b/sync-for-expenses/docs/models/shared/expensetransactiontype.md @@ -5,13 +5,9 @@ The type of transaction. ## Values -| Name | Value | -| ---------------- | ---------------- | -| `PAYMENT` | Payment | -| `REFUND` | Refund | -| `REWARD` | Reward | -| `CHARGEBACK` | Chargeback | -| `TRANSFER_IN` | TransferIn | -| `TRANSFER_OUT` | TransferOut | -| `ADJUSTMENT_IN` | AdjustmentIn | -| `ADJUSTMENT_OUT` | AdjustmentOut | \ No newline at end of file +| Name | Value | +| ------------ | ------------ | +| `PAYMENT` | Payment | +| `REFUND` | Refund | +| `REWARD` | Reward | +| `CHARGEBACK` | Chargeback | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/from_.md b/sync-for-expenses/docs/models/shared/from_.md new file mode 100644 index 000000000..069b6cda6 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/from_.md @@ -0,0 +1,9 @@ +# From + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `account_ref` | [shared.AccountReference](../../models/shared/accountreference.md) | :heavy_check_mark: | Reference of the account you are transferring money from. | +| `amount` | *Decimal* | :heavy_check_mark: | Amount that has been transferred from the account in the native currency of the account. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/initiatesync.md b/sync-for-expenses/docs/models/shared/initiatesync.md deleted file mode 100644 index 5ca2e6879..000000000 --- a/sync-for-expenses/docs/models/shared/initiatesync.md +++ /dev/null @@ -1,8 +0,0 @@ -# InitiateSync - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `dataset_ids` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/invoiceto.md b/sync-for-expenses/docs/models/shared/invoiceto.md index 160a11e08..7e1b8850e 100644 --- a/sync-for-expenses/docs/models/shared/invoiceto.md +++ b/sync-for-expenses/docs/models/shared/invoiceto.md @@ -1,11 +1,11 @@ # InvoiceTo -Unique identifier of the customer the expense is billable to. The invoiceTo object is currently only supported for QBO. +Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `data_type` | [Optional[shared.InvoiceToDataType]](../../models/shared/invoicetodatatype.md) | :heavy_minus_sign: | The type of contact. | customers | -| `id` | *Optional[str]* | :heavy_minus_sign: | identifier of customer. | 80000002-1674552702 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | identifier of customer. | 80000002-1674552702 | +| `type` | [Optional[shared.InvoiceToType]](../../models/shared/invoicetotype.md) | :heavy_minus_sign: | The type of contact. | customer | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/invoicetodatatype.md b/sync-for-expenses/docs/models/shared/invoicetodatatype.md deleted file mode 100644 index a46493d17..000000000 --- a/sync-for-expenses/docs/models/shared/invoicetodatatype.md +++ /dev/null @@ -1,10 +0,0 @@ -# InvoiceToDataType - -The type of contact. - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `CUSTOMERS` | customers | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/invoicetotype.md b/sync-for-expenses/docs/models/shared/invoicetotype.md new file mode 100644 index 000000000..d236b6933 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/invoicetotype.md @@ -0,0 +1,10 @@ +# InvoiceToType + +The type of contact. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `CUSTOMER` | customer | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/itemref.md b/sync-for-expenses/docs/models/shared/itemref.md new file mode 100644 index 000000000..502d43740 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/itemref.md @@ -0,0 +1,8 @@ +# ItemRef + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. | 80000002-1675158984 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/items.md b/sync-for-expenses/docs/models/shared/items.md index 5df15c285..38d3365ac 100644 --- a/sync-for-expenses/docs/models/shared/items.md +++ b/sync-for-expenses/docs/models/shared/items.md @@ -6,9 +6,9 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `type` | [shared.AccountingAddressType](../../models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | -| `city` | *Optional[str]* | :heavy_minus_sign: | City of the customer address. | -| `country` | *Optional[str]* | :heavy_minus_sign: | Country of the customer address. | -| `line1` | *Optional[str]* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *Optional[str]* | :heavy_minus_sign: | Line 2 of the customer address. | -| `postal_code` | *Optional[str]* | :heavy_minus_sign: | Postal code or zip code. | -| `region` | *Optional[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file +| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | City of the customer address. | +| `country` | *OptionalNullable[str]* | :heavy_minus_sign: | Country of the customer address. | +| `line1` | *OptionalNullable[str]* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *OptionalNullable[str]* | :heavy_minus_sign: | Line 2 of the customer address. | +| `postal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Postal code or zip code. | +| `region` | *OptionalNullable[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/mappingoptions.md b/sync-for-expenses/docs/models/shared/mappingoptions.md index 4f615b4b0..3b366f7dd 100644 --- a/sync-for-expenses/docs/models/shared/mappingoptions.md +++ b/sync-for-expenses/docs/models/shared/mappingoptions.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `accounts` | List[[shared.AccountMappingInfo](../../models/shared/accountmappinginfo.md)] | :heavy_minus_sign: | Array of available accounts for mapping. | | -| `expense_provider` | *Optional[str]* | :heavy_minus_sign: | Name of the expense integration. | Partner Expense | +| `expense_provider` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the expense integration. | Partner Expense | | `tax_rates` | List[[shared.TaxRateMappingInfo](../../models/shared/taxratemappinginfo.md)] | :heavy_minus_sign: | Array of available tax rates for mapping. | | | `tracking_categories` | List[[shared.TrackingCategoryMappingInfo](../../models/shared/trackingcategorymappinginfo.md)] | :heavy_minus_sign: | Array of available tracking categories for mapping. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/metadata.md b/sync-for-expenses/docs/models/shared/metadata.md index cb411f043..8fb4a6e5c 100644 --- a/sync-for-expenses/docs/models/shared/metadata.md +++ b/sync-for-expenses/docs/models/shared/metadata.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `is_deleted` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file +| `is_deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/phone.md b/sync-for-expenses/docs/models/shared/phone.md index e9af373f5..bc45fef3d 100644 --- a/sync-for-expenses/docs/models/shared/phone.md +++ b/sync-for-expenses/docs/models/shared/phone.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | | `type` | [shared.PhoneNumberType](../../models/shared/phonenumbertype.md) | :heavy_check_mark: | The type of phone number | | -| `number` | *Optional[str]* | :heavy_minus_sign: | A phone number. | +44 25691 154789 | \ No newline at end of file +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | A phone number. | +44 25691 154789 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/phonenumberitems.md b/sync-for-expenses/docs/models/shared/phonenumberitems.md new file mode 100644 index 000000000..011f3c606 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/phonenumberitems.md @@ -0,0 +1,9 @@ +# PhoneNumberItems + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | [shared.PhoneNumberType](../../models/shared/phonenumbertype.md) | :heavy_check_mark: | The type of phone number | | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | A phone number. | +44 25691 154789 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/pulloperation.md b/sync-for-expenses/docs/models/shared/pulloperation.md index 8bcdf5d2b..5cfeb2fb3 100644 --- a/sync-for-expenses/docs/models/shared/pulloperation.md +++ b/sync-for-expenses/docs/models/shared/pulloperation.md @@ -16,7 +16,7 @@ Information about a queued, in progress or completed pull operation. | `is_errored` | *bool* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | | `progress` | *int* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | | `requested` | *str* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `status` | [shared.Status](../../models/shared/status.md) | :heavy_check_mark: | The current status of the pull operation. | Complete | +| `status` | [shared.DatasetStatus](../../models/shared/datasetstatus.md) | :heavy_check_mark: | The current status of the dataset. | | | `completed` | *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 | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about a transient or persistent error. | | -| `status_description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | +| `status_description` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/pushfieldvalidation.md b/sync-for-expenses/docs/models/shared/pushfieldvalidation.md index 60ce548f0..d3558cfad 100644 --- a/sync-for-expenses/docs/models/shared/pushfieldvalidation.md +++ b/sync-for-expenses/docs/models/shared/pushfieldvalidation.md @@ -7,4 +7,4 @@ | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `details` | *str* | :heavy_check_mark: | Details on the validation issue. | | `field` | *Optional[str]* | :heavy_minus_sign: | Field name that resulted in the validation issue. | -| `ref` | *Optional[str]* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file +| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/pushoperation.md b/sync-for-expenses/docs/models/shared/pushoperation.md index bcf668d10..13591843b 100644 --- a/sync-for-expenses/docs/models/shared/pushoperation.md +++ b/sync-for-expenses/docs/models/shared/pushoperation.md @@ -14,7 +14,7 @@ | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

Number of seconds the push operation must complete within before it times out. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/pushoperationchange.md b/sync-for-expenses/docs/models/shared/pushoperationchange.md index 3238ecf64..d5516b5c7 100644 --- a/sync-for-expenses/docs/models/shared/pushoperationchange.md +++ b/sync-for-expenses/docs/models/shared/pushoperationchange.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `attachment_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | +| `attachment_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | | `record_ref` | [Optional[shared.PushOperationRef]](../../models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[shared.PushChangeType]](../../models/shared/pushchangetype.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/reimbursableexpensetransaction.md b/sync-for-expenses/docs/models/shared/reimbursableexpensetransaction.md index e77c43206..e36e3fdb6 100644 --- a/sync-for-expenses/docs/models/shared/reimbursableexpensetransaction.md +++ b/sync-for-expenses/docs/models/shared/reimbursableexpensetransaction.md @@ -3,16 +3,15 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | -| `due_date` | *Any* | :heavy_check_mark: | N/A | | -| `id` | *str* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | -| `issue_date` | *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 | -| `all_of` | *Optional[Any]* | :heavy_minus_sign: | N/A | | -| `bank_account_ref` | [Optional[shared.BankAccountReference]](../../models/shared/bankaccountreference.md) | :heavy_minus_sign: | N/A | | -| `currency_rate` | *Optional[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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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, include the required currency rate in the expense transaction. \| | | -| `lines` | List[[shared.ReimbursableExpenseTransactionLine](../../models/shared/reimbursableexpensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | -| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | -| `record_ref` | [Optional[shared.ContactRef]](../../models/shared/contactref.md) | :heavy_minus_sign: | N/A | | -| `reference` | *Optional[str]* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contact_ref` | [shared.ReimbursementContactRef](../../models/shared/reimbursementcontactref.md) | :heavy_check_mark: | N/A | | +| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `due_date` | *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 | +| `id` | *str* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | +| `issue_date` | *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 | +| `ap_account_ref` | [OptionalNullable[shared.ApAccountRef]](../../models/shared/apaccountref.md) | :heavy_minus_sign: | N/A | | +| `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. \| | | +| `lines` | List[[shared.ReimbursableExpenseTransactionLine](../../models/shared/reimbursableexpensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | +| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/reimbursableexpensetransactionline.md b/sync-for-expenses/docs/models/shared/reimbursableexpensetransactionline.md index cb531dc9c..f2003dbf9 100644 --- a/sync-for-expenses/docs/models/shared/reimbursableexpensetransactionline.md +++ b/sync-for-expenses/docs/models/shared/reimbursableexpensetransactionline.md @@ -3,11 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `account_ref` | [shared.RecordRef](../../models/shared/recordref.md) | :heavy_check_mark: | N/A | | -| `net_amount` | *Decimal* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 110.42 | -| `invoice_to` | [Optional[shared.InvoiceTo]](../../models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier of the customer the expense is billable to. The invoiceTo object is currently only supported for QBO. | | -| `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of tax for the line. | 14.43 | -| `tax_rate_ref` | [Optional[shared.RecordRef]](../../models/shared/recordref.md) | :heavy_minus_sign: | N/A | | -| `tracking_refs` | List[[shared.TrackingRef](../../models/shared/trackingref.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `net_amount` | *Decimal* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 100 | +| `account_ref` | [Optional[shared.RecordRef]](../../models/shared/recordref.md) | :heavy_minus_sign: | N/A | | +| `description` | *Optional[str]* | :heavy_minus_sign: | line description | 2-night hotel stay | +| `invoice_to` | [OptionalNullable[shared.InvoiceTo]](../../models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | +| `item_ref` | [OptionalNullable[shared.ItemRef]](../../models/shared/itemref.md) | :heavy_minus_sign: | N/A | | +| `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of tax for the line. | 20 | +| `tax_rate_ref` | [Optional[shared.RecordRef]](../../models/shared/recordref.md) | :heavy_minus_sign: | N/A | | +| `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-expenses/docs/models/shared/expensetransactionbankaccountreference.md b/sync-for-expenses/docs/models/shared/reimbursementcontactref.md similarity index 63% rename from sync-for-expenses/docs/models/shared/expensetransactionbankaccountreference.md rename to sync-for-expenses/docs/models/shared/reimbursementcontactref.md index 588260c71..bb509541f 100644 --- a/sync-for-expenses/docs/models/shared/expensetransactionbankaccountreference.md +++ b/sync-for-expenses/docs/models/shared/reimbursementcontactref.md @@ -1,8 +1,8 @@ -# ExpenseTransactionBankAccountReference +# ReimbursementContactRef ## Fields | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier of the bank account. | 787dfb37-5707-4dc0-8a86-8d74e4cc78ea | \ No newline at end of file +| `id` | *str* | :heavy_check_mark: | Identifier of contact. | 40e3e57c-2322-4898-966c-ca41adfd23fd | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/schematransaction.md b/sync-for-expenses/docs/models/shared/schematransaction.md new file mode 100644 index 000000000..63efd2454 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/schematransaction.md @@ -0,0 +1,11 @@ +# SchemaTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `integration_type` | [OptionalNullable[shared.IntegrationType]](../../models/shared/integrationtype.md) | :heavy_minus_sign: | Type of transaction that has been processed e.g. Expense or Bank Feed. | expenses | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | Metadata such as validation errors or the resulting record created in the accounting software. | | +| `status` | [OptionalNullable[shared.TransactionStatus]](../../models/shared/transactionstatus.md) | :heavy_minus_sign: | Status of the transaction. | Completed | +| `transaction_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Your unique idenfier of the transaction. | aa02271d-ed5f-47f5-be76-778d5905225a | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/status.md b/sync-for-expenses/docs/models/shared/status.md index 564fc4f24..2fb340539 100644 --- a/sync-for-expenses/docs/models/shared/status.md +++ b/sync-for-expenses/docs/models/shared/status.md @@ -1,6 +1,6 @@ # Status -The current status of the pull operation. +The current status of the dataset. ## Values @@ -24,8 +24,6 @@ The current status of the pull operation. | `VALIDATION_ERROR` | ValidationError | | `AUTH_ERROR` | AuthError | | `CANCELLED` | Cancelled | -| `ROUTING` | Routing | -| `ROUTING_ERROR` | RoutingError | | `NOT_SUPPORTED` | NotSupported | | `RATE_LIMIT_ERROR` | RateLimitError | | `PERMISSIONS_ERROR` | PermissionsError | diff --git a/sync-for-expenses/docs/models/shared/supplementaldata.md b/sync-for-expenses/docs/models/shared/supplementaldata.md index f9d04fc2b..7415a8519 100644 --- a/sync-for-expenses/docs/models/shared/supplementaldata.md +++ b/sync-for-expenses/docs/models/shared/supplementaldata.md @@ -2,7 +2,7 @@ Supplemental data is additional data you can include in our standard data types. -It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. +It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. ## Fields diff --git a/sync-for-expenses/docs/models/shared/supplier.md b/sync-for-expenses/docs/models/shared/supplier.md index 88d7c00a5..d78c617b9 100644 --- a/sync-for-expenses/docs/models/shared/supplier.md +++ b/sync-for-expenses/docs/models/shared/supplier.md @@ -1,7 +1,5 @@ # Supplier -> View the coverage for suppliers in the Data coverage explorer. - ## Overview From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). @@ -13,15 +11,15 @@ From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | | `addresses` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `default_currency` | *Optional[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | | `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/supplierdetails.md b/sync-for-expenses/docs/models/shared/supplierdetails.md index 081a86d93..fe67734d8 100644 --- a/sync-for-expenses/docs/models/shared/supplierdetails.md +++ b/sync-for-expenses/docs/models/shared/supplierdetails.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/syncinitiated.md b/sync-for-expenses/docs/models/shared/syncinitiated.md deleted file mode 100644 index 037d92441..000000000 --- a/sync-for-expenses/docs/models/shared/syncinitiated.md +++ /dev/null @@ -1,8 +0,0 @@ -# SyncInitiated - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| `sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the sync initiated. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/syncstartedwebhook.md b/sync-for-expenses/docs/models/shared/syncstartedwebhook.md deleted file mode 100644 index 53800da82..000000000 --- a/sync-for-expenses/docs/models/shared/syncstartedwebhook.md +++ /dev/null @@ -1,17 +0,0 @@ -# SyncStartedWebhook - -Webhook request body used to notify that a sync has started. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `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. | | -| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `data` | [Optional[shared.Data]](../../models/shared/data.md) | :heavy_minus_sign: | N/A | | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| ~~`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. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/taxratemappinginfo.md b/sync-for-expenses/docs/models/shared/taxratemappinginfo.md index 27698b835..edb55bd02 100644 --- a/sync-for-expenses/docs/models/shared/taxratemappinginfo.md +++ b/sync-for-expenses/docs/models/shared/taxratemappinginfo.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `code` | *Optional[str]* | :heavy_minus_sign: | Code for the tax rate from the accounting platform. | UK Standard Rate (Bills) | -| `effective_tax_rate` | *Optional[Decimal]* | :heavy_minus_sign: | Effective tax rate. | 20 | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of tax rate. | 59_Bills | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | UK Standard Rate (Bills) Bills | -| `total_tax_rate` | *Optional[Decimal]* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | 20 | -| `valid_transaction_types` | List[[shared.TaxRateMappingInfoValidTransactionTypes](../../models/shared/taxratemappinginfovalidtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code for the tax rate from the accounting software. | 20% Bill tax | +| `effective_tax_rate` | *Optional[Decimal]* | :heavy_minus_sign: | Effective tax rate. | 20 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of tax rate. | 23_Bills | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tax rate in the accounting software. | 20% Bill tax Bills | +| `total_tax_rate` | *Optional[Decimal]* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | 20 | +| `valid_transaction_types` | List[[shared.ValidTransactionTypes](../../models/shared/validtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/taxratemappinginfovalidtransactiontypes.md b/sync-for-expenses/docs/models/shared/taxratemappinginfovalidtransactiontypes.md deleted file mode 100644 index d2f7d4eaf..000000000 --- a/sync-for-expenses/docs/models/shared/taxratemappinginfovalidtransactiontypes.md +++ /dev/null @@ -1,15 +0,0 @@ -# TaxRateMappingInfoValidTransactionTypes - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `PAYMENT` | Payment | -| `REFUND` | Refund | -| `REWARD` | Reward | -| `CHARGEBACK` | Chargeback | -| `TRANSFER_IN` | TransferIn | -| `TRANSFER_OUT` | TransferOut | -| `ADJUSTMENT_IN` | AdjustmentIn | -| `ADJUSTMENT_OUT` | AdjustmentOut | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/to.md b/sync-for-expenses/docs/models/shared/to.md new file mode 100644 index 000000000..9e32f98f0 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/to.md @@ -0,0 +1,9 @@ +# To + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [shared.TransferTransactionRequestAccountReference](../../models/shared/transfertransactionrequestaccountreference.md) | :heavy_check_mark: | Reference of the account you are transferring money to. | +| `amount` | *Decimal* | :heavy_check_mark: | Amount that has been transferred to the account in the native currency of the account. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/trackingcategorymappinginfo.md b/sync-for-expenses/docs/models/shared/trackingcategorymappinginfo.md index daa85c2fa..86fe420f0 100644 --- a/sync-for-expenses/docs/models/shared/trackingcategorymappinginfo.md +++ b/sync-for-expenses/docs/models/shared/trackingcategorymappinginfo.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `has_children` | *Optional[bool]* | :heavy_minus_sign: | Boolean of whether the tracking category has child categories. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the tracking category. | DEPARTMENT_2 | -| `modified_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tracking category as it appears in the accounting software. | New York | -| `parent_id` | *Optional[str]* | :heavy_minus_sign: | ID of the parent tracking category | DEPARTMENTS | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `has_children` | *Optional[bool]* | :heavy_minus_sign: | Boolean of whether the tracking category has child categories. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the tracking category. | DEPARTMENT_2 | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tracking category as it appears in the accounting software. | New York | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the parent tracking category | DEPARTMENTS | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/trackingrefadjustmenttransaction.md b/sync-for-expenses/docs/models/shared/trackingrefadjustmenttransaction.md new file mode 100644 index 000000000..bd5ddd3f7 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/trackingrefadjustmenttransaction.md @@ -0,0 +1,9 @@ +# TrackingRefAdjustmentTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `data_type` | [Optional[shared.TrackingRefAdjustmentTransactionDataType]](../../models/shared/trackingrefadjustmenttransactiondatatype.md) | :heavy_minus_sign: | The type of the linked reference | trackingCategories | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/trackingrefadjustmenttransactiondatatype.md b/sync-for-expenses/docs/models/shared/trackingrefadjustmenttransactiondatatype.md new file mode 100644 index 000000000..c2a6d32bb --- /dev/null +++ b/sync-for-expenses/docs/models/shared/trackingrefadjustmenttransactiondatatype.md @@ -0,0 +1,12 @@ +# TrackingRefAdjustmentTransactionDataType + +The type of the linked reference + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `TRACKING_CATEGORIES` | trackingCategories | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/transaction.md b/sync-for-expenses/docs/models/shared/transaction.md index 4ab7f9a7d..07593a6e5 100644 --- a/sync-for-expenses/docs/models/shared/transaction.md +++ b/sync-for-expenses/docs/models/shared/transaction.md @@ -3,9 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `integration_type` | [Optional[shared.IntegrationType]](../../models/shared/integrationtype.md) | :heavy_minus_sign: | Type of transaction that has been processed e.g. Expense or Bank Feed. | expenses | -| `message` | *Optional[str]* | :heavy_minus_sign: | Metadata such as validation errors or the resulting record created in the accounting software. | | -| `status` | [Optional[shared.TransactionStatus]](../../models/shared/transactionstatus.md) | :heavy_minus_sign: | Status of the transaction. | Completed | -| `transaction_id` | *Optional[str]* | :heavy_minus_sign: | Your unique idenfier of the transaction. | aa02271d-ed5f-47f5-be76-778d5905225a | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message for failed transaction. | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the transaction. | +| `status` | [Optional[shared.TransactionDefinitionsStatus]](../../models/shared/transactiondefinitionsstatus.md) | :heavy_minus_sign: | Status of transaction. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/transactiondefinitionsstatus.md b/sync-for-expenses/docs/models/shared/transactiondefinitionsstatus.md new file mode 100644 index 000000000..ab0d38dd5 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/transactiondefinitionsstatus.md @@ -0,0 +1,14 @@ +# TransactionDefinitionsStatus + +Status of transaction. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UNKNOWN` | Unknown | +| `PUSH_ERROR` | PushError | +| `COMPLETED` | Completed | +| `FAILED` | Failed | +| `PENDING` | Pending | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/transactions.md b/sync-for-expenses/docs/models/shared/transactions.md index 374d23df5..4772df220 100644 --- a/sync-for-expenses/docs/models/shared/transactions.md +++ b/sync-for-expenses/docs/models/shared/transactions.md @@ -9,4 +9,4 @@ | `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. | | -| `results` | List[[shared.Transaction](../../models/shared/transaction.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `results` | List[[shared.SchemaTransaction](../../models/shared/schematransaction.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/transferdetails.md b/sync-for-expenses/docs/models/shared/transferdetails.md deleted file mode 100644 index f73e9fd78..000000000 --- a/sync-for-expenses/docs/models/shared/transferdetails.md +++ /dev/null @@ -1,9 +0,0 @@ -# TransferDetails - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | -| `amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the transfer. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/transfertransactionrequest.md b/sync-for-expenses/docs/models/shared/transfertransactionrequest.md new file mode 100644 index 000000000..d42466ede --- /dev/null +++ b/sync-for-expenses/docs/models/shared/transfertransactionrequest.md @@ -0,0 +1,11 @@ +# TransferTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `date_` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `from_` | [shared.From](../../models/shared/from_.md) | :heavy_check_mark: | N/A | | +| `to` | [shared.To](../../models/shared/to.md) | :heavy_check_mark: | N/A | | +| `description` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | Transfer from bank account Y to bank account Z | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/transfertransactionrequestaccountreference.md b/sync-for-expenses/docs/models/shared/transfertransactionrequestaccountreference.md new file mode 100644 index 000000000..b691ef214 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/transfertransactionrequestaccountreference.md @@ -0,0 +1,10 @@ +# TransferTransactionRequestAccountReference + +Reference of the account you are transferring money to. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `id` | *str* | :heavy_check_mark: | 'id' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/createtransferresponse.md b/sync-for-expenses/docs/models/shared/transfertransactionresponse.md similarity index 95% rename from sync-for-expenses/docs/models/shared/createtransferresponse.md rename to sync-for-expenses/docs/models/shared/transfertransactionresponse.md index 0f3bec07f..f2cddc486 100644 --- a/sync-for-expenses/docs/models/shared/createtransferresponse.md +++ b/sync-for-expenses/docs/models/shared/transfertransactionresponse.md @@ -1,4 +1,4 @@ -# CreateTransferResponse +# TransferTransactionResponse ## Fields diff --git a/sync-for-expenses/docs/models/shared/updatecustomerresponse.md b/sync-for-expenses/docs/models/shared/updatecustomerresponse.md index b6ec24c36..330396f1d 100644 --- a/sync-for-expenses/docs/models/shared/updatecustomerresponse.md +++ b/sync-for-expenses/docs/models/shared/updatecustomerresponse.md @@ -13,9 +13,9 @@ | `status_code` | *int* | :heavy_check_mark: | Push status code. | | | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `data` | [Optional[shared.UpdateCustomerResponseAccountingCustomer]](../../models/shared/updatecustomerresponseaccountingcustomer.md) | :heavy_minus_sign: | N/A | | +| `data` | [OptionalNullable[shared.UpdateCustomerResponseAccountingCustomer]](../../models/shared/updatecustomerresponseaccountingcustomer.md) | :heavy_minus_sign: | N/A | | | `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | -| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingaddress.md b/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingaddress.md deleted file mode 100644 index 2ae08e6f2..000000000 --- a/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingaddress.md +++ /dev/null @@ -1,14 +0,0 @@ -# UpdateCustomerResponseAccountingAddress - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [shared.AccountingAddressType](../../models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | -| `city` | *Optional[str]* | :heavy_minus_sign: | City of the customer address. | -| `country` | *Optional[str]* | :heavy_minus_sign: | Country of the customer address. | -| `line1` | *Optional[str]* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *Optional[str]* | :heavy_minus_sign: | Line 2 of the customer address. | -| `postal_code` | *Optional[str]* | :heavy_minus_sign: | Postal code or zip code. | -| `region` | *Optional[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingcustomer.md b/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingcustomer.md index 5a19f57ac..8d382fbc7 100644 --- a/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingcustomer.md +++ b/sync-for-expenses/docs/models/shared/updatecustomerresponseaccountingcustomer.md @@ -1,7 +1,5 @@ # ~~UpdateCustomerResponseAccountingCustomer~~ -> View the coverage for customers in the Data coverage explorer. - ## Overview A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). @@ -17,17 +15,17 @@ Customers' data links to accounts receivable [invoices](https://docs.codat.io/sy | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.CustomerStatus](../../models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `addresses` | List[[shared.UpdateCustomerResponseAccountingAddress](../../models/shared/updatecustomerresponseaccountingaddress.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | +| `addresses` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | | `contacts` | List[[shared.Contact](../../models/shared/contact.md)] | :heavy_minus_sign: | An array of Contacts. | | -| `customer_name` | *Optional[str]* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | +| `customer_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | | `default_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 | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting platform. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address the customer can be contacted by. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | | `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | -| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updateexpenserequest.md b/sync-for-expenses/docs/models/shared/updateexpenserequest.md index 741e81aa2..204ae1b62 100644 --- a/sync-for-expenses/docs/models/shared/updateexpenserequest.md +++ b/sync-for-expenses/docs/models/shared/updateexpenserequest.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `issue_date` | *str* | :heavy_check_mark: | Date the transaction was recorded. | 2022-06-28T00:00:00.000Z | -| `type` | *Any* | :heavy_check_mark: | N/A | | -| `bank_account_ref` | [Optional[shared.UpdateExpenseRequestBankAccountReference]](../../models/shared/updateexpenserequestbankaccountreference.md) | :heavy_minus_sign: | N/A | | -| `contact_ref` | [Optional[shared.ContactRef]](../../models/shared/contactref.md) | :heavy_minus_sign: | N/A | | -| `currency` | *Optional[str]* | :heavy_minus_sign: | Currency the transaction was recorded in. | GBP | -| `currency_rate` | *Optional[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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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, include the required currency rate in the expense transaction. \| | | -| `lines` | List[[shared.ExpenseTransactionLine](../../models/shared/expensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | -| `merchant_name` | *Optional[str]* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | -| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `issue_date` | *str* | :heavy_check_mark: | Date the transaction was recorded. | 2022-06-28T00:00:00.000Z | +| `type` | [shared.UpdateExpenseRequestType](../../models/shared/updateexpenserequesttype.md) | :heavy_check_mark: | The type of transaction. | Payment | +| `bank_account_ref` | [Optional[shared.UpdateExpenseRequestBankAccountReference]](../../models/shared/updateexpenserequestbankaccountreference.md) | :heavy_minus_sign: | N/A | | +| `contact_ref` | [Optional[shared.ExpenseContactRef]](../../models/shared/expensecontactref.md) | :heavy_minus_sign: | N/A | | +| `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. \| | | +| `lines` | List[[shared.ExpenseTransactionLine](../../models/shared/expensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | +| `merchant_name` | *Optional[str]* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | +| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updateexpenserequesttype.md b/sync-for-expenses/docs/models/shared/updateexpenserequesttype.md new file mode 100644 index 000000000..672ee78f4 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/updateexpenserequesttype.md @@ -0,0 +1,13 @@ +# UpdateExpenseRequestType + +The type of transaction. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `PAYMENT` | Payment | +| `REFUND` | Refund | +| `REWARD` | Reward | +| `CHARGEBACK` | Chargeback | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updatereimbursableexpensetransactionrequest.md b/sync-for-expenses/docs/models/shared/updatereimbursableexpensetransactionrequest.md new file mode 100644 index 000000000..3751d6fa4 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/updatereimbursableexpensetransactionrequest.md @@ -0,0 +1,16 @@ +# UpdateReimbursableExpenseTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contact_ref` | [shared.ReimbursementContactRef](../../models/shared/reimbursementcontactref.md) | :heavy_check_mark: | N/A | | +| `currency` | *str* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `due_date` | *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 | +| `issue_date` | *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 | +| `ap_account_ref` | [OptionalNullable[shared.ApAccountRef]](../../models/shared/apaccountref.md) | :heavy_minus_sign: | N/A | | +| `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. \| | | +| `lines` | List[[shared.ReimbursableExpenseTransactionLine](../../models/shared/reimbursableexpensetransactionline.md)] | :heavy_minus_sign: | Array of transaction lines. | | +| `notes` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updatesupplierresponse.md b/sync-for-expenses/docs/models/shared/updatesupplierresponse.md index aefc237bc..bea4a87c4 100644 --- a/sync-for-expenses/docs/models/shared/updatesupplierresponse.md +++ b/sync-for-expenses/docs/models/shared/updatesupplierresponse.md @@ -13,9 +13,9 @@ | `status_code` | *int* | :heavy_check_mark: | Push status code. | | | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `data` | [Optional[shared.UpdateSupplierResponseAccountingSupplier]](../../models/shared/updatesupplierresponseaccountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `data` | [OptionalNullable[shared.UpdateSupplierResponseAccountingSupplier]](../../models/shared/updatesupplierresponseaccountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | | `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | -| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/updatesupplierresponseaccountingsupplier.md b/sync-for-expenses/docs/models/shared/updatesupplierresponseaccountingsupplier.md index e5f7cc256..82bc233ea 100644 --- a/sync-for-expenses/docs/models/shared/updatesupplierresponseaccountingsupplier.md +++ b/sync-for-expenses/docs/models/shared/updatesupplierresponseaccountingsupplier.md @@ -1,7 +1,5 @@ # ~~UpdateSupplierResponseAccountingSupplier~~ -> View the coverage for suppliers in the Data coverage explorer. - ## Overview From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). @@ -15,15 +13,15 @@ From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | | `addresses` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of Addresses. | | -| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `default_currency` | *Optional[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | | `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/validationitem.md b/sync-for-expenses/docs/models/shared/validationitem.md index fe913f43e..1aaf084c9 100644 --- a/sync-for-expenses/docs/models/shared/validationitem.md +++ b/sync-for-expenses/docs/models/shared/validationitem.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `item_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | -| `validator_name` | *Optional[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file +| `item_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validator_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/validdatatypelinks.md b/sync-for-expenses/docs/models/shared/validdatatypelinks.md index 61f7858d8..809a80db0 100644 --- a/sync-for-expenses/docs/models/shared/validdatatypelinks.md +++ b/sync-for-expenses/docs/models/shared/validdatatypelinks.md @@ -47,4 +47,4 @@ If you'd like us to extend support to more data types or integrations, suggest o | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | | `links` | List[*str*] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | -| `property` | *Optional[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file +| `property` | *OptionalNullable[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/validfor.md b/sync-for-expenses/docs/models/shared/validfor.md new file mode 100644 index 000000000..4d6bb5070 --- /dev/null +++ b/sync-for-expenses/docs/models/shared/validfor.md @@ -0,0 +1,14 @@ +# ValidFor + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `EXPENSE_TRANSACTIONS_PAYMENT` | expense-transactions.Payment | +| `EXPENSE_TRANSACTIONS_REFUND` | expense-transactions.Refund | +| `EXPENSE_TRANSACTIONS_REWARD` | expense-transactions.Reward | +| `EXPENSE_TRANSACTIONS_CHARGEBACK` | expense-transactions.Chargeback | +| `REIMBURSABLE_EXPENSE_TRANSACTIONS` | reimbursable-expense-transactions | +| `TRANSFER_TRANSACTIONS` | transfer-transactions | +| `ADJUSTMENT_TRANSACTIONS` | adjustment-transactions | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/validtransactiontypes.md b/sync-for-expenses/docs/models/shared/validtransactiontypes.md index caed065f1..07fc5f95d 100644 --- a/sync-for-expenses/docs/models/shared/validtransactiontypes.md +++ b/sync-for-expenses/docs/models/shared/validtransactiontypes.md @@ -3,13 +3,9 @@ ## Values -| Name | Value | -| ---------------- | ---------------- | -| `PAYMENT` | Payment | -| `REFUND` | Refund | -| `REWARD` | Reward | -| `CHARGEBACK` | Chargeback | -| `TRANSFER_IN` | TransferIn | -| `TRANSFER_OUT` | TransferOut | -| `ADJUSTMENT_IN` | AdjustmentIn | -| `ADJUSTMENT_OUT` | AdjustmentOut | \ No newline at end of file +| Name | Value | +| ------------ | ------------ | +| `PAYMENT` | Payment | +| `REFUND` | Refund | +| `REWARD` | Reward | +| `CHARGEBACK` | Chargeback | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/shared/weblink.md b/sync-for-expenses/docs/models/shared/weblink.md new file mode 100644 index 000000000..99ac51f5a --- /dev/null +++ b/sync-for-expenses/docs/models/shared/weblink.md @@ -0,0 +1,11 @@ +# Weblink + +Weblink associated with the company. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `type` | [Optional[shared.CompanyInformationType]](../../models/shared/companyinformationtype.md) | :heavy_minus_sign: | The type of the weblink. | +| `url` | *Optional[str]* | :heavy_minus_sign: | The full URL for the weblink. | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/webhooks/clientratelimitreachedresponse.md b/sync-for-expenses/docs/models/webhooks/clientratelimitreachedresponse.md deleted file mode 100644 index 4408f824d..000000000 --- a/sync-for-expenses/docs/models/webhooks/clientratelimitreachedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitReachedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/webhooks/clientratelimitresetresponse.md b/sync-for-expenses/docs/models/webhooks/clientratelimitresetresponse.md deleted file mode 100644 index 14a24dc94..000000000 --- a/sync-for-expenses/docs/models/webhooks/clientratelimitresetresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitResetResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/webhooks/synccompleteresponse.md b/sync-for-expenses/docs/models/webhooks/synccompleteresponse.md deleted file mode 100644 index 443293629..000000000 --- a/sync-for-expenses/docs/models/webhooks/synccompleteresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# SyncCompleteResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/webhooks/syncfailedresponse.md b/sync-for-expenses/docs/models/webhooks/syncfailedresponse.md deleted file mode 100644 index 0ce59f2b4..000000000 --- a/sync-for-expenses/docs/models/webhooks/syncfailedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# SyncFailedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/models/webhooks/syncstartedresponse.md b/sync-for-expenses/docs/models/webhooks/syncstartedresponse.md deleted file mode 100644 index 512f8f94c..000000000 --- a/sync-for-expenses/docs/models/webhooks/syncstartedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# SyncStartedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/accounts/README.md b/sync-for-expenses/docs/sdks/accounts/README.md index 1d395be17..6caf340dc 100644 --- a/sync-for-expenses/docs/sdks/accounts/README.md +++ b/sync-for-expenses/docs/sdks/accounts/README.md @@ -3,7 +3,7 @@ ## Overview -Accounts +Create accounts and view create account options. ### Available Operations @@ -20,31 +20,37 @@ The *Create account* endpoint creates a new [account](https://docs.codat.io/sync Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. - - ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateAccountRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.accounts.create(req) - -if res.create_account_response is not None: - # handle response - pass +) as s: + res = s.accounts.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "account_prototype": { + "currency": "USD", + "current_balance": Decimal("0"), + "description": "Invoices the business has issued but has not yet collected payment on.", + "fully_qualified_category": "Asset.Current", + "fully_qualified_name": "Fixed Asset", + "name": "Accounts Receivable", + "nominal_code": "610", + "status": shared.AccountStatus.ACTIVE, + "type": shared.AccountType.ASSET, + }, + }) + + if res is not None: + # handle response + pass ``` @@ -55,16 +61,16 @@ if res.create_account_response is not None: | `request` | [operations.CreateAccountRequest](../../models/operations/createaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateAccountResponse](../../models/operations/createaccountresponse.md)** +**[shared.CreateAccountResponse](../../models/shared/createaccountresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_create_model @@ -76,31 +82,25 @@ The *Get create account model* endpoint returns the expected data for the reques See the *response examples* for integration-specific indicative models. -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. - - ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetCreateChartOfAccountsModelRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) +) as s: + res = s.accounts.get_create_model(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -res = s.accounts.get_create_model(req) - -if res.push_option is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -111,13 +111,13 @@ if res.push_option is not None: | `request` | [operations.GetCreateChartOfAccountsModelRequest](../../models/operations/getcreatechartofaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetCreateChartOfAccountsModelResponse](../../models/operations/getcreatechartofaccountsmodelresponse.md)** +**[shared.PushOption](../../models/shared/pushoption.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/adjustments/README.md b/sync-for-expenses/docs/sdks/adjustments/README.md new file mode 100644 index 000000000..a136b04d3 --- /dev/null +++ b/sync-for-expenses/docs/sdks/adjustments/README.md @@ -0,0 +1,103 @@ +# Adjustments +(*adjustments*) + +## Overview + +Create transactions that represent your adjustments to your customers' spend. + +### Available Operations + +* [create](#create) - Create adjustment transaction + +## create + +Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. + +Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. + +### Supported Integrations + +| Integration | Supported | +|-----------------------|-----------| +| QuickBooks Desktop | Yes | + +### Example Usage + +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal + +with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.adjustments.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": [ + { + "currency": "USD", + "date_": "2024-05-21T00:00:00+00:00", + "id": "3357b3df-5f2e-465d-b9ba-226519dbb8f1", + "lines": [ + { + "account_ref": { + "id": "80000018-1671793811", + }, + "amount": Decimal("50"), + "description": "debit line", + "invoice_to": { + "id": "80000002-1674552702", + "type": shared.InvoiceToType.CUSTOMER, + }, + "tracking_refs": [ + { + "data_type": shared.TrackingRefAdjustmentTransactionDataType.TRACKING_CATEGORIES, + "id": "80000003-1674553958", + }, + ], + }, + { + "account_ref": { + "id": "80000028-1671794219", + }, + "amount": Decimal("-50"), + "description": "credit line", + "tracking_refs": [ + { + "data_type": shared.TrackingRefAdjustmentTransactionDataType.TRACKING_CATEGORIES, + "id": "80000003-1674553958", + }, + ], + }, + ], + "currency_rate": Decimal("1"), + "reference": "test reference", + }, + ], + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `request` | [operations.CreateAdjustmentTransactionRequest](../../models/operations/createadjustmenttransactionrequest.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.AdjustmentTransactionResponse](../../models/shared/adjustmenttransactionresponse.md)** + +### 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 diff --git a/sync-for-expenses/docs/sdks/attachments/README.md b/sync-for-expenses/docs/sdks/attachments/README.md index 493d68024..f3c6773d3 100644 --- a/sync-for-expenses/docs/sdks/attachments/README.md +++ b/sync-for-expenses/docs/sdks/attachments/README.md @@ -3,7 +3,7 @@ ## Overview -Upload attachmens to expenses, transfers and reimbursable expense transactions. +Attach receipts to a transaction for a complete audit trail. ### Available Operations @@ -13,42 +13,41 @@ Upload attachmens to expenses, transfers and reimbursable expense transactions. The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. -[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. +[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. **Integration-specific behaviour** Each accounting software supports different file formats and sizes. -| Integration | File Size | File Extension | -|-------------|-------------|--------------------------------------------------------------------------------------------------------------| -| Xero | 4MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | -| QuickBooks Online | 100MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | -| NetSuite | 100MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | -| Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that "You can attach any type of file, such as text, image, or video files". | +| Integration | File size | File extension |Supported transaction type +|-------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|--------------| +| **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | +| **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `ReimbursableExpenses`, `ExpensePayment`, `ExpenseRefund` | +| **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`ExpensePayment`, `ExpenseRefund` | +| **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types +| **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | +| **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.attachments.upload(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "sync_id": "6fb40d5e-b13e-11ed-afa1-0242ac120002", + "transaction_id": "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }) -req = operations.UploadExpenseAttachmentRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - sync_id='6fb40d5e-b13e-11ed-afa1-0242ac120002', - transaction_id='336694d8-2dca-4cb5-a28d-3ccb83e55eee', -) - -res = s.attachments.upload(req) - -if res.attachment is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -59,13 +58,13 @@ if res.attachment is not None: | `request` | [operations.UploadExpenseAttachmentRequest](../../models/operations/uploadexpenseattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UploadExpenseAttachmentResponse](../../models/operations/uploadexpenseattachmentresponse.md)** +**[shared.Attachment](../../models/shared/attachment.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/bankaccounts/README.md b/sync-for-expenses/docs/sdks/bankaccounts/README.md new file mode 100644 index 000000000..a3892867e --- /dev/null +++ b/sync-for-expenses/docs/sdks/bankaccounts/README.md @@ -0,0 +1,119 @@ +# BankAccounts +(*bank_accounts*) + +## Overview + +Create bank accounts and view create bank account options. + +### Available Operations + +* [create](#create) - Create bank account +* [get_create_model](#get_create_model) - Get create bank account model + +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). + +### Example Usage + +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared + +with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.bank_accounts.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bank_account": { + "account_name": "GBP Bank Account", + "account_number": "12345678", + "account_type": shared.BankAccountType.DEBIT, + "currency": "GBP", + "status": shared.BankAccountStatus.ACTIVE, + }, + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountRequest](../../models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[shared.CreateBankAccountResponse](../../models/shared/createbankaccountresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_model + +The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + + +### Example Usage + +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared + +with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.bank_accounts.get_create_model(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateBankAccountsModelRequest](../../models/operations/getcreatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[shared.PushOption](../../models/shared/pushoption.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 diff --git a/sync-for-expenses/docs/sdks/codatsyncexpenses/README.md b/sync-for-expenses/docs/sdks/codatsyncexpenses/README.md index b56efefd0..e86931ee9 100644 --- a/sync-for-expenses/docs/sdks/codatsyncexpenses/README.md +++ b/sync-for-expenses/docs/sdks/codatsyncexpenses/README.md @@ -1,19 +1,37 @@ # CodatSyncExpenses SDK - ## Overview Sync for Expenses: The API for Sync for Expenses. Sync for Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality -integrations with multiple accounting platforms through a standardized API. - -[Read more...](https://docs.codat.io/sync-for-expenses/overview) +integrations with multiple accounting software through a standardized API. -[See our OpenAPI spec](https://github.com/codatio/oas) +[Explore product](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you're expecting? We've [reorganized our products](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Sync for Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). -### Available Operations +--- + +## Endpoints + +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Configuration | View and manage mapping configuration and defaults for expense transactions. | +| Sync | Monitor the status of data syncs. | +| Expenses | Create and update transactions that represent your customers' spend. | +| Transfers | Create and update transactions that represent the movement of your customers' money. | +| Reimbursements | Create and update transactions that represent your customers' repayable spend. | +| Attachments | Attach receipts to a transaction for a complete audit trail. | +| Transaction status | Monitor the status of individual transactions in data syncs. | +| Manage data | Control and monitor the retrieval of data from an integration. | +| Push operations | View historic push operations. | +| Accounts | Create accounts and view account schemas. | +| Customers | Get, create, and update customers. | +| Suppliers | Get, create, and update suppliers. | + +### Available Operations diff --git a/sync-for-expenses/docs/sdks/companies/README.md b/sync-for-expenses/docs/sdks/companies/README.md index cc2ea6dd9..e05c03360 100644 --- a/sync-for-expenses/docs/sdks/companies/README.md +++ b/sync-for-expenses/docs/sdks/companies/README.md @@ -3,7 +3,7 @@ ## Overview -Create and manage your Codat companies. +Create and manage your SMB users' companies. ### Available Operations @@ -25,25 +25,21 @@ If forbidden characters (see `name` pattern) are present in the request, a compa ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) - -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -54,16 +50,16 @@ if res.company is not None: | `request` | [shared.CompanyRequestBody](../../models/shared/companyrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateCompanyResponse](../../models/operations/createcompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -76,24 +72,19 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-expe ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.DeleteCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.delete(req) +) as s: + s.companies.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -104,16 +95,12 @@ if res is not None: | `request` | [operations.DeleteCompanyRequest](../../models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[operations.DeleteCompanyResponse](../../models/operations/deletecompanyresponse.md)** ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -126,24 +113,21 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-expe ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.GetCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.get(req) - -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -154,20 +138,20 @@ if res.company is not None: | `request` | [operations.GetCompanyRequest](../../models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetCompanyResponse](../../models/operations/getcompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list -The *List companies* endpoint returns a list of [companies] associated to your instances. +The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. @@ -175,26 +159,24 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-expe ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListCompaniesRequest( - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.companies.list(req) - -if res.companies is not None: - # handle response - pass +) as s: + res = s.companies.list(request={ + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -205,21 +187,20 @@ if res.companies is not None: | `request` | [operations.ListCompaniesRequest](../../models/operations/listcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListCompaniesResponse](../../models/operations/listcompaniesresponse.md)** +**[shared.Companies](../../models/shared/companies.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update Use the *Update company* endpoint to update both the name and description of the company. -If you use [groups](https://docs.codat.io/sync-for-expenses-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/sync-for-expenses-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/sync-for-expenses-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. @@ -227,24 +208,24 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-expe ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.update(req) - -if res.company is not None: - # handle response - pass +) as s: + res = s.companies.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_request_body": { + "name": "New Name", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -255,13 +236,13 @@ if res.company is not None: | `request` | [operations.UpdateCompanyRequest](../../models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UpdateCompanyResponse](../../models/operations/updatecompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/companyinfo/README.md b/sync-for-expenses/docs/sdks/companyinfo/README.md new file mode 100644 index 000000000..6c9e87e29 --- /dev/null +++ b/sync-for-expenses/docs/sdks/companyinfo/README.md @@ -0,0 +1,53 @@ +# CompanyInfo +(*company_info*) + +## Overview + +View the company information of your customers' linked accounting software. + +### Available Operations + +* [get](#get) - Get company info + +## get + +Gets the latest basic info for a company. + +### Example Usage + +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared + +with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.company_info.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyInfoRequest](../../models/operations/getcompanyinforequest.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.CompanyInformation](../../models/shared/companyinformation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/configuration/README.md b/sync-for-expenses/docs/sdks/configuration/README.md index 7aa1e61fb..ef727f375 100644 --- a/sync-for-expenses/docs/sdks/configuration/README.md +++ b/sync-for-expenses/docs/sdks/configuration/README.md @@ -3,39 +3,35 @@ ## Overview -Manage mapping options and sync configuration. +View and manage mapping configuration and defaults for expense transactions. ### Available Operations * [get](#get) - Get company configuration -* [get_mapping_options](#get_mapping_options) - Mapping options * [set](#set) - Set company configuration ## get -Gets a companies expense sync configuration +Gets a company's expense sync configuration ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.configuration.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.GetCompanyConfigurationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.configuration.get(req) - -if res.company_configuration is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -46,88 +42,46 @@ if res.company_configuration is not None: | `request` | [operations.GetCompanyConfigurationRequest](../../models/operations/getcompanyconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetCompanyConfigurationResponse](../../models/operations/getcompanyconfigurationresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | - -## get_mapping_options - -Gets the expense mapping options for a companies accounting software - -### Example Usage - -```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared - -s = codatsyncexpenses.CodatSyncExpenses( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -req = operations.GetMappingOptionsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) +**[shared.CompanyConfiguration](../../models/shared/companyconfiguration.md)** -res = s.configuration.get_mapping_options(req) - -if res.mapping_options is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `request` | [operations.GetMappingOptionsRequest](../../models/operations/getmappingoptionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - - -### Response - -**[operations.GetMappingOptionsResponse](../../models/operations/getmappingoptionsresponse.md)** ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## set -Sets a companies expense sync configuration +Sets a company's expense sync configuration ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.SetCompanyConfigurationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.configuration.set(req) - -if res.company_configuration is not None: - # handle response - pass +) as s: + res = s.configuration.set(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_configuration": { + "bank_account": { + "id": "32", + }, + "customer": {}, + "supplier": {}, + }, + }) + + if res is not None: + # handle response + pass ``` @@ -138,13 +92,13 @@ if res.company_configuration is not None: | `request` | [operations.SetCompanyConfigurationRequest](../../models/operations/setcompanyconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.SetCompanyConfigurationResponse](../../models/operations/setcompanyconfigurationresponse.md)** +**[shared.CompanyConfiguration](../../models/shared/companyconfiguration.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/connections/README.md b/sync-for-expenses/docs/sdks/connections/README.md index b4b3beea6..a248b16bf 100644 --- a/sync-for-expenses/docs/sdks/connections/README.md +++ b/sync-for-expenses/docs/sdks/connections/README.md @@ -3,7 +3,7 @@ ## Overview -Create and manage partner expense connection. +Create new and manage existing data connections for a company. ### Available Operations @@ -18,29 +18,29 @@ Create and manage partner expense connection. Creates a connection for the company by providing a valid `platformKey`. -Use the [List Integrations](https://docs.codat.io/sync-for-expenses-api#/operations/list-integrations) endpoint to access valid platform keys. +Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.connections.create(req) - -if res.connection is not None: - # handle response - pass +) as s: + res = s.connections.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": { + "platform_key": "gbol", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -51,16 +51,16 @@ if res.connection is not None: | `request` | [operations.CreateConnectionRequest](../../models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateConnectionResponse](../../models/operations/createconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create_partner_expense_connection @@ -69,24 +69,21 @@ Creates a partner expense data connection ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreatePartnerExpenseConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.connections.create_partner_expense_connection(req) +) as s: + res = s.connections.create_partner_expense_connection(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res.connection is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -97,16 +94,16 @@ if res.connection is not None: | `request` | [operations.CreatePartnerExpenseConnectionRequest](../../models/operations/createpartnerexpenseconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreatePartnerExpenseConnectionResponse](../../models/operations/createpartnerexpenseconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -116,25 +113,20 @@ This operation is not reversible. The end user would need to reauthorize a new d ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.DeleteConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.delete(req) +) as s: + s.connections.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -145,16 +137,12 @@ if res is not None: | `request` | [operations.DeleteConnectionRequest](../../models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[operations.DeleteConnectionResponse](../../models/operations/deleteconnectionresponse.md)** ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -163,25 +151,22 @@ if res is not None: ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.connections.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -req = operations.GetConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.get(req) - -if res.connection is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -192,16 +177,16 @@ if res.connection is not None: | `request` | [operations.GetConnectionRequest](../../models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetConnectionResponse](../../models/operations/getconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -210,27 +195,25 @@ if res.connection is not None: ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListConnectionsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.connections.list(req) - -if res.connections is not None: - # handle response - pass +) as s: + res = s.connections.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -241,16 +224,16 @@ if res.connections is not None: | `request` | [operations.ListConnectionsRequest](../../models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListConnectionsResponse](../../models/operations/listconnectionsresponse.md)** +**[shared.Connections](../../models/shared/connections.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## unlink @@ -259,25 +242,25 @@ if res.connections is not None: ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UnlinkConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.unlink(req) - -if res.connection is not None: - # handle response - pass +) as s: + res = s.connections.unlink(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "request_body": { + "status": shared.DataConnectionStatus.UNLINKED, + }, + }) + + if res is not None: + # handle response + pass ``` @@ -288,13 +271,13 @@ if res.connection is not None: | `request` | [operations.UnlinkConnectionRequest](../../models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UnlinkConnectionResponse](../../models/operations/unlinkconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/customers/README.md b/sync-for-expenses/docs/sdks/customers/README.md index 1458763e7..0a236d01b 100644 --- a/sync-for-expenses/docs/sdks/customers/README.md +++ b/sync-for-expenses/docs/sdks/customers/README.md @@ -3,7 +3,7 @@ ## Overview -Customers +Get, create, and update customers. ### Available Operations @@ -22,31 +22,43 @@ The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sy Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support creating an account. - - ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateCustomerRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.customers.create(req) - -if res.create_customer_response is not None: - # handle response - pass +) as s: + res = s.customers.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "customer": { + "status": shared.CustomerStatus.UNKNOWN, + "contacts": [ + { + "status": shared.CustomerStatus.ARCHIVED, + "modified_date": "2022-10-23T00:00:00Z", + "phone": [ + { + "type": shared.PhoneNumberType.PRIMARY, + "number": "+44 25691 154789", + }, + ], + }, + ], + "default_currency": "EUR", + "modified_date": "2022-10-23T00:00:00Z", + "source_modified_date": "2022-10-23T00:00:00Z", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -57,16 +69,16 @@ if res.create_customer_response is not None: | `request` | [operations.CreateCustomerRequest](../../models/operations/createcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateCustomerResponse](../../models/operations/createcustomerresponse.md)** +**[shared.CreateCustomerResponse](../../models/shared/createcustomerresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -74,33 +86,28 @@ The *Get customer* endpoint returns a single customer for a given customerId. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a specific customer. - Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetCustomerRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - customer_id='', -) +) as s: + res = s.customers.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "customer_id": "7110701885", + }) -res = s.customers.get(req) - -if res.customer is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -111,16 +118,16 @@ if res.customer is not None: | `request` | [operations.GetCustomerRequest](../../models/operations/getcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetCustomerResponse](../../models/operations/getcustomerresponse.md)** +**[shared.Customer](../../models/shared/customer.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -134,27 +141,25 @@ Before using this endpoint, you must have [retrieved data for the company](https ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListCustomersRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.customers.list(req) - -if res.customers is not None: - # handle response - pass +) as s: + res = s.customers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -165,16 +170,16 @@ if res.customers is not None: | `request` | [operations.ListCustomersRequest](../../models/operations/listcustomersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListCustomersResponse](../../models/operations/listcustomersresponse.md)** +**[shared.Customers](../../models/shared/customers.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -186,32 +191,64 @@ The *Update customer* endpoint updates an existing [customer](https://docs.codat Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support creating an account. - - ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateCustomerRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - customer_id='', -) - -res = s.customers.update(req) - -if res.update_customer_response is not None: - # handle response - pass +) as s: + res = s.customers.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "customer_id": "7110701885", + "customer": { + "status": shared.CustomerStatus.ARCHIVED, + "contacts": [ + { + "status": shared.CustomerStatus.ACTIVE, + "modified_date": "2022-10-23T00:00:00Z", + "phone": [ + { + "type": shared.PhoneNumberType.FAX, + "number": "01224 658 999", + }, + ], + }, + { + "status": shared.CustomerStatus.ARCHIVED, + "modified_date": "2022-10-23T00:00:00Z", + "phone": [ + { + "type": shared.PhoneNumberType.UNKNOWN, + "number": "(877) 492-8687", + }, + ], + }, + { + "status": shared.CustomerStatus.ARCHIVED, + "modified_date": "2022-10-23T00:00:00Z", + "phone": [ + { + "type": shared.PhoneNumberType.PRIMARY, + "number": "+44 25691 154789", + }, + ], + }, + ], + "default_currency": "EUR", + "modified_date": "2022-10-23T00:00:00Z", + "source_modified_date": "2022-10-23T00:00:00Z", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -222,13 +259,13 @@ if res.update_customer_response is not None: | `request` | [operations.UpdateCustomerRequest](../../models/operations/updatecustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UpdateCustomerResponse](../../models/operations/updatecustomerresponse.md)** +**[shared.UpdateCustomerResponse](../../models/shared/updatecustomerresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/expenses/README.md b/sync-for-expenses/docs/sdks/expenses/README.md index f284301a1..54cd6d38c 100644 --- a/sync-for-expenses/docs/sdks/expenses/README.md +++ b/sync-for-expenses/docs/sdks/expenses/README.md @@ -3,7 +3,7 @@ ## Overview -Create expense transactions. +Create and update transactions that represent your customers' spend. ### Available Operations @@ -12,43 +12,80 @@ Create expense transactions. ## create -The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting platform for a given company's connection. +The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. +### Supported Integrations -**Integration-specific behaviour** - -Some accounting platforms support the option of pushing transactions to a draft state. This can be done by setting the postAsDraft property on the transaction to true. For platforms without this feature, the postAsDraft property should be ignored or set to false. - -| Integration | Draft State | Details | -|-------------|-------------|--------------------------------------------------------------------------------------------------------------| -| Dynamics 365 Business Central | Yes | Setting postAsDraft to true will push the transactions to a drafted state rather than posting directly to the ledger. For transactions in a draft state, they can then be approved and posted within the accounting platform. | -| Quickbooks Online | No | - | -| Xero | No | - | -| NetSuite | No | - | +| Integration | Supported | +|-------------------------------|-----------| +| Dynamics 365 Business Central | Yes | +| FreeAgent | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | +| Xero | Yes | ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateExpenseTransactionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.expenses.create(req) - -if res.create_expense_response is not None: - # handle response - pass +) as s: + res = s.expenses.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": [ + { + "currency": "GBP", + "id": "4d7c6929-7770-412b-91bb-44d3bc71d111", + "issue_date": "2024-05-21T00:00:00+00:00", + "type": shared.ExpenseTransactionType.PAYMENT, + "bank_account_ref": { + "id": "97", + }, + "contact_ref": { + "id": "430", + "type": shared.Type.SUPPLIER, + }, + "currency_rate": Decimal("1"), + "lines": [ + { + "net_amount": Decimal("100"), + "account_ref": { + "id": "35", + }, + "invoice_to": { + "id": "504", + "type": shared.InvoiceToType.CUSTOMER, + }, + "tax_amount": Decimal("20"), + "tax_rate_ref": { + "id": "23_Bills", + }, + "tracking_refs": [ + { + "data_type": shared.TrackingRefDataType.TRACKING_CATEGORIES, + "id": "DEPARTMENT_5", + }, + ], + }, + ], + "merchant_name": "Amazon UK", + "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + ], + }) + + if res is not None: + # handle response + pass ``` @@ -59,50 +96,89 @@ if res.create_expense_response is not None: | `request` | [operations.CreateExpenseTransactionRequest](../../models/operations/createexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateExpenseTransactionResponse](../../models/operations/createexpensetransactionresponse.md)** +**[shared.CreateExpenseResponse](../../models/shared/createexpenseresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update -The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting platform for a given company's connection. +The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. -[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. +[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. - -**Integration-specific behaviour** - -At the moment you can update expenses only for Xero ([Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction type only). +### Supported Integrations +The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | +| Xero | Yes | ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateExpenseTransactionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - transaction_id='336694d8-2dca-4cb5-a28d-3ccb83e55eee', -) - -res = s.expenses.update(req) - -if res.update_expense_response is not None: - # handle response - pass +) as s: + res = s.expenses.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "transaction_id": "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + "update_expense_request": { + "currency": "GBP", + "issue_date": "2024-05-21T00:00:00+00:00", + "type": shared.UpdateExpenseRequestType.PAYMENT, + "bank_account_ref": { + "id": "97", + }, + "contact_ref": { + "id": "430", + "type": shared.Type.SUPPLIER, + }, + "currency_rate": Decimal("1"), + "lines": [ + { + "net_amount": Decimal("100"), + "account_ref": { + "id": "35", + }, + "invoice_to": { + "id": "504", + "type": shared.InvoiceToType.CUSTOMER, + }, + "tax_amount": Decimal("20"), + "tax_rate_ref": { + "id": "23_Bills", + }, + "tracking_refs": [ + { + "data_type": shared.TrackingRefDataType.TRACKING_CATEGORIES, + "id": "DEPARTMENT_5", + }, + ], + }, + ], + "merchant_name": "Amazon UK", + "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -113,13 +189,13 @@ if res.update_expense_response is not None: | `request` | [operations.UpdateExpenseTransactionRequest](../../models/operations/updateexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UpdateExpenseTransactionResponse](../../models/operations/updateexpensetransactionresponse.md)** +**[shared.UpdateExpenseResponse](../../models/shared/updateexpenseresponse.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,422,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 422, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/managedata/README.md b/sync-for-expenses/docs/sdks/managedata/README.md index 6cdcc5a38..0826d5e88 100644 --- a/sync-for-expenses/docs/sdks/managedata/README.md +++ b/sync-for-expenses/docs/sdks/managedata/README.md @@ -3,7 +3,7 @@ ## Overview -Asynchronously retrieve data from an integration to refresh data in Codat. +Control and monitor the retrieval of data from an integration. ### Available Operations @@ -20,24 +20,21 @@ Get the state of each data type for a company ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.manage_data.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.GetDataStatusRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.manage_data.get(req) - -if res.data_statuses is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -48,16 +45,16 @@ if res.data_statuses is not None: | `request` | [operations.GetDataStatusRequest](../../models/operations/getdatastatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetDataStatusResponse](../../models/operations/getdatastatusresponse.md)** +**[operations.GetDataStatusDataStatuses](../../models/operations/getdatastatusdatastatuses.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_pull_operation @@ -66,25 +63,22 @@ Retrieve information about a single dataset or pull operation. ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetPullOperationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - dataset_id='7911a54a-c808-4f4b-b87e-b195f52b4da5', -) - -res = s.manage_data.get_pull_operation(req) +) as s: + res = s.manage_data.get_pull_operation(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "dataset_id": "71a4c0fb-8e15-45bd-958d-330b4e6e9f07", + }) -if res.pull_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -95,16 +89,16 @@ if res.pull_operation is not None: | `request` | [operations.GetPullOperationRequest](../../models/operations/getpulloperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetPullOperationResponse](../../models/operations/getpulloperationresponse.md)** +**[shared.PullOperation](../../models/shared/pulloperation.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list_pull_operations @@ -113,27 +107,25 @@ Gets the pull operation history (datasets) for a given company. ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListPullOperationsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.manage_data.list_pull_operations(req) - -if res.pull_operations is not None: - # handle response - pass +) as s: + res = s.manage_data.list_pull_operations(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -144,16 +136,16 @@ if res.pull_operations is not None: | `request` | [operations.ListPullOperationsRequest](../../models/operations/listpulloperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListPullOperationsResponse](../../models/operations/listpulloperationsresponse.md)** +**[shared.PullOperations](../../models/shared/pulloperations.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## refresh_all_data_types @@ -166,24 +158,19 @@ This is an asynchronous operation, and will bring updated data into Codat from t ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.RefreshAllDataTypesRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) +) as s: + s.manage_data.refresh_all_data_types(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -res = s.manage_data.refresh_all_data_types(req) - -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -194,16 +181,12 @@ if res is not None: | `request` | [operations.RefreshAllDataTypesRequest](../../models/operations/refreshalldatatypesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[operations.RefreshAllDataTypesResponse](../../models/operations/refreshalldatatypesresponse.md)** ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## refresh_data_type @@ -214,25 +197,22 @@ This is an asynchronous operation, and will bring updated data into Codat from t ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.RefreshDataTypeRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - data_type=shared.SchemaDataType.INVOICES, -) - -res = s.manage_data.refresh_data_type(req) +) as s: + res = s.manage_data.refresh_data_type(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "data_type": shared.SchemaDataType.INVOICES, + }) -if res.pull_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -243,13 +223,13 @@ if res.pull_operation is not None: | `request` | [operations.RefreshDataTypeRequest](../../models/operations/refreshdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.RefreshDataTypeResponse](../../models/operations/refreshdatatyperesponse.md)** +**[shared.PullOperation](../../models/shared/pulloperation.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/mappingoptions/README.md b/sync-for-expenses/docs/sdks/mappingoptions/README.md new file mode 100644 index 000000000..fe1c72de3 --- /dev/null +++ b/sync-for-expenses/docs/sdks/mappingoptions/README.md @@ -0,0 +1,53 @@ +# MappingOptions +(*mapping_options*) + +## Overview + +Get accounts, trackingCategories and taxRates that can be used in your create and update requests. + +### Available Operations + +* [get_mapping_options](#get_mapping_options) - Mapping options + +## get_mapping_options + +Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software + +### Example Usage + +```python +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared + +with CodatSyncExpenses( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.mapping_options.get_mapping_options(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.GetMappingOptionsRequest](../../models/operations/getmappingoptionsrequest.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.MappingOptions](../../models/shared/mappingoptions.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 diff --git a/sync-for-expenses/docs/sdks/pushoperations/README.md b/sync-for-expenses/docs/sdks/pushoperations/README.md index 28b416683..c55400175 100644 --- a/sync-for-expenses/docs/sdks/pushoperations/README.md +++ b/sync-for-expenses/docs/sdks/pushoperations/README.md @@ -3,7 +3,7 @@ ## Overview -Access create, update and delete operations made to an SMB's data connection. +View historic push operations. ### Available Operations @@ -17,25 +17,22 @@ Retrieve push operation. ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.push_operations.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "push_operation_key": "b888f774-3e7c-4135-a18c-6b985523c4bc", + }) -req = operations.GetPushOperationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - push_operation_key='b18d8d81-fd7b-4764-a31e-475cb1f36591', -) - -res = s.push_operations.get(req) - -if res.push_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -46,16 +43,16 @@ if res.push_operation is not None: | `request` | [operations.GetPushOperationRequest](../../models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetPushOperationResponse](../../models/operations/getpushoperationresponse.md)** +**[shared.PushOperation](../../models/shared/pushoperation.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -64,27 +61,25 @@ List push operation records. ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListPushOperationsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.push_operations.list(req) - -if res.push_operations is not None: - # handle response - pass +) as s: + res = s.push_operations.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -95,13 +90,13 @@ if res.push_operations is not None: | `request` | [operations.ListPushOperationsRequest](../../models/operations/listpushoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListPushOperationsResponse](../../models/operations/listpushoperationsresponse.md)** +**[shared.PushOperations](../../models/shared/pushoperations.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/reimbursements/README.md b/sync-for-expenses/docs/sdks/reimbursements/README.md index 6d2a0a554..3edc3a300 100644 --- a/sync-for-expenses/docs/sdks/reimbursements/README.md +++ b/sync-for-expenses/docs/sdks/reimbursements/README.md @@ -3,7 +3,7 @@ ## Overview -Create reimbursable expense transactions. +Create and update transactions that represent your customers' repayable spend. ### Available Operations @@ -12,31 +12,74 @@ Create reimbursable expense transactions. ## create -Use the *Create reimbursable expense* endpoint to create a [reimbursement request](https://docs.codat.io/sync-for-expenses-api#/schemas/Reimburseable-Expense-Transactions) in the accounting platform for a given company's connection. +Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. -Employee reimbursement requests are reflected in the accounting system in the form of Bills against an employee, who is a supplier. +[Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). + +### Supported Integrations +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateReimbursableExpenseTransactionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.reimbursements.create(req) - -if res.create_reimbursable_expense_response is not None: - # handle response - pass +) as s: + res = s.reimbursements.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": [ + { + "contact_ref": { + "id": "752", + }, + "currency": "GBP", + "due_date": "2024-05-21", + "id": "4d7c6929-7770-412b-91bb-44d3bc71d111", + "issue_date": "2024-05-21", + "currency_rate": Decimal("1"), + "lines": [ + { + "net_amount": Decimal("100"), + "account_ref": { + "id": "35", + }, + "description": "Hotel", + "invoice_to": { + "id": "504", + "type": shared.InvoiceToType.CUSTOMER, + }, + "tax_amount": Decimal("20"), + "tax_rate_ref": { + "id": "23_Bills", + }, + "tracking_refs": [ + { + "data_type": shared.TrackingRefDataType.TRACKING_CATEGORIES, + "id": "DEPARTMENT_5", + }, + ], + }, + ], + "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + "reference": "expenses w/c 01/07", + }, + ], + }) + + if res is not None: + # handle response + pass ``` @@ -47,45 +90,84 @@ if res.create_reimbursable_expense_response is not None: | `request` | [operations.CreateReimbursableExpenseTransactionRequest](../../models/operations/createreimbursableexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateReimbursableExpenseTransactionResponse](../../models/operations/createreimbursableexpensetransactionresponse.md)** +**[shared.CreateReimbursableExpenseResponse](../../models/shared/createreimbursableexpenseresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update -The *Update reimbursable expense* endpoint updates an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/operations/create-reimbursable-expense-transaction) in the accounting platform for a given company's connection. +The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. -Employee reimbursement requests are reflected in the accounting system in the form of Bills against an employee, who is a supplier. +Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). + +### Supported Integrations +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateReimbursableExpenseTransactionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - transaction_id='336694d8-2dca-4cb5-a28d-3ccb83e55eee', -) - -res = s.reimbursements.update(req) - -if res.create_reimbursable_expense_response is not None: - # handle response - pass +) as s: + res = s.reimbursements.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "transaction_id": "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + "update_reimbursable_expense_transaction_request": { + "contact_ref": { + "id": "752", + }, + "currency": "GBP", + "due_date": "2024-05-21", + "issue_date": "2024-05-21", + "currency_rate": Decimal("1"), + "lines": [ + { + "net_amount": Decimal("100"), + "account_ref": { + "id": "35", + }, + "description": "Hotel", + "invoice_to": { + "id": "504", + "type": shared.InvoiceToType.CUSTOMER, + }, + "tax_amount": Decimal("20"), + "tax_rate_ref": { + "id": "23_Bills", + }, + "tracking_refs": [ + { + "data_type": shared.TrackingRefDataType.TRACKING_CATEGORIES, + "id": "DEPARTMENT_5", + }, + ], + }, + ], + "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + "reference": "expenses w/c 01/07", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -96,13 +178,13 @@ if res.create_reimbursable_expense_response is not None: | `request` | [operations.UpdateReimbursableExpenseTransactionRequest](../../models/operations/updatereimbursableexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UpdateReimbursableExpenseTransactionResponse](../../models/operations/updatereimbursableexpensetransactionresponse.md)** +**[shared.CreateReimbursableExpenseResponse](../../models/shared/createreimbursableexpenseresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/suppliers/README.md b/sync-for-expenses/docs/sdks/suppliers/README.md index b3cc3a86b..9db0b6ef7 100644 --- a/sync-for-expenses/docs/sdks/suppliers/README.md +++ b/sync-for-expenses/docs/sdks/suppliers/README.md @@ -3,7 +3,7 @@ ## Overview -Suppliers +Get, create, and update suppliers. ### Available Operations @@ -21,70 +21,33 @@ The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sy **Integration-specific behaviour** Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateSupplierRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - supplier=shared.Supplier( - status=shared.SupplierStatus.UNKNOWN, - addresses=[ - shared.Items( - type=shared.AccountingAddressType.BILLING, - city='Bakersfield', - country='USA', - line1='Unit 51', - line2='Bakersfield Industrial Estate', - region='California', - ), - ], - contact_name='Kelly\'s Industrial Supplies', - default_currency='string', - email_address='sales@kellysupplies.com', - id='C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F', - metadata=shared.Metadata( - is_deleted=True, - ), - modified_date='2022-10-23T00:00:00Z', - phone='07999 999999', - registration_number='string', - source_modified_date='2022-10-23T00:00:00Z', - supplemental_data=shared.SupplementalData( - content={ - 'property1': { - 'property1': None, - 'property2': None, - }, - 'property2': { - 'property1': None, - 'property2': None, - }, - }, - ), - supplier_name='Kelly\'s Industrial Supplies', - tax_number='string', - ), -) - -res = s.suppliers.create(req) - -if res.create_supplier_response is not None: - # handle response - pass +) as s: + res = s.suppliers.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "supplier": { + "status": shared.SupplierStatus.ACTIVE, + "contact_name": "Joe Bloggs", + "id": "73593", + "supplier_name": "test 20230420 1004", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -95,16 +58,16 @@ if res.create_supplier_response is not None: | `request` | [operations.CreateSupplierRequest](../../models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateSupplierResponse](../../models/operations/createsupplierresponse.md)** +**[shared.CreateSupplierResponse](../../models/shared/createsupplierresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -112,33 +75,28 @@ The *Get supplier* endpoint returns a single supplier for a given supplierId. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. - Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetSupplierRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - supplier_id='7110701885', -) +) as s: + res = s.suppliers.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "supplier_id": "7110701885", + }) -res = s.suppliers.get(req) - -if res.supplier is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -149,16 +107,16 @@ if res.supplier is not None: | `request` | [operations.GetSupplierRequest](../../models/operations/getsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetSupplierResponse](../../models/operations/getsupplierresponse.md)** +**[shared.Supplier](../../models/shared/supplier.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -172,27 +130,25 @@ Before using this endpoint, you must have [retrieved data for the company](https ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListSuppliersRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.suppliers.list(req) - -if res.suppliers is not None: - # handle response - pass +) as s: + res = s.suppliers.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -203,16 +159,16 @@ if res.suppliers is not None: | `request` | [operations.ListSuppliersRequest](../../models/operations/listsuppliersrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListSuppliersResponse](../../models/operations/listsuppliersresponse.md)** +**[shared.Suppliers](../../models/shared/suppliers.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -222,72 +178,66 @@ The *Update supplier* endpoint updates an existing [supplier](https://docs.codat **Integration-specific behaviour** -Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. - +Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateSupplierRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - supplier_id='EILBDVJVNUAGVKRQ', - supplier=shared.Supplier( - status=shared.SupplierStatus.UNKNOWN, - addresses=[ - shared.Items( - type=shared.AccountingAddressType.BILLING, - city='Bakersfield', - country='USA', - line1='Unit 51', - line2='Bakersfield Industrial Estate', - region='California', - ), - ], - contact_name='Kelly\'s Industrial Supplies', - default_currency='string', - email_address='sales@kellysupplies.com', - id='C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F', - metadata=shared.Metadata( - is_deleted=True, - ), - modified_date='2022-10-23T00:00:00Z', - phone='07999 999999', - registration_number='string', - source_modified_date='2022-10-23T00:00:00Z', - supplemental_data=shared.SupplementalData( - content={ - 'property1': { - 'property1': None, - 'property2': None, +) as s: + res = s.suppliers.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "supplier_id": "EILBDVJVNUAGVKRQ", + "supplier": { + "status": shared.SupplierStatus.UNKNOWN, + "addresses": [ + { + "type": shared.AccountingAddressType.BILLING, + "city": "Bakersfield", + "country": "USA", + "line1": "Unit 51", + "line2": "Bakersfield Industrial Estate", + "region": "California", }, - 'property2': { - 'property1': None, - 'property2': None, + ], + "contact_name": "Kelly's Industrial Supplies", + "default_currency": "string", + "email_address": "sales@kellysupplies.com", + "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", + "metadata": { + "is_deleted": True, + }, + "modified_date": "2022-10-23T00:00:00Z", + "phone": "07999 999999", + "registration_number": "string", + "source_modified_date": "2022-10-23T00:00:00Z", + "supplemental_data": { + "content": { + "property1": { + "property1": "", + "property2": "", + }, + "property2": { + "property1": "", + "property2": "", + }, }, }, - ), - supplier_name='Kelly\'s Industrial Supplies', - tax_number='string', - ), -) + "supplier_name": "Kelly's Industrial Supplies", + "tax_number": "string", + }, + }) -res = s.suppliers.update(req) - -if res.update_supplier_response is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -298,13 +248,13 @@ if res.update_supplier_response is not None: | `request` | [operations.UpdateSupplierRequest](../../models/operations/updatesupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.UpdateSupplierResponse](../../models/operations/updatesupplierresponse.md)** +**[shared.UpdateSupplierResponse](../../models/shared/updatesupplierresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/sync/README.md b/sync-for-expenses/docs/sdks/sync/README.md index 39c1a54c6..e19008016 100644 --- a/sync-for-expenses/docs/sdks/sync/README.md +++ b/sync-for-expenses/docs/sdks/sync/README.md @@ -3,14 +3,13 @@ ## Overview -Trigger and monitor expense syncs to accounting software. +Monitor the status of data syncs. ### Available Operations * [get](#get) - Get sync status * [get_last_successful_sync](#get_last_successful_sync) - Last successful sync * [get_latest_sync](#get_latest_sync) - Latest sync status -* [initiate_sync](#initiate_sync) - Initiate sync * [list](#list) - List sync statuses ## get @@ -20,25 +19,22 @@ Get the sync status for a specified sync ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.sync.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "sync_id": "6fb40d5e-b13e-11ed-afa1-0242ac120002", + }) -req = operations.GetSyncByIDRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - sync_id='6fb40d5e-b13e-11ed-afa1-0242ac120002', -) - -res = s.sync.get(req) - -if res.company_sync_status is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -49,16 +45,16 @@ if res.company_sync_status is not None: | `request` | [operations.GetSyncByIDRequest](../../models/operations/getsyncbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetSyncByIDResponse](../../models/operations/getsyncbyidresponse.md)** +**[shared.CompanySyncStatus](../../models/shared/companysyncstatus.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_last_successful_sync @@ -67,24 +63,21 @@ Gets the status of the last successful sync ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetLastSuccessfulSyncRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) +) as s: + res = s.sync.get_last_successful_sync(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -res = s.sync.get_last_successful_sync(req) - -if res.company_sync_status is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -95,16 +88,16 @@ if res.company_sync_status is not None: | `request` | [operations.GetLastSuccessfulSyncRequest](../../models/operations/getlastsuccessfulsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetLastSuccessfulSyncResponse](../../models/operations/getlastsuccessfulsyncresponse.md)** +**[shared.CompanySyncStatus](../../models/shared/companysyncstatus.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_latest_sync @@ -113,24 +106,21 @@ Gets the latest sync status ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetLatestSyncRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.sync.get_latest_sync(req) +) as s: + res = s.sync.get_latest_sync(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res.company_sync_status is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -141,62 +131,16 @@ if res.company_sync_status is not None: | `request` | [operations.GetLatestSyncRequest](../../models/operations/getlatestsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetLatestSyncResponse](../../models/operations/getlatestsyncresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | - -## initiate_sync - -Initiate sync of pending transactions. - -### Example Usage - -```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared - -s = codatsyncexpenses.CodatSyncExpenses( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -req = operations.InitiateSyncRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) +**[shared.CompanySyncStatus](../../models/shared/companysyncstatus.md)** -res = s.sync.initiate_sync(req) - -if res.sync_initiated is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `request` | [operations.InitiateSyncRequest](../../models/operations/initiatesyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - - -### Response - -**[operations.InitiateSyncResponse](../../models/operations/initiatesyncresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,422,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -205,24 +149,21 @@ Gets a list of sync statuses ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.sync.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.ListSyncsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.sync.list(req) - -if res.classes is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -233,13 +174,13 @@ if res.classes is not None: | `request` | [operations.ListSyncsRequest](../../models/operations/listsyncsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListSyncsResponse](../../models/operations/listsyncsresponse.md)** +**[List[shared.CompanySyncStatus]](../../models/.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/transactionstatus/README.md b/sync-for-expenses/docs/sdks/transactionstatus/README.md index 910382eef..fe2f13da4 100644 --- a/sync-for-expenses/docs/sdks/transactionstatus/README.md +++ b/sync-for-expenses/docs/sdks/transactionstatus/README.md @@ -3,7 +3,7 @@ ## Overview -Retrieve the status of transactions within a sync. +Monitor the status of individual transactions in data syncs. ### Available Operations @@ -17,26 +17,23 @@ Gets the status of a transaction for a sync ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.transaction_status.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "sync_id": "6fb40d5e-b13e-11ed-afa1-0242ac120002", + "transaction_id": "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }) -req = operations.GetSyncTransactionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - sync_id='6fb40d5e-b13e-11ed-afa1-0242ac120002', - transaction_id='336694d8-2dca-4cb5-a28d-3ccb83e55eee', -) - -res = s.transaction_status.get(req) - -if res.transaction_response is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -47,16 +44,16 @@ if res.transaction_response is not None: | `request` | [operations.GetSyncTransactionRequest](../../models/operations/getsynctransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetSyncTransactionResponse](../../models/operations/getsynctransactionresponse.md)** +**[List[shared.SchemaTransaction]](../../models/.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -65,27 +62,24 @@ Gets the transactions and status for a sync ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListSyncTransactionsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - sync_id='6fb40d5e-b13e-11ed-afa1-0242ac120002', - page=1, - page_size=100, -) - -res = s.transaction_status.list(req) - -if res.transactions is not None: - # handle response - pass +) as s: + res = s.transaction_status.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "sync_id": "6fb40d5e-b13e-11ed-afa1-0242ac120002", + "page": 1, + "page_size": 100, + }) + + if res is not None: + # handle response + pass ``` @@ -96,13 +90,13 @@ if res.transactions is not None: | `request` | [operations.ListSyncTransactionsRequest](../../models/operations/listsynctransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListSyncTransactionsResponse](../../models/operations/listsynctransactionsresponse.md)** +**[shared.Transactions](../../models/shared/transactions.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/transfers/README.md b/sync-for-expenses/docs/sdks/transfers/README.md index 14b870f07..90ec2dc06 100644 --- a/sync-for-expenses/docs/sdks/transfers/README.md +++ b/sync-for-expenses/docs/sdks/transfers/README.md @@ -3,7 +3,7 @@ ## Overview -Create transfer transactions. +Create and update transactions that represent the movement of your customers' money. ### Available Operations @@ -11,35 +11,56 @@ Create transfer transactions. ## create -Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransaction) in the accounting platform for a given company's connection. +Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. The `from.amount` and `to.amount` fields are in the native currency of the account. - + +### Supported Integrations +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | ### Example Usage ```python -import codatsyncexpenses -from codatsyncexpenses.models import operations, shared +from codat_sync_for_expenses import CodatSyncExpenses +from codat_sync_for_expenses.models import shared +from decimal import Decimal -s = codatsyncexpenses.CodatSyncExpenses( +with CodatSyncExpenses( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateTransferTransactionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - transaction_id='336694d8-2dca-4cb5-a28d-3ccb83e55eee', -) - -res = s.transfers.create(req) - -if res.create_transfer_response is not None: - # handle response - pass +) as s: + res = s.transfers.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "transaction_id": "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + "transfer_transaction_request": { + "date_": "2021-05-21T00:00:00+00:00", + "from_": { + "account_ref": { + "id": "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", + }, + "amount": Decimal("100"), + }, + "to": { + "account_ref": { + "id": "777dfb37-5506-3dc0-6g86-8d34z4cc78ea", + }, + "amount": Decimal("100"), + }, + "description": "Sample transfer description", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -50,13 +71,13 @@ if res.create_transfer_response is not None: | `request` | [operations.CreateTransferTransactionRequest](../../models/operations/createtransfertransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.CreateTransferTransactionResponse](../../models/operations/createtransfertransactionresponse.md)** +**[shared.TransferTransactionResponse](../../models/shared/transfertransactionresponse.md)** + ### Errors -| Error Object | 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, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/poetry.lock b/sync-for-expenses/poetry.lock new file mode 100644 index 000000000..c685b1d9f --- /dev/null +++ b/sync-for-expenses/poetry.lock @@ -0,0 +1,557 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +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" +files = [ + {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, + {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +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)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "astroid" +version = "3.2.4" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, + {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + +[[package]] +name = "certifi" +version = "2024.8.30" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, +] + +[[package]] +name = "colorama" +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" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "dill" +version = "0.3.9" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, + {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, +] + +[package.extras] +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" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "1.0.7" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, + {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.27.2" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, + {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[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" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + +[[package]] +name = "mypy" +version = "1.13.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +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"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +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 = "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" +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] + +[[package]] +name = "pydantic" +version = "2.9.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, + {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.23.4" +typing-extensions = [ + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, +] + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.23.4" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, + {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, + {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, + {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, + {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, + {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, + {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, + {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, + {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, + {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, + {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, + {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, + {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, + {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pylint" +version = "3.2.3" +description = "python code static checker" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, + {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, +] + +[package.dependencies] +astroid = ">=3.2.2,<=3.3.0-dev0" +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\""}, +] +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.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[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]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.1.0" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, + {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, +] + +[[package]] +name = "tomlkit" +version = "0.13.2" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.8" +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" +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." +optional = false +python-versions = "*" +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"}, +] + +[package.dependencies] +mypy-extensions = ">=0.3.0" +typing-extensions = ">=3.7.4" + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "634a1e2581f680cde0149401ee60f1a571cfb482ce541acd8d0fa9a558cadf9d" diff --git a/sync-for-expenses/poetry.toml b/sync-for-expenses/poetry.toml new file mode 100644 index 000000000..ab1033bd3 --- /dev/null +++ b/sync-for-expenses/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/sync-for-expenses/pylintrc b/sync-for-expenses/pylintrc index 752384686..c97dd0049 100644 --- a/sync-for-expenses/pylintrc +++ b/sync-for-expenses/pylintrc @@ -59,10 +59,11 @@ ignore-paths= # Emacs file locks ignore-patterns=^\.# -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as @@ -93,6 +94,12 @@ py-version=3.8 # Discover python modules and packages in the file system subtree. recursive=no +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots=src + # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. suggestion-mode=yes @@ -226,6 +233,10 @@ no-docstring-rgx=^_ # These decorators are taken in consideration only for invalid-name. property-classes=abc.abstractproperty +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +typealias-rgx=.* + # Regular expression matching correct type variable names. If left empty, type # variable names will be checked with the set naming style. #typevar-rgx= @@ -248,15 +259,12 @@ check-protected-access-in-special-methods=no defining-attr-methods=__init__, __new__, setUp, + asyncSetUp, __post_init__ # List of member names, which should be excluded from the protected access # warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit # List of valid names for the first argument in a class method. valid-classmethod-first-arg=cls @@ -419,6 +427,8 @@ disable=raw-checker-failed, suppressed-message, useless-suppression, deprecated-pragma, + use-implicit-booleaness-not-comparison-to-string, + use-implicit-booleaness-not-comparison-to-zero, use-symbolic-message-instead, trailing-whitespace, line-too-long, @@ -431,7 +441,6 @@ disable=raw-checker-failed, broad-exception-raised, too-few-public-methods, too-many-branches, - chained-comparison, duplicate-code, trailing-newlines, too-many-public-methods, @@ -444,13 +453,15 @@ disable=raw-checker-failed, too-many-boolean-expressions, no-else-raise, bare-except, - broad-exception-caught + broad-exception-caught, + fixme, + relative-beyond-top-level # 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 # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member +enable= [METHOD_ARGS] @@ -496,8 +507,9 @@ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor # used to format the message information. See doc for all details. msg-template= -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. # mypackage.mymodule.MyReporterClass. #output-format= @@ -531,8 +543,8 @@ min-similarity-lines=4 # Limits count of emitted suggestions for spelling mistakes. max-spelling-suggestions=4 -# Spelling dictionary name. Available dictionaries: none. To make it work, -# install the 'python-enchant' package. +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. spelling-dict= # List of comma separated words that should be considered directives if they diff --git a/sync-for-expenses/pyproject.toml b/sync-for-expenses/pyproject.toml new file mode 100644 index 000000000..2e904d3b1 --- /dev/null +++ b/sync-for-expenses/pyproject.toml @@ -0,0 +1,55 @@ +[tool.poetry] +name = "codat-sync-for-expenses" +version = "7.0.0" +description = "Push expenses to accounting software." +authors = ["Speakeasy",] +readme = "README-PYPI.md" +repository = "https://github.com/codatio/client-sdk-python.git" +packages = [ + { include = "codat_sync_for_expenses", from = "src" } +] +include = ["py.typed", "src/codat_sync_for_expenses/py.typed"] + +[tool.setuptools.package-data] +"*" = ["py.typed", "src/codat_sync_for_expenses/py.typed"] + +[virtualenvs] +in-project = true + +[tool.poetry.dependencies] +python = "^3.8" +eval-type-backport = "^0.2.0" +httpx = "^0.27.0" +jsonpath-python = "^1.0.6" +pydantic = "~2.9.2" +python-dateutil = "^2.8.2" +typing-inspect = "^0.9.0" + +[tool.poetry.group.dev.dependencies] +mypy = "==1.13.0" +pylint = "==3.2.3" +types-python-dateutil = "^2.9.0.20240316" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +pythonpath = ["src"] + +[tool.mypy] +disable_error_code = "misc" + +[[tool.mypy.overrides]] +module = "typing_inspect" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "jsonpath" +ignore_missing_imports = true + +[tool.pyright] +venvPath = "." +venv = ".venv" + + diff --git a/sync-for-expenses/scripts/prepare-readme.py b/sync-for-expenses/scripts/prepare-readme.py new file mode 100644 index 000000000..7c07cddd7 --- /dev/null +++ b/sync-for-expenses/scripts/prepare-readme.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import shutil + +try: + with open("README.md", "r") 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 + ) + # links on PyPI should have absolute URLs + readme_contents = re.sub( + r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", + lambda m: m.group(1) + + GITHUB_URL + + "/blob/master/" + + m.group(2) + + m.group(3), + readme_contents, + ) + + with open("README-PYPI.md", "w") 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: + print("Failed to copy README.md to README-PYPI.md") + print(e) diff --git a/sync-for-expenses/scripts/publish.sh b/sync-for-expenses/scripts/publish.sh new file mode 100755 index 000000000..ab45b1f94 --- /dev/null +++ b/sync-for-expenses/scripts/publish.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} + +poetry run python scripts/prepare-readme.py + +poetry publish --build --skip-existing diff --git a/sync-for-expenses/setup.py b/sync-for-expenses/setup.py deleted file mode 100644 index 58c2c28d7..000000000 --- a/sync-for-expenses/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import setuptools -import re - -try: - with open('README.md', 'r') as fh: - long_description = fh.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 - # links on PyPI should have absolute URLs - long_description = re.sub( - r'(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))', - lambda m: m.group(1) + GITHUB_URL + '/blob/master/' + m.group(2) + m.group(3), - long_description, - ) -except FileNotFoundError: - long_description = '' - -setuptools.setup( - name='codat-sync-for-expenses', - version='6.2.0', - author='Codat', - description='Push expenses to accounting platforms.', - url='https://github.com/codatio/client-sdk-python.git', - long_description=long_description, - long_description_content_type='text/markdown', - packages=setuptools.find_packages(where='src'), - install_requires=[ - "certifi>=2023.7.22", - "charset-normalizer>=3.2.0", - "dataclasses-json>=0.6.4", - "idna>=3.4", - "jsonpath-python>=1.0.6", - "marshmallow>=3.19.0", - "mypy-extensions>=1.0.0", - "packaging>=23.1", - "python-dateutil>=2.8.2", - "requests>=2.31.0", - "six>=1.16.0", - "typing-inspect>=0.9.0", - "typing_extensions>=4.7.1", - "urllib3>=1.26.18", - ], - extras_require={ - "dev": [ - "pylint==3.1.0", - ], - }, - package_dir={'': 'src'}, - python_requires='>=3.8', - package_data={ - 'codat-sync-for-expenses': ['py.typed'] - }, -) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/__init__.py new file mode 100644 index 000000000..5c3491793 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/__init__.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import __title__, __version__ +from .sdk import * +from .sdkconfiguration import * + + +VERSION: str = __version__ diff --git a/sync-for-expenses/src/codat_sync_for_expenses/_hooks/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/__init__.py new file mode 100644 index 000000000..2ee66cdd5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/__init__.py @@ -0,0 +1,5 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkhooks import * +from .types import * +from .registration import * diff --git a/sync-for-expenses/src/codat_sync_for_expenses/_hooks/registration.py b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/registration.py new file mode 100644 index 000000000..cab477877 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/registration.py @@ -0,0 +1,13 @@ +from .types import Hooks + + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +def init_hooks(hooks: Hooks): + # pylint: disable=unused-argument + """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook + with an instance of a hook that implements that specific Hook interface + Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance""" diff --git a/sync-for-expenses/src/codatsyncexpenses/_hooks/sdkhooks.py b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/sdkhooks.py similarity index 65% rename from sync-for-expenses/src/codatsyncexpenses/_hooks/sdkhooks.py rename to sync-for-expenses/src/codat_sync_for_expenses/_hooks/sdkhooks.py index 17750b62c..7f6fec9c8 100644 --- a/sync-for-expenses/src/codatsyncexpenses/_hooks/sdkhooks.py +++ b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/sdkhooks.py @@ -1,13 +1,23 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -import requests -from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks +import httpx +from .types import ( + SDKInitHook, + BeforeRequestContext, + BeforeRequestHook, + AfterSuccessContext, + AfterSuccessHook, + AfterErrorContext, + AfterErrorHook, + Hooks, +) from .registration import init_hooks from typing import List, Optional, Tuple +from codat_sync_for_expenses.httpclient import HttpClient class SDKHooks(Hooks): - def __init__(self): + def __init__(self) -> None: self.sdk_init_hooks: List[SDKInitHook] = [] self.before_request_hooks: List[BeforeRequestHook] = [] self.after_success_hooks: List[AfterSuccessHook] = [] @@ -26,12 +36,14 @@ def register_after_success_hook(self, hook: AfterSuccessHook) -> None: def register_after_error_hook(self, hook: AfterErrorHook) -> None: self.after_error_hooks.append(hook) - def sdk_init(self, base_url: str, client: requests.Session) -> Tuple[str, requests.Session]: + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: for hook in self.sdk_init_hooks: base_url, client = hook.sdk_init(base_url, client) return base_url, client - def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> requests.PreparedRequest: + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: for hook in self.before_request_hooks: out = hook.before_request(hook_ctx, request) if isinstance(out, Exception): @@ -40,7 +52,9 @@ def before_request(self, hook_ctx: BeforeRequestContext, request: requests.Prepa return request - def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response: + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> httpx.Response: for hook in self.after_success_hooks: out = hook.after_success(hook_ctx, response) if isinstance(out, Exception): @@ -48,7 +62,12 @@ def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Respon response = out return response - def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]: + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: for hook in self.after_error_hooks: result = hook.after_error(hook_ctx, response, error) if isinstance(result, Exception): diff --git a/sync-for-expenses/src/codatsyncexpenses/_hooks/types.py b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/types.py similarity index 50% rename from sync-for-expenses/src/codatsyncexpenses/_hooks/types.py rename to sync-for-expenses/src/codat_sync_for_expenses/_hooks/types.py index b24c14146..e00879c20 100644 --- a/sync-for-expenses/src/codatsyncexpenses/_hooks/types.py +++ b/sync-for-expenses/src/codat_sync_for_expenses/_hooks/types.py @@ -1,7 +1,8 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -import requests as requests_http from abc import ABC, abstractmethod +from codat_sync_for_expenses.httpclient import HttpClient +import httpx from typing import Any, Callable, List, Optional, Tuple, Union @@ -10,7 +11,12 @@ class HookContext: oauth2_scopes: Optional[List[str]] = None security_source: Optional[Union[Any, Callable[[], Any]]] = None - def __init__(self, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]]): + def __init__( + self, + operation_id: str, + oauth2_scopes: Optional[List[str]], + security_source: Optional[Union[Any, Callable[[], Any]]], + ): self.operation_id = operation_id self.oauth2_scopes = oauth2_scopes self.security_source = security_source @@ -18,41 +24,55 @@ def __init__(self, operation_id: str, oauth2_scopes: Optional[List[str]], securi class BeforeRequestContext(HookContext): def __init__(self, hook_ctx: HookContext): - super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source) + super().__init__( + 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) - + super().__init__( + 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) + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) class SDKInitHook(ABC): @abstractmethod - def sdk_init(self, base_url: str, client: requests_http.Session) -> Tuple[str, requests_http.Session]: + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: pass class BeforeRequestHook(ABC): @abstractmethod - def before_request(self, hook_ctx: BeforeRequestContext, request: requests_http.PreparedRequest) -> Union[requests_http.PreparedRequest, Exception]: + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: pass class AfterSuccessHook(ABC): @abstractmethod - def after_success(self, hook_ctx: AfterSuccessContext, response: requests_http.Response) -> Union[requests_http.Response, Exception]: + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, Exception]: pass class AfterErrorHook(ABC): @abstractmethod - def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests_http.Response], error: Optional[Exception]) -> Union[Tuple[Optional[requests_http.Response], Optional[Exception]], Exception]: + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: pass diff --git a/sync-for-expenses/src/codat_sync_for_expenses/_version.py b/sync-for-expenses/src/codat_sync_for_expenses/_version.py new file mode 100644 index 000000000..450f714bd --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/_version.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import importlib.metadata + +__title__: str = "codat-sync-for-expenses" +__version__: str = "7.0.0" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/sync-for-expenses/src/codat_sync_for_expenses/accounts.py b/sync-for-expenses/src/codat_sync_for_expenses/accounts.py new file mode 100644 index 000000000..a34fcdcc6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/accounts.py @@ -0,0 +1,478 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Accounts(BaseSDK): + r"""Create accounts and view create account options.""" + + def create( + self, + *, + request: Union[ + operations.CreateAccountRequest, operations.CreateAccountRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateAccountResponse]: + r"""Create account + + The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. + + [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateAccountRequest) + request = cast(operations.CreateAccountRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/accounts", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.account_prototype, + False, + True, + "json", + Optional[shared.AccountPrototype], + ), + 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( + operation_id="create-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateAccountResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateAccountRequest, operations.CreateAccountRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateAccountResponse]: + r"""Create account + + The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. + + [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateAccountRequest) + request = cast(operations.CreateAccountRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/accounts", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.account_prototype, + False, + True, + "json", + Optional[shared.AccountPrototype], + ), + 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( + operation_id="create-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateAccountResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get_create_model( + self, + *, + request: Union[ + operations.GetCreateChartOfAccountsModelRequest, + operations.GetCreateChartOfAccountsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create account model + + The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. + + [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateChartOfAccountsModelRequest + ) + request = cast(operations.GetCreateChartOfAccountsModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-create-chartOfAccounts-model", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_create_model_async( + self, + *, + request: Union[ + operations.GetCreateChartOfAccountsModelRequest, + operations.GetCreateChartOfAccountsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create account model + + The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. + + [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateChartOfAccountsModelRequest + ) + request = cast(operations.GetCreateChartOfAccountsModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-create-chartOfAccounts-model", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/adjustments.py b/sync-for-expenses/src/codat_sync_for_expenses/adjustments.py new file mode 100644 index 000000000..7bb105b74 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/adjustments.py @@ -0,0 +1,262 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Optional, Union, cast + + +class Adjustments(BaseSDK): + r"""Create transactions that represent your adjustments to your customers' spend.""" + + def create( + self, + *, + request: Union[ + operations.CreateAdjustmentTransactionRequest, + operations.CreateAdjustmentTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.AdjustmentTransactionResponse]: + r"""Create adjustment transaction + + Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. + + Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. + + ### Supported Integrations + + | Integration | Supported | + |-----------------------|-----------| + | QuickBooks Desktop | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateAdjustmentTransactionRequest + ) + request = cast(operations.CreateAdjustmentTransactionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/sync/expenses/adjustment-transactions", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[List[shared.AdjustmentTransactionRequest]], + ), + 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( + operation_id="create-adjustment-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.AdjustmentTransactionResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateAdjustmentTransactionRequest, + operations.CreateAdjustmentTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.AdjustmentTransactionResponse]: + r"""Create adjustment transaction + + Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. + + Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. + + ### Supported Integrations + + | Integration | Supported | + |-----------------------|-----------| + | QuickBooks Desktop | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateAdjustmentTransactionRequest + ) + request = cast(operations.CreateAdjustmentTransactionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/sync/expenses/adjustment-transactions", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[List[shared.AdjustmentTransactionRequest]], + ), + 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( + operation_id="create-adjustment-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.AdjustmentTransactionResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/attachments.py b/sync-for-expenses/src/codat_sync_for_expenses/attachments.py new file mode 100644 index 000000000..05386ddd4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/attachments.py @@ -0,0 +1,272 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Attachments(BaseSDK): + r"""Attach receipts to a transaction for a complete audit trail.""" + + def upload( + self, + *, + request: Union[ + operations.UploadExpenseAttachmentRequest, + operations.UploadExpenseAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Attachment]: + r"""Upload attachment + + The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. + + [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. + + **Integration-specific behaviour** + + Each accounting software supports different file formats and sizes. + + | Integration | File size | File extension |Supported transaction type + |-------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|--------------| + | **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | + | **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `ReimbursableExpenses`, `ExpensePayment`, `ExpenseRefund` | + | **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`ExpensePayment`, `ExpenseRefund` | + | **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types + | **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | + | **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UploadExpenseAttachmentRequest + ) + request = cast(operations.UploadExpenseAttachmentRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.attachment_upload, + False, + True, + "multipart", + Optional[shared.AttachmentUpload], + ), + 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( + operation_id="upload-expense-attachment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Attachment]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def upload_async( + self, + *, + request: Union[ + operations.UploadExpenseAttachmentRequest, + operations.UploadExpenseAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Attachment]: + r"""Upload attachment + + The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. + + [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. + + **Integration-specific behaviour** + + Each accounting software supports different file formats and sizes. + + | Integration | File size | File extension |Supported transaction type + |-------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|--------------| + | **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | + | **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `ReimbursableExpenses`, `ExpensePayment`, `ExpenseRefund` | + | **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`ExpensePayment`, `ExpenseRefund` | + | **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types + | **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | + | **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UploadExpenseAttachmentRequest + ) + request = cast(operations.UploadExpenseAttachmentRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.attachment_upload, + False, + True, + "multipart", + Optional[shared.AttachmentUpload], + ), + 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( + operation_id="upload-expense-attachment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Attachment]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/bank_accounts.py b/sync-for-expenses/src/codat_sync_for_expenses/bank_accounts.py new file mode 100644 index 000000000..f47f8a947 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/bank_accounts.py @@ -0,0 +1,482 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class BankAccounts(BaseSDK): + r"""Create bank accounts and view create bank account options.""" + + def create( + self, + *, + request: Union[ + operations.CreateBankAccountRequest, + operations.CreateBankAccountRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBankAccountResponse]: + r"""Create bank account + + The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. + + [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateBankAccountRequest) + request = cast(operations.CreateBankAccountRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bankAccounts", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.bank_account, + True, + True, + "json", + OptionalNullable[shared.BankAccount], + ), + 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( + operation_id="create-bank-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateBankAccountResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateBankAccountRequest, + operations.CreateBankAccountRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBankAccountResponse]: + r"""Create bank account + + The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. + + [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateBankAccountRequest) + request = cast(operations.CreateBankAccountRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bankAccounts", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.bank_account, + True, + True, + "json", + OptionalNullable[shared.BankAccount], + ), + 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( + operation_id="create-bank-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateBankAccountResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get_create_model( + self, + *, + request: Union[ + operations.GetCreateBankAccountsModelRequest, + operations.GetCreateBankAccountsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create bank account model + + The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. + + [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateBankAccountsModelRequest + ) + request = cast(operations.GetCreateBankAccountsModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bankAccounts", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-create-bankAccounts-model", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_create_model_async( + self, + *, + request: Union[ + operations.GetCreateBankAccountsModelRequest, + operations.GetCreateBankAccountsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create bank account model + + The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. + + [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateBankAccountsModelRequest + ) + request = cast(operations.GetCreateBankAccountsModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bankAccounts", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-create-bankAccounts-model", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/basesdk.py b/sync-for-expenses/src/codat_sync_for_expenses/basesdk.py new file mode 100644 index 000000000..6dc48d6f5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/basesdk.py @@ -0,0 +1,343 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkconfiguration import SDKConfiguration +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) +from codat_sync_for_expenses.models import errors +from codat_sync_for_expenses.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, +) +import httpx +from typing import Callable, List, Optional, Tuple + + +class BaseSDK: + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + def get_url(self, base_url, url_variables): + sdk_url, sdk_variables = self.sdk_configuration.get_server_details() + + if base_url is None: + base_url = sdk_url + + if url_variables is None: + url_variables = sdk_variables + + return utils.template_url(base_url, url_variables) + + def build_request_async( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + client = self.sdk_configuration.async_client + return self.build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + ) + + def build_request( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + client = self.sdk_configuration.client + return self.build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + ) + + def build_request_with_client( + self, + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + query_params = {} + + url = url_override + if url is None: + url = utils.generate_url( + self.get_url(base_url, url_variables), + path, + request if request_has_path_params else None, + _globals if request_has_path_params else None, + ) + + query_params = utils.get_query_params( + request if request_has_query_params else None, + _globals if request_has_query_params else None, + ) + + headers = utils.get_headers(request, _globals) + headers["Accept"] = accept_header_value + headers[user_agent_header] = self.sdk_configuration.user_agent + + if security is not None: + if callable(security): + security = security() + + if security is not None: + security_headers, security_query_params = utils.get_security(security) + headers = {**headers, **security_headers} + query_params = {**query_params, **security_query_params} + + serialized_request_body = SerializedRequestBody("application/octet-stream") + if get_serialized_body is not None: + rb = get_serialized_body() + if request_body_required and rb is None: + raise ValueError("request body is required") + + if rb is not None: + serialized_request_body = rb + + if ( + serialized_request_body.media_type is not None + and serialized_request_body.media_type + not in ( + "multipart/form-data", + "multipart/mixed", + ) + ): + headers["content-type"] = serialized_request_body.media_type + + timeout = timeout_ms / 1000 if timeout_ms is not None else None + + return client.build_request( + method, + url, + params=query_params, + content=serialized_request_body.content, + data=serialized_request_body.data, + files=serialized_request_body.files, + headers=headers, + timeout=timeout, + ) + + def do_request( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.client + logger = self.sdk_configuration.debug_logger + + def do(): + http_res = None + try: + req = self.sdk_configuration.get_hooks().before_request( + BeforeRequestContext(hook_ctx), request + ) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + http_res = client.send(req, stream=stream) + except Exception as e: + _, e = self.sdk_configuration.get_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") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + 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 + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred") + + return http_res + + if retry_config is not None: + http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) + else: + 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 + ) + + return http_res + + async def do_request_async( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.async_client + logger = self.sdk_configuration.debug_logger + + async def do(): + http_res = None + try: + req = self.sdk_configuration.get_hooks().before_request( + BeforeRequestContext(hook_ctx), request + ) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + 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 + ) + 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") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + 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 + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred") + + return http_res + + if retry_config is not None: + http_res = await utils.retry_async( + do, utils.Retries(retry_config[0], retry_config[1]) + ) + else: + 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 + ) + + return http_res diff --git a/sync-for-expenses/src/codat_sync_for_expenses/companies.py b/sync-for-expenses/src/codat_sync_for_expenses/companies.py new file mode 100644 index 000000000..90e1e97ed --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/companies.py @@ -0,0 +1,1112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Companies(BaseSDK): + r"""Create and manage your SMB users' companies.""" + + def create( + self, + *, + request: Optional[ + Union[shared.CompanyRequestBody, shared.CompanyRequestBodyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Create company + + Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + + 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`. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CompanyRequestBody]) + request = cast(Optional[shared.CompanyRequestBody], request) + + req = self.build_request( + method="POST", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CompanyRequestBody] + ), + 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( + operation_id="create-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Optional[ + Union[shared.CompanyRequestBody, shared.CompanyRequestBodyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Create company + + Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + + 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`. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CompanyRequestBody]) + request = cast(Optional[shared.CompanyRequestBody], request) + + req = self.build_request_async( + method="POST", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CompanyRequestBody] + ), + 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( + operation_id="create-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def delete( + self, + *, + request: Union[ + operations.DeleteCompanyRequest, operations.DeleteCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete a company + + The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteCompanyRequest) + request = cast(operations.DeleteCompanyRequest, request) + + req = self.build_request( + method="DELETE", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="delete-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + 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", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def delete_async( + self, + *, + request: Union[ + operations.DeleteCompanyRequest, operations.DeleteCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete a company + + The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteCompanyRequest) + request = cast(operations.DeleteCompanyRequest, request) + + req = self.build_request_async( + method="DELETE", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="delete-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + 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", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get( + self, + *, + request: Union[ + operations.GetCompanyRequest, operations.GetCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Get company + + The *Get company* endpoint returns a single company for a given `companyId`. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyRequest) + request = cast(operations.GetCompanyRequest, request) + + req = self.build_request( + method="GET", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetCompanyRequest, operations.GetCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Get company + + The *Get company* endpoint returns a single company for a given `companyId`. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyRequest) + request = cast(operations.GetCompanyRequest, request) + + req = self.build_request_async( + method="GET", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListCompaniesRequest, operations.ListCompaniesRequestTypedDict + ] = operations.ListCompaniesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Companies]: + r"""List companies + + The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListCompaniesRequest) + request = cast(operations.ListCompaniesRequest, request) + + req = self.build_request( + method="GET", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + 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( + operation_id="list-companies", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Companies]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListCompaniesRequest, operations.ListCompaniesRequestTypedDict + ] = operations.ListCompaniesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Companies]: + r"""List companies + + The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListCompaniesRequest) + request = cast(operations.ListCompaniesRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + 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( + operation_id="list-companies", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Companies]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def update( + self, + *, + request: Union[ + operations.UpdateCompanyRequest, operations.UpdateCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Update company + + Use the *Update company* endpoint to update both the name and description of the company. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateCompanyRequest) + request = cast(operations.UpdateCompanyRequest, 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.company_request_body, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + 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( + operation_id="update-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateCompanyRequest, operations.UpdateCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Update company + + Use the *Update company* endpoint to update both the name and description of the company. + + A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateCompanyRequest) + request = cast(operations.UpdateCompanyRequest, 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.company_request_body, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + 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( + operation_id="update-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/company_info.py b/sync-for-expenses/src/codat_sync_for_expenses/company_info.py new file mode 100644 index 000000000..b9b1a1791 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/company_info.py @@ -0,0 +1,226 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class CompanyInfo(BaseSDK): + r"""View the company information of your customers' linked accounting software.""" + + def get( + self, + *, + request: Union[ + operations.GetCompanyInfoRequest, operations.GetCompanyInfoRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyInformation]: + r"""Get company info + + Gets the latest basic info for a company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyInfoRequest) + request = cast(operations.GetCompanyInfoRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/info", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-company-info", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyInformation] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetCompanyInfoRequest, operations.GetCompanyInfoRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyInformation]: + r"""Get company info + + Gets the latest basic info for a company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyInfoRequest) + request = cast(operations.GetCompanyInfoRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/info", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-company-info", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyInformation] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/configuration.py b/sync-for-expenses/src/codat_sync_for_expenses/configuration.py new file mode 100644 index 000000000..226b7d3be --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/configuration.py @@ -0,0 +1,464 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Configuration(BaseSDK): + r"""View and manage mapping configuration and defaults for expense transactions.""" + + def get( + self, + *, + request: Union[ + operations.GetCompanyConfigurationRequest, + operations.GetCompanyConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyConfiguration]: + r"""Get company configuration + + Gets a company's expense sync configuration + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCompanyConfigurationRequest + ) + request = cast(operations.GetCompanyConfigurationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/config", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-company-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyConfiguration] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetCompanyConfigurationRequest, + operations.GetCompanyConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyConfiguration]: + r"""Get company configuration + + Gets a company's expense sync configuration + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCompanyConfigurationRequest + ) + request = cast(operations.GetCompanyConfigurationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/config", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-company-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyConfiguration] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def set( + self, + *, + request: Union[ + operations.SetCompanyConfigurationRequest, + operations.SetCompanyConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyConfiguration]: + r"""Set company configuration + + Sets a company's expense sync configuration + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.SetCompanyConfigurationRequest + ) + request = cast(operations.SetCompanyConfigurationRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/sync/expenses/config", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.company_configuration, + False, + True, + "json", + Optional[shared.CompanyConfiguration], + ), + 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( + operation_id="set-company-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyConfiguration] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def set_async( + self, + *, + request: Union[ + operations.SetCompanyConfigurationRequest, + operations.SetCompanyConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyConfiguration]: + r"""Set company configuration + + Sets a company's expense sync configuration + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.SetCompanyConfigurationRequest + ) + request = cast(operations.SetCompanyConfigurationRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/sync/expenses/config", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.company_configuration, + False, + True, + "json", + Optional[shared.CompanyConfiguration], + ), + 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( + operation_id="set-company-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyConfiguration] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/connections.py b/sync-for-expenses/src/codat_sync_for_expenses/connections.py new file mode 100644 index 000000000..6e4508e6c --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/connections.py @@ -0,0 +1,1312 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Connections(BaseSDK): + r"""Create new and manage existing data connections for a company.""" + + def create( + self, + *, + request: Union[ + operations.CreateConnectionRequest, + operations.CreateConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create connection + + Creates a connection for the company by providing a valid `platformKey`. + + Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateConnectionRequest) + request = cast(operations.CreateConnectionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.CreateConnectionRequestBody], + ), + 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( + operation_id="create-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateConnectionRequest, + operations.CreateConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create connection + + Creates a connection for the company by providing a valid `platformKey`. + + Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateConnectionRequest) + request = cast(operations.CreateConnectionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.CreateConnectionRequestBody], + ), + 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( + operation_id="create-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def create_partner_expense_connection( + self, + *, + request: Union[ + operations.CreatePartnerExpenseConnectionRequest, + operations.CreatePartnerExpenseConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create partner expense connection + + Creates a partner expense data connection + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreatePartnerExpenseConnectionRequest + ) + request = cast(operations.CreatePartnerExpenseConnectionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/sync/expenses/connections/partnerExpense", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="create-partner-expense-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_partner_expense_connection_async( + self, + *, + request: Union[ + operations.CreatePartnerExpenseConnectionRequest, + operations.CreatePartnerExpenseConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create partner expense connection + + Creates a partner expense data connection + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreatePartnerExpenseConnectionRequest + ) + request = cast(operations.CreatePartnerExpenseConnectionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/sync/expenses/connections/partnerExpense", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="create-partner-expense-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def delete( + self, + *, + request: Union[ + operations.DeleteConnectionRequest, + operations.DeleteConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete connection + + Revoke and remove a connection from a company. + This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteConnectionRequest) + request = cast(operations.DeleteConnectionRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="delete-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + 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", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def delete_async( + self, + *, + request: Union[ + operations.DeleteConnectionRequest, + operations.DeleteConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete connection + + Revoke and remove a connection from a company. + This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteConnectionRequest) + request = cast(operations.DeleteConnectionRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="delete-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + 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", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get( + self, + *, + request: Union[ + operations.GetConnectionRequest, operations.GetConnectionRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Get connection + + Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetConnectionRequest) + request = cast(operations.GetConnectionRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetConnectionRequest, operations.GetConnectionRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Get connection + + Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetConnectionRequest) + request = cast(operations.GetConnectionRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListConnectionsRequest, + operations.ListConnectionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connections]: + r"""List connections + + List the connections for a company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListConnectionsRequest) + request = cast(operations.ListConnectionsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-connections", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connections]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListConnectionsRequest, + operations.ListConnectionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connections]: + r"""List connections + + List the connections for a company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListConnectionsRequest) + request = cast(operations.ListConnectionsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-connections", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connections]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def unlink( + self, + *, + request: Union[ + operations.UnlinkConnectionRequest, + operations.UnlinkConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Unlink connection + + This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their 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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UnlinkConnectionRequest) + request = cast(operations.UnlinkConnectionRequest, request) + + req = self.build_request( + method="PATCH", + path="/companies/{companyId}/connections/{connectionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.UnlinkConnectionUpdateConnection], + ), + 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( + operation_id="unlink-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def unlink_async( + self, + *, + request: Union[ + operations.UnlinkConnectionRequest, + operations.UnlinkConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Unlink connection + + This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their 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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UnlinkConnectionRequest) + request = cast(operations.UnlinkConnectionRequest, request) + + req = self.build_request_async( + method="PATCH", + path="/companies/{companyId}/connections/{connectionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.UnlinkConnectionUpdateConnection], + ), + 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( + operation_id="unlink-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/customers.py b/sync-for-expenses/src/codat_sync_for_expenses/customers.py new file mode 100644 index 000000000..29e39d1e9 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/customers.py @@ -0,0 +1,918 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Customers(BaseSDK): + r"""Get, create, and update customers.""" + + def create( + self, + *, + request: Union[ + operations.CreateCustomerRequest, operations.CreateCustomerRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateCustomerResponse]: + r"""Create customer + + The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateCustomerRequest) + request = cast(operations.CreateCustomerRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/customers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.customer, True, True, "json", OptionalNullable[shared.Customer] + ), + 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( + operation_id="create-customer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateCustomerResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateCustomerRequest, operations.CreateCustomerRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateCustomerResponse]: + r"""Create customer + + The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateCustomerRequest) + request = cast(operations.CreateCustomerRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/customers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.customer, True, True, "json", OptionalNullable[shared.Customer] + ), + 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( + operation_id="create-customer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateCustomerResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get( + self, + *, + request: Union[ + operations.GetCustomerRequest, operations.GetCustomerRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Customer]: + r"""Get customer + + The *Get customer* endpoint returns a single customer for a given customerId. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCustomerRequest) + request = cast(operations.GetCustomerRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/customers/{customerId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-customer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Customer]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetCustomerRequest, operations.GetCustomerRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Customer]: + r"""Get customer + + The *Get customer* endpoint returns a single customer for a given customerId. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCustomerRequest) + request = cast(operations.GetCustomerRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/customers/{customerId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-customer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Customer]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListCustomersRequest, operations.ListCustomersRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Customers]: + r"""List customers + + The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListCustomersRequest) + request = cast(operations.ListCustomersRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/customers", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-customers", + oauth2_scopes=[], + 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, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Customers]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListCustomersRequest, operations.ListCustomersRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Customers]: + r"""List customers + + The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListCustomersRequest) + request = cast(operations.ListCustomersRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/customers", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-customers", + oauth2_scopes=[], + 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, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Customers]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def update( + self, + *, + request: Union[ + operations.UpdateCustomerRequest, operations.UpdateCustomerRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateCustomerResponse]: + r"""Update customer + + The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateCustomerRequest) + request = cast(operations.UpdateCustomerRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/customers/{customerId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.customer, True, True, "json", OptionalNullable[shared.Customer] + ), + 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( + operation_id="update-customer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.UpdateCustomerResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateCustomerRequest, operations.UpdateCustomerRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateCustomerResponse]: + r"""Update customer + + The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + + [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateCustomerRequest) + request = cast(operations.UpdateCustomerRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/customers/{customerId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.customer, True, True, "json", OptionalNullable[shared.Customer] + ), + 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( + operation_id="update-customer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.UpdateCustomerResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/expenses.py b/sync-for-expenses/src/codat_sync_for_expenses/expenses.py new file mode 100644 index 000000000..baa7a4549 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/expenses.py @@ -0,0 +1,530 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Optional, Union, cast + + +class Expenses(BaseSDK): + r"""Create and update transactions that represent your customers' spend.""" + + def create( + self, + *, + request: Union[ + operations.CreateExpenseTransactionRequest, + operations.CreateExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateExpenseResponse]: + r"""Create expense transaction + + The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. + + [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. + + ### Supported Integrations + + | Integration | Supported | + |-------------------------------|-----------| + | Dynamics 365 Business Central | Yes | + | FreeAgent | Yes | + | QuickBooks Desktop | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + | Xero | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateExpenseTransactionRequest + ) + request = cast(operations.CreateExpenseTransactionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/sync/expenses/expense-transactions", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[List[shared.ExpenseTransaction]], + ), + 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( + operation_id="create-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateExpenseTransactionRequest, + operations.CreateExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateExpenseResponse]: + r"""Create expense transaction + + The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. + + [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. + + ### Supported Integrations + + | Integration | Supported | + |-------------------------------|-----------| + | Dynamics 365 Business Central | Yes | + | FreeAgent | Yes | + | QuickBooks Desktop | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + | Xero | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateExpenseTransactionRequest + ) + request = cast(operations.CreateExpenseTransactionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/sync/expenses/expense-transactions", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[List[shared.ExpenseTransaction]], + ), + 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( + operation_id="create-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def update( + self, + *, + request: Union[ + operations.UpdateExpenseTransactionRequest, + operations.UpdateExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateExpenseResponse]: + r"""Update expense transactions + + The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. + + [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. + + ### Supported Integrations + The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + | Xero | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdateExpenseTransactionRequest + ) + request = cast(operations.UpdateExpenseTransactionRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_expense_request, + False, + True, + "json", + Optional[shared.UpdateExpenseRequest], + ), + 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( + operation_id="update-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "422", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.UpdateExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "422", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateExpenseTransactionRequest, + operations.UpdateExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateExpenseResponse]: + r"""Update expense transactions + + The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. + + [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. + + ### Supported Integrations + The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + | Xero | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdateExpenseTransactionRequest + ) + request = cast(operations.UpdateExpenseTransactionRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_expense_request, + False, + True, + "json", + Optional[shared.UpdateExpenseRequest], + ), + 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( + operation_id="update-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "422", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.UpdateExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "422", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/httpclient.py b/sync-for-expenses/src/codat_sync_for_expenses/httpclient.py new file mode 100644 index 000000000..167cea4ef --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/httpclient.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# pyright: reportReturnType = false +from typing_extensions import Protocol, runtime_checkable +import httpx +from typing import Any, Optional, Union + + +@runtime_checkable +class HttpClient(Protocol): + def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + def close(self) -> None: + pass + + +@runtime_checkable +class AsyncHttpClient(Protocol): + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + async def aclose(self) -> None: + pass diff --git a/sync-for-expenses/src/codat_sync_for_expenses/manage_data.py b/sync-for-expenses/src/codat_sync_for_expenses/manage_data.py new file mode 100644 index 000000000..7e932b7f5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/manage_data.py @@ -0,0 +1,1078 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class ManageData(BaseSDK): + r"""Control and monitor the retrieval of data from an integration.""" + + def get( + self, + *, + request: Union[ + operations.GetDataStatusRequest, operations.GetDataStatusRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[operations.GetDataStatusDataStatuses]: + r"""Get data status + + Get the state of each data type for a company + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetDataStatusRequest) + request = cast(operations.GetDataStatusRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/dataStatus", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-data-status", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[operations.GetDataStatusDataStatuses] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetDataStatusRequest, operations.GetDataStatusRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[operations.GetDataStatusDataStatuses]: + r"""Get data status + + Get the state of each data type for a company + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetDataStatusRequest) + request = cast(operations.GetDataStatusRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/dataStatus", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-data-status", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[operations.GetDataStatusDataStatuses] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get_pull_operation( + self, + *, + request: Union[ + operations.GetPullOperationRequest, + operations.GetPullOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Get pull operation + + Retrieve information about a single dataset or pull operation. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPullOperationRequest) + request = cast(operations.GetPullOperationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/history/{datasetId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-pull-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_pull_operation_async( + self, + *, + request: Union[ + operations.GetPullOperationRequest, + operations.GetPullOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Get pull operation + + Retrieve information about a single dataset or pull operation. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPullOperationRequest) + request = cast(operations.GetPullOperationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/history/{datasetId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-pull-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list_pull_operations( + self, + *, + request: Union[ + operations.ListPullOperationsRequest, + operations.ListPullOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperations]: + r"""List pull operations + + Gets the pull operation history (datasets) for a given company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListPullOperationsRequest) + request = cast(operations.ListPullOperationsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/history", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-pull-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_pull_operations_async( + self, + *, + request: Union[ + operations.ListPullOperationsRequest, + operations.ListPullOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperations]: + r"""List pull operations + + Gets the pull operation history (datasets) for a given company. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListPullOperationsRequest) + request = cast(operations.ListPullOperationsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/history", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-pull-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def refresh_all_data_types( + self, + *, + request: Union[ + operations.RefreshAllDataTypesRequest, + operations.RefreshAllDataTypesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Refresh all data + + Refreshes all data types with `fetch on first link` set to `true` for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshAllDataTypesRequest) + request = cast(operations.RefreshAllDataTypesRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/data/all", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="refresh-all-data-types", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + 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", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def refresh_all_data_types_async( + self, + *, + request: Union[ + operations.RefreshAllDataTypesRequest, + operations.RefreshAllDataTypesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Refresh all data + + Refreshes all data types with `fetch on first link` set to `true` for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshAllDataTypesRequest) + request = cast(operations.RefreshAllDataTypesRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/data/all", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="refresh-all-data-types", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + 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", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def refresh_data_type( + self, + *, + request: Union[ + operations.RefreshDataTypeRequest, + operations.RefreshDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Refresh data type + + Refreshes a given data type for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshDataTypeRequest) + request = cast(operations.RefreshDataTypeRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/data/queue/{dataType}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="refresh-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def refresh_data_type_async( + self, + *, + request: Union[ + operations.RefreshDataTypeRequest, + operations.RefreshDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Refresh data type + + Refreshes a given data type for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshDataTypeRequest) + request = cast(operations.RefreshDataTypeRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/data/queue/{dataType}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="refresh-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/mapping_options.py b/sync-for-expenses/src/codat_sync_for_expenses/mapping_options.py new file mode 100644 index 000000000..f86518f74 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/mapping_options.py @@ -0,0 +1,222 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class MappingOptions(BaseSDK): + r"""Get accounts, trackingCategories and taxRates that can be used in your create and update requests.""" + + def get_mapping_options( + self, + *, + request: Union[ + operations.GetMappingOptionsRequest, + operations.GetMappingOptionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.MappingOptions]: + r"""Mapping options + + Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetMappingOptionsRequest) + request = cast(operations.GetMappingOptionsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/mappingOptions", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-mapping-options", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.MappingOptions]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_mapping_options_async( + self, + *, + request: Union[ + operations.GetMappingOptionsRequest, + operations.GetMappingOptionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.MappingOptions]: + r"""Mapping options + + Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetMappingOptionsRequest) + request = cast(operations.GetMappingOptionsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/mappingOptions", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-mapping-options", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.MappingOptions]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/errors/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/models/errors/__init__.py new file mode 100644 index 000000000..f056b05a6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/errors/__init__.py @@ -0,0 +1,6 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .errormessage import ErrorMessage, ErrorMessageData +from .sdkerror import SDKError + +__all__ = ["ErrorMessage", "ErrorMessageData", "SDKError"] diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/errors/errormessage.py b/sync-for-expenses/src/codat_sync_for_expenses/models/errors/errormessage.py new file mode 100644 index 000000000..a6b70c809 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/errors/errormessage.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses import utils +from codat_sync_for_expenses.models.shared import ( + errorvalidation as shared_errorvalidation, +) +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +import pydantic +from typing import Optional +from typing_extensions import Annotated + + +class ErrorMessageData(BaseModel): + can_be_retried: Annotated[Optional[str], pydantic.Field(alias="canBeRetried")] = ( + None + ) + r"""`True` if the error occurred transiently and can be retried.""" + + 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.""" + + 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.""" + + error: Optional[str] = None + r"""A brief description of the error.""" + + service: Optional[str] = None + r"""Codat's service the returned the error.""" + + status_code: Annotated[Optional[int], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by 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.""" + + +class ErrorMessage(Exception): + 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) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/errors/sdkerror.py b/sync-for-expenses/src/codat_sync_for_expenses/models/errors/sdkerror.py new file mode 100644 index 000000000..03216cbf5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/errors/sdkerror.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from dataclasses import dataclass +from typing import Optional +import httpx + + +@dataclass +class SDKError(Exception): + """Represents an error returned by the API.""" + + message: str + status_code: int = -1 + body: str = "" + raw_response: Optional[httpx.Response] = None + + def __str__(self): + body = "" + if len(self.body) > 0: + body = f"\n{self.body}" + + return f"{self.message}: Status {self.status_code}{body}" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/__init__.py new file mode 100644 index 000000000..9af9916f7 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/__init__.py @@ -0,0 +1,230 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .create_account import CreateAccountRequest, CreateAccountRequestTypedDict +from .create_adjustment_transaction import ( + CreateAdjustmentTransactionRequest, + CreateAdjustmentTransactionRequestTypedDict, +) +from .create_bank_account import ( + CreateBankAccountRequest, + CreateBankAccountRequestTypedDict, +) +from .create_connection import ( + CreateConnectionRequest, + CreateConnectionRequestBody, + CreateConnectionRequestBodyTypedDict, + CreateConnectionRequestTypedDict, +) +from .create_customer import CreateCustomerRequest, CreateCustomerRequestTypedDict +from .create_expense_transaction import ( + CreateExpenseTransactionRequest, + CreateExpenseTransactionRequestTypedDict, +) +from .create_partner_expense_connection import ( + CreatePartnerExpenseConnectionRequest, + CreatePartnerExpenseConnectionRequestTypedDict, +) +from .create_reimbursable_expense_transaction import ( + CreateReimbursableExpenseTransactionRequest, + CreateReimbursableExpenseTransactionRequestTypedDict, +) +from .create_supplier import CreateSupplierRequest, CreateSupplierRequestTypedDict +from .create_transfer_transaction import ( + CreateTransferTransactionRequest, + CreateTransferTransactionRequestTypedDict, +) +from .delete_company import DeleteCompanyRequest, DeleteCompanyRequestTypedDict +from .delete_connection import DeleteConnectionRequest, DeleteConnectionRequestTypedDict +from .get_company import GetCompanyRequest, GetCompanyRequestTypedDict +from .get_company_configuration import ( + GetCompanyConfigurationRequest, + GetCompanyConfigurationRequestTypedDict, +) +from .get_company_info import GetCompanyInfoRequest, GetCompanyInfoRequestTypedDict +from .get_connection import GetConnectionRequest, GetConnectionRequestTypedDict +from .get_create_bankaccounts_model import ( + GetCreateBankAccountsModelRequest, + GetCreateBankAccountsModelRequestTypedDict, +) +from .get_create_chartofaccounts_model import ( + GetCreateChartOfAccountsModelRequest, + GetCreateChartOfAccountsModelRequestTypedDict, +) +from .get_customer import GetCustomerRequest, GetCustomerRequestTypedDict +from .get_data_status import ( + GetDataStatusDataStatuses, + GetDataStatusDataStatusesTypedDict, + GetDataStatusRequest, + GetDataStatusRequestTypedDict, +) +from .get_last_successful_sync import ( + GetLastSuccessfulSyncRequest, + GetLastSuccessfulSyncRequestTypedDict, +) +from .get_latest_sync import GetLatestSyncRequest, GetLatestSyncRequestTypedDict +from .get_mapping_options import ( + GetMappingOptionsRequest, + GetMappingOptionsRequestTypedDict, +) +from .get_pull_operation import ( + GetPullOperationRequest, + GetPullOperationRequestTypedDict, +) +from .get_push_operation import ( + GetPushOperationRequest, + GetPushOperationRequestTypedDict, +) +from .get_supplier import GetSupplierRequest, GetSupplierRequestTypedDict +from .get_sync_by_id import GetSyncByIDRequest, GetSyncByIDRequestTypedDict +from .get_sync_transaction import ( + GetSyncTransactionRequest, + GetSyncTransactionRequestTypedDict, +) +from .list_companies import ListCompaniesRequest, ListCompaniesRequestTypedDict +from .list_connections import ListConnectionsRequest, ListConnectionsRequestTypedDict +from .list_customers import ListCustomersRequest, ListCustomersRequestTypedDict +from .list_pull_operations import ( + ListPullOperationsRequest, + ListPullOperationsRequestTypedDict, +) +from .list_push_operations import ( + ListPushOperationsRequest, + ListPushOperationsRequestTypedDict, +) +from .list_suppliers import ListSuppliersRequest, ListSuppliersRequestTypedDict +from .list_sync_transactions import ( + ListSyncTransactionsRequest, + ListSyncTransactionsRequestTypedDict, +) +from .list_syncs import ListSyncsRequest, ListSyncsRequestTypedDict +from .refresh_all_data_types import ( + RefreshAllDataTypesRequest, + RefreshAllDataTypesRequestTypedDict, +) +from .refresh_data_type import RefreshDataTypeRequest, RefreshDataTypeRequestTypedDict +from .set_company_configuration import ( + SetCompanyConfigurationRequest, + SetCompanyConfigurationRequestTypedDict, +) +from .unlink_connection import ( + UnlinkConnectionRequest, + UnlinkConnectionRequestTypedDict, + UnlinkConnectionUpdateConnection, + UnlinkConnectionUpdateConnectionTypedDict, +) +from .update_company import UpdateCompanyRequest, UpdateCompanyRequestTypedDict +from .update_customer import UpdateCustomerRequest, UpdateCustomerRequestTypedDict +from .update_expense_transaction import ( + UpdateExpenseTransactionRequest, + UpdateExpenseTransactionRequestTypedDict, +) +from .update_reimbursable_expense_transaction import ( + UpdateReimbursableExpenseTransactionRequest, + UpdateReimbursableExpenseTransactionRequestTypedDict, +) +from .update_supplier import UpdateSupplierRequest, UpdateSupplierRequestTypedDict +from .upload_expense_attachment import ( + UploadExpenseAttachmentRequest, + UploadExpenseAttachmentRequestTypedDict, +) + +__all__ = [ + "CreateAccountRequest", + "CreateAccountRequestTypedDict", + "CreateAdjustmentTransactionRequest", + "CreateAdjustmentTransactionRequestTypedDict", + "CreateBankAccountRequest", + "CreateBankAccountRequestTypedDict", + "CreateConnectionRequest", + "CreateConnectionRequestBody", + "CreateConnectionRequestBodyTypedDict", + "CreateConnectionRequestTypedDict", + "CreateCustomerRequest", + "CreateCustomerRequestTypedDict", + "CreateExpenseTransactionRequest", + "CreateExpenseTransactionRequestTypedDict", + "CreatePartnerExpenseConnectionRequest", + "CreatePartnerExpenseConnectionRequestTypedDict", + "CreateReimbursableExpenseTransactionRequest", + "CreateReimbursableExpenseTransactionRequestTypedDict", + "CreateSupplierRequest", + "CreateSupplierRequestTypedDict", + "CreateTransferTransactionRequest", + "CreateTransferTransactionRequestTypedDict", + "DeleteCompanyRequest", + "DeleteCompanyRequestTypedDict", + "DeleteConnectionRequest", + "DeleteConnectionRequestTypedDict", + "GetCompanyConfigurationRequest", + "GetCompanyConfigurationRequestTypedDict", + "GetCompanyInfoRequest", + "GetCompanyInfoRequestTypedDict", + "GetCompanyRequest", + "GetCompanyRequestTypedDict", + "GetConnectionRequest", + "GetConnectionRequestTypedDict", + "GetCreateBankAccountsModelRequest", + "GetCreateBankAccountsModelRequestTypedDict", + "GetCreateChartOfAccountsModelRequest", + "GetCreateChartOfAccountsModelRequestTypedDict", + "GetCustomerRequest", + "GetCustomerRequestTypedDict", + "GetDataStatusDataStatuses", + "GetDataStatusDataStatusesTypedDict", + "GetDataStatusRequest", + "GetDataStatusRequestTypedDict", + "GetLastSuccessfulSyncRequest", + "GetLastSuccessfulSyncRequestTypedDict", + "GetLatestSyncRequest", + "GetLatestSyncRequestTypedDict", + "GetMappingOptionsRequest", + "GetMappingOptionsRequestTypedDict", + "GetPullOperationRequest", + "GetPullOperationRequestTypedDict", + "GetPushOperationRequest", + "GetPushOperationRequestTypedDict", + "GetSupplierRequest", + "GetSupplierRequestTypedDict", + "GetSyncByIDRequest", + "GetSyncByIDRequestTypedDict", + "GetSyncTransactionRequest", + "GetSyncTransactionRequestTypedDict", + "ListCompaniesRequest", + "ListCompaniesRequestTypedDict", + "ListConnectionsRequest", + "ListConnectionsRequestTypedDict", + "ListCustomersRequest", + "ListCustomersRequestTypedDict", + "ListPullOperationsRequest", + "ListPullOperationsRequestTypedDict", + "ListPushOperationsRequest", + "ListPushOperationsRequestTypedDict", + "ListSuppliersRequest", + "ListSuppliersRequestTypedDict", + "ListSyncTransactionsRequest", + "ListSyncTransactionsRequestTypedDict", + "ListSyncsRequest", + "ListSyncsRequestTypedDict", + "RefreshAllDataTypesRequest", + "RefreshAllDataTypesRequestTypedDict", + "RefreshDataTypeRequest", + "RefreshDataTypeRequestTypedDict", + "SetCompanyConfigurationRequest", + "SetCompanyConfigurationRequestTypedDict", + "UnlinkConnectionRequest", + "UnlinkConnectionRequestTypedDict", + "UnlinkConnectionUpdateConnection", + "UnlinkConnectionUpdateConnectionTypedDict", + "UpdateCompanyRequest", + "UpdateCompanyRequestTypedDict", + "UpdateCustomerRequest", + "UpdateCustomerRequestTypedDict", + "UpdateExpenseTransactionRequest", + "UpdateExpenseTransactionRequestTypedDict", + "UpdateReimbursableExpenseTransactionRequest", + "UpdateReimbursableExpenseTransactionRequestTypedDict", + "UpdateSupplierRequest", + "UpdateSupplierRequestTypedDict", + "UploadExpenseAttachmentRequest", + "UploadExpenseAttachmentRequestTypedDict", +] diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_account.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_account.py new file mode 100644 index 000000000..7d6b23f89 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_account.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + accountprototype as shared_accountprototype, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateAccountRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + account_prototype: NotRequired[shared_accountprototype.AccountPrototypeTypedDict] + allow_sync_on_push_complete: NotRequired[bool] + r"""Allow a sync upon push completion.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateAccountRequest(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.""" + + account_prototype: Annotated[ + Optional[shared_accountprototype.AccountPrototype], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + allow_sync_on_push_complete: Annotated[ + Optional[bool], + pydantic.Field(alias="allowSyncOnPushComplete"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Allow a sync upon push completion.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_adjustment_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_adjustment_transaction.py new file mode 100644 index 000000000..167cb1d98 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_adjustment_transaction.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + adjustmenttransactionrequest as shared_adjustmenttransactionrequest, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateAdjustmentTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + request_body: NotRequired[ + List[shared_adjustmenttransactionrequest.AdjustmentTransactionRequestTypedDict] + ] + + +class CreateAdjustmentTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + request_body: Annotated[ + Optional[ + List[shared_adjustmenttransactionrequest.AdjustmentTransactionRequest] + ], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_bank_account.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_bank_account.py new file mode 100644 index 000000000..8a8b32979 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_bank_account.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import bankaccount as shared_bankaccount +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateBankAccountRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bank_account: NotRequired[Nullable[shared_bankaccount.BankAccountTypedDict]] + allow_sync_on_push_complete: NotRequired[bool] + r"""Allow a sync upon push completion.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateBankAccountRequest(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.""" + + bank_account: Annotated[ + OptionalNullable[shared_bankaccount.BankAccount], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + allow_sync_on_push_complete: Annotated[ + Optional[bool], + pydantic.Field(alias="allowSyncOnPushComplete"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Allow a sync upon push completion.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["BankAccount", "allowSyncOnPushComplete", "timeoutInMinutes"] + nullable_fields = ["BankAccount"] + 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-expenses/src/codat_sync_for_expenses/models/operations/create_connection.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_connection.py new file mode 100644 index 000000000..b15f053fe --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_connection.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateConnectionRequestBodyTypedDict(TypedDict): + platform_key: NotRequired[str] + 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.""" + + +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.""" + + +class CreateConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + request_body: NotRequired[CreateConnectionRequestBodyTypedDict] + + +class CreateConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + request_body: Annotated[ + Optional[CreateConnectionRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_customer.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_customer.py new file mode 100644 index 000000000..efee60822 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_customer.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import customer as shared_customer +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateCustomerRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + customer: NotRequired[Nullable[shared_customer.CustomerTypedDict]] + allow_sync_on_push_complete: NotRequired[bool] + r"""Allow a sync upon push completion.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateCustomerRequest(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.""" + + customer: Annotated[ + OptionalNullable[shared_customer.Customer], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + allow_sync_on_push_complete: Annotated[ + Optional[bool], + pydantic.Field(alias="allowSyncOnPushComplete"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Allow a sync upon push completion.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["Customer", "allowSyncOnPushComplete", "timeoutInMinutes"] + nullable_fields = ["Customer"] + 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-expenses/src/codat_sync_for_expenses/models/operations/create_expense_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_expense_transaction.py new file mode 100644 index 000000000..c119c872b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_expense_transaction.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + expensetransaction as shared_expensetransaction, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateExpenseTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + request_body: NotRequired[ + List[shared_expensetransaction.ExpenseTransactionTypedDict] + ] + + +class CreateExpenseTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + request_body: Annotated[ + Optional[List[shared_expensetransaction.ExpenseTransaction]], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_partner_expense_connection.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_partner_expense_connection.py new file mode 100644 index 000000000..17406776b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_partner_expense_connection.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class CreatePartnerExpenseConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class CreatePartnerExpenseConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_reimbursable_expense_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_reimbursable_expense_transaction.py new file mode 100644 index 000000000..3112fe936 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_reimbursable_expense_transaction.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + reimbursableexpensetransaction as shared_reimbursableexpensetransaction, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateReimbursableExpenseTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + request_body: NotRequired[ + List[ + shared_reimbursableexpensetransaction.ReimbursableExpenseTransactionTypedDict + ] + ] + + +class CreateReimbursableExpenseTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + request_body: Annotated[ + Optional[ + List[shared_reimbursableexpensetransaction.ReimbursableExpenseTransaction] + ], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_supplier.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_supplier.py new file mode 100644 index 000000000..8828149a4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_supplier.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import supplier as shared_supplier +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateSupplierRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + supplier: NotRequired[Nullable[shared_supplier.SupplierTypedDict]] + allow_sync_on_push_complete: NotRequired[bool] + r"""Allow a sync upon push completion.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateSupplierRequest(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.""" + + supplier: Annotated[ + OptionalNullable[shared_supplier.Supplier], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + allow_sync_on_push_complete: Annotated[ + Optional[bool], + pydantic.Field(alias="allowSyncOnPushComplete"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Allow a sync upon push completion.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["Supplier", "allowSyncOnPushComplete", "timeoutInMinutes"] + nullable_fields = ["Supplier"] + 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-expenses/src/codat_sync_for_expenses/models/operations/create_transfer_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_transfer_transaction.py new file mode 100644 index 000000000..a4bb788dc --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/create_transfer_transaction.py @@ -0,0 +1,46 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + transfertransactionrequest as shared_transfertransactionrequest, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateTransferTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + transaction_id: str + r"""The unique identifier for your SMB's transaction.""" + transfer_transaction_request: NotRequired[ + shared_transfertransactionrequest.TransferTransactionRequestTypedDict + ] + + +class CreateTransferTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + transaction_id: Annotated[ + str, + pydantic.Field(alias="transactionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique identifier for your SMB's transaction.""" + + transfer_transaction_request: Annotated[ + Optional[shared_transfertransactionrequest.TransferTransactionRequest], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/delete_company.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/delete_company.py new file mode 100644 index 000000000..f06b15f4f --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/delete_company.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class DeleteCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/delete_connection.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/delete_connection.py new file mode 100644 index 000000000..74caa4486 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/delete_connection.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DeleteConnectionRequest(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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company.py new file mode 100644 index 000000000..ca429a3bb --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company_configuration.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company_configuration.py new file mode 100644 index 000000000..4bed062ce --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company_configuration.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyConfigurationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyConfigurationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company_info.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company_info.py new file mode 100644 index 000000000..a2fba7c13 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_company_info.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyInfoRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyInfoRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_connection.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_connection.py new file mode 100644 index 000000000..5fb7d8a57 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_connection.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetConnectionRequest(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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_create_bankaccounts_model.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_create_bankaccounts_model.py new file mode 100644 index 000000000..2cac31c23 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_create_bankaccounts_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateBankAccountsModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateBankAccountsModelRequest(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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_create_chartofaccounts_model.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_create_chartofaccounts_model.py new file mode 100644 index 000000000..a34eec985 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_create_chartofaccounts_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateChartOfAccountsModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateChartOfAccountsModelRequest(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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_customer.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_customer.py new file mode 100644 index 000000000..a2a9c4ac4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_customer.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCustomerRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + customer_id: str + r"""Unique identifier for a customer.""" + + +class GetCustomerRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + customer_id: Annotated[ + str, + pydantic.Field(alias="customerId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a customer.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_data_status.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_data_status.py new file mode 100644 index 000000000..d51590854 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_data_status.py @@ -0,0 +1,331 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import datastatus as shared_datastatus +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetDataStatusRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetDataStatusRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + +class GetDataStatusDataStatusesTypedDict(TypedDict): + r"""OK""" + + account_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + balance_sheet: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bank_accounts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bank_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_account_balances: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_accounts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_transaction_categories: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bill_credit_notes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bill_payments: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bills: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + cash_flow_statement: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + chart_of_accounts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_company_info: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_customers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_disputes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_locations: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_orders: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_payment_methods: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_payments: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_product_categories: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_products: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_tax_components: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + company: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + credit_notes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + customers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + direct_costs: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + direct_incomes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + invoices: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + item_receipts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + items: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + journal_entries: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + journals: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + payment_methods: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + payments: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + profit_and_loss: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + purchase_orders: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + sales_orders: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + suppliers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + tax_rates: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + tracking_categories: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + transfers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + + +class GetDataStatusDataStatuses(BaseModel): + r"""OK""" + + account_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="accountTransactions"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + balance_sheet: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="balanceSheet") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bank_accounts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="bankAccounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bank_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="bankTransactions") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_account_balances: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="banking-accountBalances"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_accounts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="banking-accounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_transaction_categories: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="banking-transactionCategories"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="banking-transactions"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bill_credit_notes: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="billCreditNotes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bill_payments: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="billPayments") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bills: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + cash_flow_statement: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="cashFlowStatement"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + chart_of_accounts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="chartOfAccounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_company_info: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-companyInfo"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_customers: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-customers"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_disputes: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-disputes"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_locations: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-locations"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_orders: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="commerce-orders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_payment_methods: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-paymentMethods"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_payments: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-payments"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_product_categories: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-productCategories"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_products: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-products"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_tax_components: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-taxComponents"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-transactions"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + company: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + credit_notes: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="creditNotes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + customers: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + direct_costs: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="directCosts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + direct_incomes: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="directIncomes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + invoices: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + item_receipts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="itemReceipts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + items: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + journal_entries: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="journalEntries") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + journals: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + payment_methods: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="paymentMethods") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + payments: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + profit_and_loss: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="profitAndLoss") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + purchase_orders: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="purchaseOrders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + sales_orders: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="salesOrders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + suppliers: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + tax_rates: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="taxRates") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + tracking_categories: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="trackingCategories"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + transfers: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_last_successful_sync.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_last_successful_sync.py new file mode 100644 index 000000000..77151a2dd --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_last_successful_sync.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetLastSuccessfulSyncRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetLastSuccessfulSyncRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_latest_sync.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_latest_sync.py new file mode 100644 index 000000000..6263a106d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_latest_sync.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetLatestSyncRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetLatestSyncRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_mapping_options.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_mapping_options.py new file mode 100644 index 000000000..b7cebbe88 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_mapping_options.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetMappingOptionsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetMappingOptionsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_pull_operation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_pull_operation.py new file mode 100644 index 000000000..dec74b03b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_pull_operation.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPullOperationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + dataset_id: str + r"""Unique identifier for the dataset that completed its sync.""" + + +class GetPullOperationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + dataset_id: Annotated[ + str, + pydantic.Field(alias="datasetId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for the dataset that completed its sync.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_push_operation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_push_operation.py new file mode 100644 index 000000000..cccda80a3 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_push_operation.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPushOperationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + push_operation_key: str + r"""Push operation key.""" + + +class GetPushOperationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + push_operation_key: Annotated[ + str, + pydantic.Field(alias="pushOperationKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Push operation key.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_supplier.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_supplier.py new file mode 100644 index 000000000..769ac5ae0 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_supplier.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetSupplierRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + supplier_id: str + r"""Unique identifier for a supplier.""" + + +class GetSupplierRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + supplier_id: Annotated[ + str, + pydantic.Field(alias="supplierId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a supplier.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_sync_by_id.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_sync_by_id.py new file mode 100644 index 000000000..7315d40eb --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_sync_by_id.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetSyncByIDRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + sync_id: str + r"""Unique identifier for a sync.""" + + +class GetSyncByIDRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + sync_id: Annotated[ + str, + pydantic.Field(alias="syncId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a sync.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_sync_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_sync_transaction.py new file mode 100644 index 000000000..ee22b2b87 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/get_sync_transaction.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetSyncTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + sync_id: str + r"""Unique identifier for a sync.""" + transaction_id: str + r"""The unique identifier for your SMB's transaction.""" + + +class GetSyncTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + sync_id: Annotated[ + str, + pydantic.Field(alias="syncId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a sync.""" + + transaction_id: Annotated[ + str, + pydantic.Field(alias="transactionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique identifier for your SMB's transaction.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_companies.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_companies.py new file mode 100644 index 000000000..4c33b0559 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_companies.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListCompaniesRequestTypedDict(TypedDict): + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListCompaniesRequest(BaseModel): + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + 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).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_connections.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_connections.py new file mode 100644 index 000000000..42e5a863d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_connections.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListConnectionsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListConnectionsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + 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).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_customers.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_customers.py new file mode 100644 index 000000000..a711c8be8 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_customers.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListCustomersRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListCustomersRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + 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).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_pull_operations.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_pull_operations.py new file mode 100644 index 000000000..8c3fd14e0 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_pull_operations.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPullOperationsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListPullOperationsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + 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).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_push_operations.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_push_operations.py new file mode 100644 index 000000000..d776cb34a --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_push_operations.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPushOperationsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListPushOperationsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + 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).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_suppliers.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_suppliers.py new file mode 100644 index 000000000..ee66d0ad2 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_suppliers.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListSuppliersRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListSuppliersRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + 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).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_sync_transactions.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_sync_transactions.py new file mode 100644 index 000000000..855608bec --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_sync_transactions.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListSyncTransactionsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + sync_id: str + r"""Unique identifier for a sync.""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + +class ListSyncTransactionsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + sync_id: Annotated[ + str, + pydantic.Field(alias="syncId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a sync.""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_syncs.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_syncs.py new file mode 100644 index 000000000..90658a7a7 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/list_syncs.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class ListSyncsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class ListSyncsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/refresh_all_data_types.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/refresh_all_data_types.py new file mode 100644 index 000000000..4fb422130 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/refresh_all_data_types.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class RefreshAllDataTypesRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class RefreshAllDataTypesRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/refresh_data_type.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/refresh_data_type.py new file mode 100644 index 000000000..5b5316c6b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/refresh_data_type.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + schema_datatype as shared_schema_datatype, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class RefreshDataTypeRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + data_type: shared_schema_datatype.SchemaDataType + r"""The key of a Codat data type""" + connection_id: NotRequired[str] + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" + + +class RefreshDataTypeRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + data_type: Annotated[ + shared_schema_datatype.SchemaDataType, + pydantic.Field(alias="dataType"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The key of a Codat data type""" + + connection_id: Annotated[ + Optional[str], + pydantic.Field(alias="connectionId"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/set_company_configuration.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/set_company_configuration.py new file mode 100644 index 000000000..1ee51f1c9 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/set_company_configuration.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + companyconfiguration as shared_companyconfiguration, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SetCompanyConfigurationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + company_configuration: NotRequired[ + shared_companyconfiguration.CompanyConfigurationTypedDict + ] + + +class SetCompanyConfigurationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + company_configuration: Annotated[ + Optional[shared_companyconfiguration.CompanyConfiguration], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/unlink_connection.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/unlink_connection.py new file mode 100644 index 000000000..8e7b2d22c --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/unlink_connection.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + dataconnectionstatus as shared_dataconnectionstatus, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UnlinkConnectionUpdateConnectionTypedDict(TypedDict): + status: NotRequired[shared_dataconnectionstatus.DataConnectionStatus] + r"""The current authorization status of the data connection.""" + + +class UnlinkConnectionUpdateConnection(BaseModel): + status: Optional[shared_dataconnectionstatus.DataConnectionStatus] = None + r"""The current authorization status of the data connection.""" + + +class UnlinkConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + request_body: NotRequired[UnlinkConnectionUpdateConnectionTypedDict] + + +class UnlinkConnectionRequest(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.""" + + request_body: Annotated[ + Optional[UnlinkConnectionUpdateConnection], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_company.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_company.py new file mode 100644 index 000000000..0435cee4a --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_company.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + companyrequestbody as shared_companyrequestbody, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + company_request_body: NotRequired[ + shared_companyrequestbody.CompanyRequestBodyTypedDict + ] + + +class UpdateCompanyRequest(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 diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_customer.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_customer.py new file mode 100644 index 000000000..008da7cca --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_customer.py @@ -0,0 +1,121 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import customer as shared_customer +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateCustomerRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + customer_id: str + r"""Unique identifier for a customer.""" + customer: NotRequired[Nullable[shared_customer.CustomerTypedDict]] + allow_sync_on_push_complete: NotRequired[bool] + r"""Allow a sync upon push completion.""" + force_update: NotRequired[bool] + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class UpdateCustomerRequest(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.""" + + customer_id: Annotated[ + str, + pydantic.Field(alias="customerId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a customer.""" + + customer: Annotated[ + OptionalNullable[shared_customer.Customer], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + allow_sync_on_push_complete: Annotated[ + Optional[bool], + pydantic.Field(alias="allowSyncOnPushComplete"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Allow a sync upon push completion.""" + + force_update: Annotated[ + Optional[bool], + pydantic.Field(alias="forceUpdate"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "Customer", + "allowSyncOnPushComplete", + "forceUpdate", + "timeoutInMinutes", + ] + nullable_fields = ["Customer"] + 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-expenses/src/codat_sync_for_expenses/models/operations/update_expense_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_expense_transaction.py new file mode 100644 index 000000000..fa64837be --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_expense_transaction.py @@ -0,0 +1,46 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + updateexpenserequest as shared_updateexpenserequest, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateExpenseTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + transaction_id: str + r"""The unique identifier for your SMB's transaction.""" + update_expense_request: NotRequired[ + shared_updateexpenserequest.UpdateExpenseRequestTypedDict + ] + + +class UpdateExpenseTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + transaction_id: Annotated[ + str, + pydantic.Field(alias="transactionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique identifier for your SMB's transaction.""" + + update_expense_request: Annotated[ + Optional[shared_updateexpenserequest.UpdateExpenseRequest], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_reimbursable_expense_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_reimbursable_expense_transaction.py new file mode 100644 index 000000000..728c92bd7 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_reimbursable_expense_transaction.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + updatereimbursableexpensetransactionrequest as shared_updatereimbursableexpensetransactionrequest, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateReimbursableExpenseTransactionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + transaction_id: str + r"""The unique identifier for your SMB's transaction.""" + update_reimbursable_expense_transaction_request: NotRequired[ + shared_updatereimbursableexpensetransactionrequest.UpdateReimbursableExpenseTransactionRequestTypedDict + ] + + +class UpdateReimbursableExpenseTransactionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + transaction_id: Annotated[ + str, + pydantic.Field(alias="transactionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique identifier for your SMB's transaction.""" + + update_reimbursable_expense_transaction_request: Annotated[ + Optional[ + shared_updatereimbursableexpensetransactionrequest.UpdateReimbursableExpenseTransactionRequest + ], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_supplier.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_supplier.py new file mode 100644 index 000000000..d62a906d5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/update_supplier.py @@ -0,0 +1,121 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import supplier as shared_supplier +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateSupplierRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + supplier_id: str + r"""Unique identifier for a supplier.""" + supplier: NotRequired[Nullable[shared_supplier.SupplierTypedDict]] + allow_sync_on_push_complete: NotRequired[bool] + r"""Allow a sync upon push completion.""" + force_update: NotRequired[bool] + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class UpdateSupplierRequest(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.""" + + supplier_id: Annotated[ + str, + pydantic.Field(alias="supplierId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a supplier.""" + + supplier: Annotated[ + OptionalNullable[shared_supplier.Supplier], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + allow_sync_on_push_complete: Annotated[ + Optional[bool], + pydantic.Field(alias="allowSyncOnPushComplete"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Allow a sync upon push completion.""" + + force_update: Annotated[ + Optional[bool], + pydantic.Field(alias="forceUpdate"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "Supplier", + "allowSyncOnPushComplete", + "forceUpdate", + "timeoutInMinutes", + ] + nullable_fields = ["Supplier"] + 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-expenses/src/codat_sync_for_expenses/models/operations/upload_expense_attachment.py b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/upload_expense_attachment.py new file mode 100644 index 000000000..8ed34f5a4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/operations/upload_expense_attachment.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.models.shared import ( + attachmentupload as shared_attachmentupload, +) +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UploadExpenseAttachmentRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + sync_id: str + r"""Unique identifier for a sync.""" + transaction_id: str + r"""The unique identifier for your SMB's transaction.""" + attachment_upload: NotRequired[shared_attachmentupload.AttachmentUploadTypedDict] + + +class UploadExpenseAttachmentRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + sync_id: Annotated[ + str, + pydantic.Field(alias="syncId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a sync.""" + + transaction_id: Annotated[ + str, + pydantic.Field(alias="transactionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique identifier for your SMB's transaction.""" + + attachment_upload: Annotated[ + Optional[shared_attachmentupload.AttachmentUpload], + FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/__init__.py new file mode 100644 index 000000000..3c6f7fe7c --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/__init__.py @@ -0,0 +1,520 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .accountingaddresstype import AccountingAddressType +from .accountmappinginfo import ( + AccountMappingInfo, + AccountMappingInfoAccountType, + AccountMappingInfoTypedDict, +) +from .accountprototype import ( + AccountPrototype, + AccountPrototypeTypedDict, + ValidDataTypeLinks, + ValidDataTypeLinksTypedDict, +) +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .adjustmenttransactionline import ( + AdjustmentTransactionLine, + AdjustmentTransactionLineTypedDict, +) +from .adjustmenttransactionrequest import ( + AdjustmentTransactionRequest, + AdjustmentTransactionRequestTypedDict, +) +from .adjustmenttransactionresponse import ( + AdjustmentTransactionResponse, + AdjustmentTransactionResponseTypedDict, +) +from .apaccountref import ApAccountRef, ApAccountRefTypedDict +from .attachment import Attachment, AttachmentTypedDict +from .attachmentupload import AttachmentUpload, AttachmentUploadTypedDict +from .bankaccount import BankAccount, BankAccountType, BankAccountTypedDict +from .bankaccountdetails import BankAccountDetails, BankAccountDetailsTypedDict +from .bankaccountstatus import BankAccountStatus +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 .companyconfiguration import CompanyConfiguration, CompanyConfigurationTypedDict +from .companyinformation import ( + AccountingAddress, + AccountingAddressTypedDict, + CompanyInformation, + CompanyInformationType, + CompanyInformationTypedDict, + Phone, + PhoneTypedDict, + Weblink, + WeblinkTypedDict, +) +from .companyreference import ( + CompanyReference, + CompanyReferenceLinks, + CompanyReferenceLinksTypedDict, + CompanyReferenceTypedDict, +) +from .companyrequestbody import CompanyRequestBody, CompanyRequestBodyTypedDict +from .companysyncstatus import CompanySyncStatus, CompanySyncStatusTypedDict +from .connection import Connection, ConnectionTypedDict, SourceType +from .connections import Connections, ConnectionsTypedDict +from .contact import Contact, ContactTypedDict +from .createaccountresponse import ( + AccountingAccount, + AccountingAccountTypedDict, + CreateAccountResponse, + CreateAccountResponseMetadata, + CreateAccountResponseMetadataTypedDict, + CreateAccountResponseTypedDict, + CreateAccountResponseValidDataTypeLinks, + CreateAccountResponseValidDataTypeLinksTypedDict, +) +from .createbankaccountresponse import ( + AccountingBankAccount, + AccountingBankAccountTypedDict, + CreateBankAccountResponse, + CreateBankAccountResponseBankAccountType, + CreateBankAccountResponseTypedDict, +) +from .createcustomerresponse import ( + AccountingCustomer, + AccountingCustomerTypedDict, + CreateCustomerResponse, + CreateCustomerResponseTypedDict, +) +from .createexpenseresponse import CreateExpenseResponse, CreateExpenseResponseTypedDict +from .createreimbursableexpenseresponse import ( + CreateReimbursableExpenseResponse, + CreateReimbursableExpenseResponseTypedDict, +) +from .createsupplierresponse import ( + AccountingSupplier, + AccountingSupplierTypedDict, + CreateSupplierResponse, + CreateSupplierResponseTypedDict, +) +from .customer import Customer, CustomerTypedDict +from .customerdetails import CustomerDetails, CustomerDetailsTypedDict +from .customers import Customers, CustomersTypedDict +from .customerstatus import CustomerStatus +from .dataconnectionerror import ( + DataConnectionError, + DataConnectionErrorTypedDict, + ErrorStatus, +) +from .dataconnectionstatus import DataConnectionStatus +from .datastatus import DataStatus, DataStatusTypedDict, DataTypes +from .datatype import DataType +from .errorvalidation import ErrorValidation, ErrorValidationTypedDict +from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict +from .expensecontactref import ExpenseContactRef, ExpenseContactRefTypedDict, Type +from .expensessyncwebhook import ExpensesSyncWebhook, ExpensesSyncWebhookTypedDict +from .expensessyncwebhookpayload import ( + ExpensesSyncWebhookPayload, + ExpensesSyncWebhookPayloadTypedDict, +) +from .expensetransaction import ( + BankAccountReference, + BankAccountReferenceTypedDict, + ExpenseTransaction, + ExpenseTransactionType, + ExpenseTransactionTypedDict, +) +from .expensetransactionline import ( + ExpenseTransactionLine, + ExpenseTransactionLineTypedDict, +) +from .halref import HalRef, HalRefTypedDict +from .integrationtype import IntegrationType +from .invoiceto import InvoiceTo, InvoiceToType, InvoiceToTypedDict +from .itemref import ItemRef, ItemRefTypedDict +from .items import Items, ItemsTypedDict +from .links import Links, LinksTypedDict +from .mappingoptions import MappingOptions, MappingOptionsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .phonenumber_items import PhoneNumberItems, PhoneNumberItemsTypedDict +from .phonenumbertype import PhoneNumberType +from .pulloperation import DatasetStatus, PullOperation, PullOperationTypedDict +from .pulloperations import PullOperations, PullOperationsTypedDict +from .pushchangetype import PushChangeType +from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict +from .pushoperation import PushOperation, PushOperationTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationref import PushOperationRef, PushOperationRefTypedDict +from .pushoperations import PushOperations, PushOperationsTypedDict +from .pushoperationstatus import PushOperationStatus +from .pushoption import PushOption, PushOptionTypedDict +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from .recordref import RecordRef, RecordRefTypedDict +from .reimbursableexpensetransaction import ( + ReimbursableExpenseTransaction, + ReimbursableExpenseTransactionTypedDict, +) +from .reimbursableexpensetransactionline import ( + ReimbursableExpenseTransactionLine, + ReimbursableExpenseTransactionLineTypedDict, +) +from .reimbursementcontactref import ( + ReimbursementContactRef, + ReimbursementContactRefTypedDict, +) +from .schema_datatype import SchemaDataType +from .schema_transaction import SchemaTransaction, SchemaTransactionTypedDict +from .security import Security, SecurityTypedDict +from .status import Status +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplier import Supplier, SupplierTypedDict +from .supplierdetails import SupplierDetails, SupplierDetailsTypedDict +from .suppliers import Suppliers, SuppliersTypedDict +from .supplierstatus import SupplierStatus +from .synccompletewebhook import SyncCompleteWebhook, SyncCompleteWebhookTypedDict +from .synccompletewebhookdata import ( + SyncCompleteWebhookData, + SyncCompleteWebhookDataTypedDict, +) +from .syncfailedwebhook import SyncFailedWebhook, SyncFailedWebhookTypedDict +from .syncfailedwebhookdata import SyncFailedWebhookData, SyncFailedWebhookDataTypedDict +from .taxratemappinginfo import TaxRateMappingInfo, TaxRateMappingInfoTypedDict +from .trackingcategorymappinginfo import ( + TrackingCategoryMappingInfo, + TrackingCategoryMappingInfoTypedDict, +) +from .trackingref import TrackingRef, TrackingRefDataType, TrackingRefTypedDict +from .trackingrefadjustmenttransaction import ( + TrackingRefAdjustmentTransaction, + TrackingRefAdjustmentTransactionDataType, + TrackingRefAdjustmentTransactionTypedDict, +) +from .transaction import Transaction, TransactionDefinitionsStatus, TransactionTypedDict +from .transactions import Transactions, TransactionsTypedDict +from .transactionstatus import TransactionStatus +from .transfertransactionrequest import ( + AccountReference, + AccountReferenceTypedDict, + From, + FromTypedDict, + To, + ToTypedDict, + TransferTransactionRequest, + TransferTransactionRequestAccountReference, + TransferTransactionRequestAccountReferenceTypedDict, + TransferTransactionRequestTypedDict, +) +from .transfertransactionresponse import ( + TransferTransactionResponse, + TransferTransactionResponseTypedDict, +) +from .updatecustomerresponse import ( + UpdateCustomerResponse, + UpdateCustomerResponseAccountingCustomer, + UpdateCustomerResponseAccountingCustomerTypedDict, + UpdateCustomerResponseTypedDict, +) +from .updateexpenserequest import ( + UpdateExpenseRequest, + UpdateExpenseRequestBankAccountReference, + UpdateExpenseRequestBankAccountReferenceTypedDict, + UpdateExpenseRequestType, + UpdateExpenseRequestTypedDict, +) +from .updateexpenseresponse import UpdateExpenseResponse, UpdateExpenseResponseTypedDict +from .updatereimbursableexpensetransactionrequest import ( + UpdateReimbursableExpenseTransactionRequest, + UpdateReimbursableExpenseTransactionRequestTypedDict, +) +from .updatesupplierresponse import ( + UpdateSupplierResponse, + UpdateSupplierResponseAccountingSupplier, + UpdateSupplierResponseAccountingSupplierTypedDict, + UpdateSupplierResponseTypedDict, +) +from .validation import Validation, ValidationTypedDict +from .validationitem import ValidationItem, ValidationItemTypedDict +from .validfor import ValidFor +from .validtransactiontypes import ValidTransactionTypes + +__all__ = [ + "AccountMappingInfo", + "AccountMappingInfoAccountType", + "AccountMappingInfoTypedDict", + "AccountPrototype", + "AccountPrototypeTypedDict", + "AccountReference", + "AccountReferenceTypedDict", + "AccountStatus", + "AccountType", + "AccountingAccount", + "AccountingAccountTypedDict", + "AccountingAddress", + "AccountingAddressType", + "AccountingAddressTypedDict", + "AccountingBankAccount", + "AccountingBankAccountTypedDict", + "AccountingCustomer", + "AccountingCustomerTypedDict", + "AccountingSupplier", + "AccountingSupplierTypedDict", + "AdjustmentTransactionLine", + "AdjustmentTransactionLineTypedDict", + "AdjustmentTransactionRequest", + "AdjustmentTransactionRequestTypedDict", + "AdjustmentTransactionResponse", + "AdjustmentTransactionResponseTypedDict", + "ApAccountRef", + "ApAccountRefTypedDict", + "Attachment", + "AttachmentTypedDict", + "AttachmentUpload", + "AttachmentUploadTypedDict", + "BankAccount", + "BankAccountDetails", + "BankAccountDetailsTypedDict", + "BankAccountReference", + "BankAccountReferenceTypedDict", + "BankAccountStatus", + "BankAccountType", + "BankAccountTypedDict", + "ClientRateLimitReachedWebhook", + "ClientRateLimitReachedWebhookData", + "ClientRateLimitReachedWebhookDataTypedDict", + "ClientRateLimitReachedWebhookTypedDict", + "ClientRateLimitResetWebhook", + "ClientRateLimitResetWebhookData", + "ClientRateLimitResetWebhookDataTypedDict", + "ClientRateLimitResetWebhookTypedDict", + "ClientRateLimitWebhook", + "ClientRateLimitWebhookPayload", + "ClientRateLimitWebhookPayloadTypedDict", + "ClientRateLimitWebhookTypedDict", + "CodatFile", + "CodatFileTypedDict", + "Companies", + "CompaniesTypedDict", + "Company", + "CompanyConfiguration", + "CompanyConfigurationTypedDict", + "CompanyInformation", + "CompanyInformationType", + "CompanyInformationTypedDict", + "CompanyReference", + "CompanyReferenceLinks", + "CompanyReferenceLinksTypedDict", + "CompanyReferenceTypedDict", + "CompanyRequestBody", + "CompanyRequestBodyTypedDict", + "CompanySyncStatus", + "CompanySyncStatusTypedDict", + "CompanyTypedDict", + "Connection", + "ConnectionTypedDict", + "Connections", + "ConnectionsTypedDict", + "Contact", + "ContactTypedDict", + "CreateAccountResponse", + "CreateAccountResponseMetadata", + "CreateAccountResponseMetadataTypedDict", + "CreateAccountResponseTypedDict", + "CreateAccountResponseValidDataTypeLinks", + "CreateAccountResponseValidDataTypeLinksTypedDict", + "CreateBankAccountResponse", + "CreateBankAccountResponseBankAccountType", + "CreateBankAccountResponseTypedDict", + "CreateCustomerResponse", + "CreateCustomerResponseTypedDict", + "CreateExpenseResponse", + "CreateExpenseResponseTypedDict", + "CreateReimbursableExpenseResponse", + "CreateReimbursableExpenseResponseTypedDict", + "CreateSupplierResponse", + "CreateSupplierResponseTypedDict", + "Customer", + "CustomerDetails", + "CustomerDetailsTypedDict", + "CustomerStatus", + "CustomerTypedDict", + "Customers", + "CustomersTypedDict", + "DataConnectionError", + "DataConnectionErrorTypedDict", + "DataConnectionStatus", + "DataStatus", + "DataStatusTypedDict", + "DataType", + "DataTypes", + "DatasetStatus", + "ErrorStatus", + "ErrorValidation", + "ErrorValidationItem", + "ErrorValidationItemTypedDict", + "ErrorValidationTypedDict", + "ExpenseContactRef", + "ExpenseContactRefTypedDict", + "ExpenseTransaction", + "ExpenseTransactionLine", + "ExpenseTransactionLineTypedDict", + "ExpenseTransactionType", + "ExpenseTransactionTypedDict", + "ExpensesSyncWebhook", + "ExpensesSyncWebhookPayload", + "ExpensesSyncWebhookPayloadTypedDict", + "ExpensesSyncWebhookTypedDict", + "From", + "FromTypedDict", + "HalRef", + "HalRefTypedDict", + "IntegrationType", + "InvoiceTo", + "InvoiceToType", + "InvoiceToTypedDict", + "ItemRef", + "ItemRefTypedDict", + "Items", + "ItemsTypedDict", + "Links", + "LinksTypedDict", + "MappingOptions", + "MappingOptionsTypedDict", + "Metadata", + "MetadataTypedDict", + "Phone", + "PhoneNumberItems", + "PhoneNumberItemsTypedDict", + "PhoneNumberType", + "PhoneTypedDict", + "PullOperation", + "PullOperationTypedDict", + "PullOperations", + "PullOperationsTypedDict", + "PushChangeType", + "PushFieldValidation", + "PushFieldValidationTypedDict", + "PushOperation", + "PushOperationChange", + "PushOperationChangeTypedDict", + "PushOperationRef", + "PushOperationRefTypedDict", + "PushOperationStatus", + "PushOperationTypedDict", + "PushOperations", + "PushOperationsTypedDict", + "PushOption", + "PushOptionChoice", + "PushOptionChoiceTypedDict", + "PushOptionProperty", + "PushOptionPropertyTypedDict", + "PushOptionType", + "PushOptionTypedDict", + "PushValidationInfo", + "PushValidationInfoTypedDict", + "RecordRef", + "RecordRefTypedDict", + "ReimbursableExpenseTransaction", + "ReimbursableExpenseTransactionLine", + "ReimbursableExpenseTransactionLineTypedDict", + "ReimbursableExpenseTransactionTypedDict", + "ReimbursementContactRef", + "ReimbursementContactRefTypedDict", + "SchemaDataType", + "SchemaTransaction", + "SchemaTransactionTypedDict", + "Security", + "SecurityTypedDict", + "SourceType", + "Status", + "SupplementalData", + "SupplementalDataTypedDict", + "Supplier", + "SupplierDetails", + "SupplierDetailsTypedDict", + "SupplierStatus", + "SupplierTypedDict", + "Suppliers", + "SuppliersTypedDict", + "SyncCompleteWebhook", + "SyncCompleteWebhookData", + "SyncCompleteWebhookDataTypedDict", + "SyncCompleteWebhookTypedDict", + "SyncFailedWebhook", + "SyncFailedWebhookData", + "SyncFailedWebhookDataTypedDict", + "SyncFailedWebhookTypedDict", + "TaxRateMappingInfo", + "TaxRateMappingInfoTypedDict", + "To", + "ToTypedDict", + "TrackingCategoryMappingInfo", + "TrackingCategoryMappingInfoTypedDict", + "TrackingRef", + "TrackingRefAdjustmentTransaction", + "TrackingRefAdjustmentTransactionDataType", + "TrackingRefAdjustmentTransactionTypedDict", + "TrackingRefDataType", + "TrackingRefTypedDict", + "Transaction", + "TransactionDefinitionsStatus", + "TransactionStatus", + "TransactionTypedDict", + "Transactions", + "TransactionsTypedDict", + "TransferTransactionRequest", + "TransferTransactionRequestAccountReference", + "TransferTransactionRequestAccountReferenceTypedDict", + "TransferTransactionRequestTypedDict", + "TransferTransactionResponse", + "TransferTransactionResponseTypedDict", + "Type", + "UpdateCustomerResponse", + "UpdateCustomerResponseAccountingCustomer", + "UpdateCustomerResponseAccountingCustomerTypedDict", + "UpdateCustomerResponseTypedDict", + "UpdateExpenseRequest", + "UpdateExpenseRequestBankAccountReference", + "UpdateExpenseRequestBankAccountReferenceTypedDict", + "UpdateExpenseRequestType", + "UpdateExpenseRequestTypedDict", + "UpdateExpenseResponse", + "UpdateExpenseResponseTypedDict", + "UpdateReimbursableExpenseTransactionRequest", + "UpdateReimbursableExpenseTransactionRequestTypedDict", + "UpdateSupplierResponse", + "UpdateSupplierResponseAccountingSupplier", + "UpdateSupplierResponseAccountingSupplierTypedDict", + "UpdateSupplierResponseTypedDict", + "ValidDataTypeLinks", + "ValidDataTypeLinksTypedDict", + "ValidFor", + "ValidTransactionTypes", + "Validation", + "ValidationItem", + "ValidationItemTypedDict", + "ValidationTypedDict", + "Weblink", + "WeblinkTypedDict", +] diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountingaddresstype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountingaddresstype.py new file mode 100644 index 000000000..4d5a97871 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountingaddresstype.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountingAddressType(str, Enum): + r"""The type of the address""" + + UNKNOWN = "Unknown" + BILLING = "Billing" + DELIVERY = "Delivery" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountmappinginfo.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountmappinginfo.py new file mode 100644 index 000000000..830f535d9 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountmappinginfo.py @@ -0,0 +1,130 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .validfor import ValidFor +from .validtransactiontypes import ValidTransactionTypes +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountMappingInfoAccountType(str, Enum): + r"""Type of the account.""" + + ASSET = "Asset" + LIABILITY = "Liability" + INCOME = "Income" + EXPENSE = "Expense" + EQUITY = "Equity" + + +class AccountMappingInfoTypedDict(TypedDict): + account_type: NotRequired[AccountMappingInfoAccountType] + r"""Type of the account.""" + currency: NotRequired[str] + r"""Currency of the account.""" + fully_qualified_category: NotRequired[str] + r"""Full account type and category of the account""" + id: NotRequired[str] + r"""Unique identifier of account.""" + is_bank_account: NotRequired[bool] + r"""Confirms whether the account is a bank account or not.""" + name: NotRequired[str] + r"""Name of the account as it appears in the company's accounting software.""" + nominal_code: NotRequired[Nullable[str]] + r"""Code used to identify each nominal account in the accounting software.""" + valid_for: NotRequired[List[ValidFor]] + r"""Supported endpoints for the account.""" + valid_transaction_types: NotRequired[List[ValidTransactionTypes]] + r"""Supported transaction types for the account.""" + + +class AccountMappingInfo(BaseModel): + account_type: Annotated[ + Optional[AccountMappingInfoAccountType], pydantic.Field(alias="accountType") + ] = None + r"""Type of the account.""" + + currency: Optional[str] = None + r"""Currency of the account.""" + + fully_qualified_category: Annotated[ + Optional[str], pydantic.Field(alias="fullyQualifiedCategory") + ] = None + r"""Full account type and category of the account""" + + id: Optional[str] = None + r"""Unique identifier of account.""" + + is_bank_account: Annotated[ + Optional[bool], pydantic.Field(alias="isBankAccount") + ] = None + r"""Confirms whether the account is a bank account or not.""" + + name: Optional[str] = None + r"""Name of the account as it appears in the company's accounting software.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Code used to identify each nominal account in the accounting software.""" + + valid_for: Annotated[Optional[List[ValidFor]], pydantic.Field(alias="validFor")] = ( + None + ) + r"""Supported endpoints for the account.""" + + valid_transaction_types: Annotated[ + Optional[List[ValidTransactionTypes]], + pydantic.Field(alias="validTransactionTypes"), + ] = None + r"""Supported transaction types for the account.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountType", + "currency", + "fullyQualifiedCategory", + "id", + "isBankAccount", + "name", + "nominalCode", + "validFor", + "validTransactionTypes", + ] + nullable_fields = ["nominalCode"] + 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-expenses/src/codat_sync_for_expenses/models/shared/accountprototype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountprototype.py new file mode 100644 index 000000000..83229f065 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountprototype.py @@ -0,0 +1,320 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ValidDataTypeLinksTypedDict(TypedDict): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: NotRequired[Nullable[List[str]]] + r"""Supported `dataTypes` that the record can be linked to.""" + property: NotRequired[Nullable[str]] + r"""The property from the account that can be linked.""" + + +class ValidDataTypeLinks(BaseModel): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: OptionalNullable[List[str]] = UNSET + r"""Supported `dataTypes` that the record can be linked to.""" + + property: OptionalNullable[str] = UNSET + r"""The property from the account that can be linked.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["links", "property"] + nullable_fields = ["links", "property"] + 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 + + +class AccountPrototypeTypedDict(TypedDict): + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + current_balance: NotRequired[Nullable[Decimal]] + r"""Current balance in the account.""" + description: NotRequired[Nullable[str]] + r"""Description for the account.""" + fully_qualified_category: NotRequired[Nullable[str]] + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + fully_qualified_name: NotRequired[Nullable[str]] + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + is_bank_account: NotRequired[bool] + r"""Confirms whether the account is a bank account or not.""" + name: NotRequired[Nullable[str]] + r"""Name of the account.""" + nominal_code: NotRequired[Nullable[str]] + r"""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.""" + status: NotRequired[AccountStatus] + r"""Status of the account""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + type: NotRequired[AccountType] + r"""Type of account""" + valid_datatype_links: NotRequired[Nullable[List[ValidDataTypeLinksTypedDict]]] + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks).""" + + +class AccountPrototype(BaseModel): + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + current_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currentBalance"), + ] = UNSET + r"""Current balance in the account.""" + + description: OptionalNullable[str] = UNSET + r"""Description for the account.""" + + fully_qualified_category: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedCategory") + ] = UNSET + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + + fully_qualified_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedName") + ] = UNSET + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + + is_bank_account: Annotated[ + Optional[bool], pydantic.Field(alias="isBankAccount") + ] = None + r"""Confirms whether the account is a bank account or not.""" + + name: OptionalNullable[str] = UNSET + r"""Name of the account.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""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.""" + + status: Optional[AccountStatus] = None + r"""Status of the account""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + type: Optional[AccountType] = None + r"""Type of account""" + + valid_datatype_links: Annotated[ + OptionalNullable[List[ValidDataTypeLinks]], + pydantic.Field(alias="validDatatypeLinks"), + ] = UNSET + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "currency", + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "isBankAccount", + "name", + "nominalCode", + "status", + "supplementalData", + "type", + "validDatatypeLinks", + ] + nullable_fields = [ + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "name", + "nominalCode", + "validDatatypeLinks", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/accountstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountstatus.py new file mode 100644 index 000000000..2ae331abc --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accountstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountStatus(str, Enum): + r"""Status of the account""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" + PENDING = "Pending" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accounttype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accounttype.py new file mode 100644 index 000000000..b893d55ba --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/accounttype.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountType(str, Enum): + r"""Type of account""" + + UNKNOWN = "Unknown" + ASSET = "Asset" + EXPENSE = "Expense" + INCOME = "Income" + LIABILITY = "Liability" + EQUITY = "Equity" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionline.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionline.py new file mode 100644 index 000000000..56d90f9b0 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionline.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .invoiceto import InvoiceTo, InvoiceToTypedDict +from .recordref import RecordRef, RecordRefTypedDict +from .trackingrefadjustmenttransaction import ( + TrackingRefAdjustmentTransaction, + TrackingRefAdjustmentTransactionTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AdjustmentTransactionLineTypedDict(TypedDict): + account_ref: RecordRefTypedDict + amount: Decimal + r"""Amount of the line. A positive line represents a debit; a negative line represents a credit.""" + description: NotRequired[str] + r"""Any private, company notes about the transaction.""" + invoice_to: NotRequired[Nullable[InvoiceToTypedDict]] + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + tracking_refs: NotRequired[ + Nullable[List[TrackingRefAdjustmentTransactionTypedDict]] + ] + + +class AdjustmentTransactionLine(BaseModel): + account_ref: Annotated[RecordRef, pydantic.Field(alias="accountRef")] + + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount of the line. A positive line represents a debit; a negative line represents a credit.""" + + description: Optional[str] = None + r"""Any private, company notes about the transaction.""" + + invoice_to: Annotated[ + OptionalNullable[InvoiceTo], pydantic.Field(alias="invoiceTo") + ] = UNSET + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + + tracking_refs: Annotated[ + OptionalNullable[List[TrackingRefAdjustmentTransaction]], + pydantic.Field(alias="trackingRefs"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["description", "invoiceTo", "trackingRefs"] + nullable_fields = ["invoiceTo", "trackingRefs"] + 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-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionrequest.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionrequest.py new file mode 100644 index 000000000..3d75bb72a --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionrequest.py @@ -0,0 +1,196 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .adjustmenttransactionline import ( + AdjustmentTransactionLine, + AdjustmentTransactionLineTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AdjustmentTransactionRequestTypedDict(TypedDict): + currency: str + r"""Currency the transaction was recorded in.""" + date_: 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. + """ + id: str + r"""Your unique identifier for the transaction.""" + lines: List[AdjustmentTransactionLineTypedDict] + r"""Array of transaction lines.""" + currency_rate: NotRequired[Nullable[Decimal]] + r"""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. | + """ + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the adjustment transaction.""" + + +class AdjustmentTransactionRequest(BaseModel): + currency: str + r"""Currency the transaction was recorded in.""" + + date_: Annotated[str, pydantic.Field(alias="date")] + 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. + """ + + id: str + r"""Your unique identifier for the transaction.""" + + lines: List[AdjustmentTransactionLine] + r"""Array of transaction lines.""" + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""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. | + """ + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the adjustment transaction.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["currencyRate", "reference"] + nullable_fields = ["currencyRate", "reference"] + 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-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionresponse.py new file mode 100644 index 000000000..23c967c3b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/adjustmenttransactionresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AdjustmentTransactionResponseTypedDict(TypedDict): + sync_id: NotRequired[str] + r"""Unique id of sync created""" + + +class AdjustmentTransactionResponse(BaseModel): + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique id of sync created""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/apaccountref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/apaccountref.py new file mode 100644 index 000000000..d2a64b459 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/apaccountref.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ApAccountRefTypedDict(TypedDict): + id: NotRequired[str] + r"""Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop.""" + + +class ApAccountRef(BaseModel): + id: Optional[str] = None + r"""Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/attachment.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/attachment.py new file mode 100644 index 000000000..ac8394ff2 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/attachment.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AttachmentTypedDict(TypedDict): + company_id: NotRequired[str] + r"""Unique ID of company in Codat""" + id: NotRequired[str] + r"""Unique identifier of attachment""" + transaction_id: NotRequired[str] + r"""Unique identifier of transaction""" + + +class Attachment(BaseModel): + company_id: Annotated[Optional[str], pydantic.Field(alias="companyId")] = None + r"""Unique ID of company in Codat""" + + id: Optional[str] = None + r"""Unique identifier of attachment""" + + transaction_id: Annotated[Optional[str], pydantic.Field(alias="transactionId")] = ( + None + ) + r"""Unique identifier of transaction""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/attachmentupload.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/attachmentupload.py new file mode 100644 index 000000000..b88902712 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/attachmentupload.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .codatfile import CodatFile, CodatFileTypedDict +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, MultipartFormMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class AttachmentUploadTypedDict(TypedDict): + file: CodatFileTypedDict + r"""The file to be uploaded as an attachment.""" + + +class AttachmentUpload(BaseModel): + file: Annotated[ + CodatFile, + pydantic.Field(alias=""), + FieldMetadata(multipart=MultipartFormMetadata(file=True)), + ] + r"""The file to be uploaded as an attachment.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccount.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccount.py new file mode 100644 index 000000000..62a235200 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccount.py @@ -0,0 +1,293 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .bankaccountstatus import BankAccountStatus +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BankAccountType(str, Enum): + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + UNKNOWN = "Unknown" + CREDIT = "Credit" + DEBIT = "Debit" + + +class BankAccountTypedDict(TypedDict): + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting software. + * The currency and balance of the account. + * The sort code and account number. + """ + + account_name: NotRequired[Nullable[str]] + r"""Name of the bank account in the accounting software.""" + account_number: NotRequired[Nullable[str]] + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + account_type: NotRequired[BankAccountType] + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + available_balance: NotRequired[Nullable[Decimal]] + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + balance: NotRequired[Nullable[Decimal]] + r"""Balance of the bank account.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + i_ban: NotRequired[Nullable[str]] + r"""International bank account number of the account. Often used when making or receiving international payments.""" + id: NotRequired[str] + r"""Identifier for the account, unique for the company in the accounting software.""" + institution: NotRequired[Nullable[str]] + r"""The institution of the bank account.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + nominal_code: NotRequired[Nullable[str]] + r"""Code used to identify each nominal account for a business.""" + overdraft_limit: NotRequired[Nullable[Decimal]] + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + sort_code: NotRequired[Nullable[str]] + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + source_modified_date: NotRequired[str] + status: NotRequired[BankAccountStatus] + r"""Status of the bank account.""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + +class BankAccount(BaseModel): + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting software. + * The currency and balance of the account. + * The sort code and account number. + """ + + account_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountName") + ] = UNSET + r"""Name of the bank account in the accounting software.""" + + account_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountNumber") + ] = UNSET + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + + account_type: Annotated[ + Optional[BankAccountType], pydantic.Field(alias="accountType") + ] = None + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + available_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="availableBalance"), + ] = UNSET + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + + balance: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""Balance of the bank account.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + i_ban: Annotated[OptionalNullable[str], pydantic.Field(alias="iBan")] = UNSET + r"""International bank account number of the account. Often used when making or receiving international payments.""" + + id: Optional[str] = None + r"""Identifier for the account, unique for the company in the accounting software.""" + + institution: OptionalNullable[str] = UNSET + r"""The institution of the bank account.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Code used to identify each nominal account for a business.""" + + overdraft_limit: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="overdraftLimit"), + ] = UNSET + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[BankAccountStatus] = None + r"""Status of the bank account.""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountName", + "accountNumber", + "accountType", + "availableBalance", + "balance", + "currency", + "iBan", + "id", + "institution", + "metadata", + "modifiedDate", + "nominalCode", + "overdraftLimit", + "sortCode", + "sourceModifiedDate", + "status", + "supplementalData", + ] + nullable_fields = [ + "accountName", + "accountNumber", + "availableBalance", + "balance", + "iBan", + "institution", + "nominalCode", + "overdraftLimit", + "sortCode", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccountdetails.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccountdetails.py new file mode 100644 index 000000000..fd29f5735 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccountdetails.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class BankAccountDetailsTypedDict(TypedDict): + id: NotRequired[str] + r"""The id of the account from which purchases are made""" + + +class BankAccountDetails(BaseModel): + id: Optional[str] = None + r"""The id of the account from which purchases are made""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccountstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccountstatus.py new file mode 100644 index 000000000..be857f929 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/bankaccountstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BankAccountStatus(str, Enum): + r"""Status of the bank account.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" + PENDING = "Pending" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhook.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhook.py new file mode 100644 index 000000000..88ced2018 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhook.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitreachedwebhookdata import ( + ClientRateLimitReachedWebhookData, + ClientRateLimitReachedWebhookDataTypedDict, +) +from codat_sync_for_expenses.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.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + data: NotRequired[ClientRateLimitReachedWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ClientRateLimitReachedWebhook(BaseModel): + r"""Webhook request body for a client that has reached their rate limit.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + 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.""" + + data: Annotated[ + Optional[ClientRateLimitReachedWebhookData], pydantic.Field(alias="Data") + ] = None + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + 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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhookdata.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhookdata.py new file mode 100644 index 000000000..1569dd38d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitreachedwebhookdata.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.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-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhook.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhook.py new file mode 100644 index 000000000..98fa1e127 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhook.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitresetwebhookdata import ( + ClientRateLimitResetWebhookData, + ClientRateLimitResetWebhookDataTypedDict, +) +from codat_sync_for_expenses.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.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + data: NotRequired[ClientRateLimitResetWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ClientRateLimitResetWebhook(BaseModel): + r"""Webhook request body for a client that has had their rate limit reset.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + 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.""" + + data: Annotated[ + Optional[ClientRateLimitResetWebhookData], pydantic.Field(alias="Data") + ] = None + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + 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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhookdata.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhookdata.py new file mode 100644 index 000000000..77b1ec61b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitresetwebhookdata.py @@ -0,0 +1,109 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.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): + 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. + """ + 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.""" + + +class ClientRateLimitResetWebhookData(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. + """ + + 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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["DailyQuota", "ExpiresUtc", "QuotaRemaining", "ResetReason"] + 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-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitwebhook.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitwebhook.py new file mode 100644 index 000000000..59e81eb94 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitwebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitwebhookpayload import ( + ClientRateLimitWebhookPayload, + ClientRateLimitWebhookPayloadTypedDict, +) +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[ClientRateLimitWebhookPayloadTypedDict] + + +class ClientRateLimitWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[ClientRateLimitWebhookPayload] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitwebhookpayload.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitwebhookpayload.py new file mode 100644 index 000000000..4aa95c4a7 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/clientratelimitwebhookpayload.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitWebhookPayloadTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expiry_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + quota_remaining: NotRequired[int] + r"""Total number of requests remaining for your client.""" + + +class ClientRateLimitWebhookPayload(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="dailyQuota")] = None + r"""The number of available requests per day.""" + + expiry_date: Annotated[Optional[str], pydantic.Field(alias="expiryDate")] = 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. + """ + + quota_remaining: Annotated[ + Optional[int], pydantic.Field(alias="quotaRemaining") + ] = None + r"""Total number of requests remaining for your client.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/codatfile.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/codatfile.py new file mode 100644 index 000000000..eca6386d8 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/codatfile.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, MultipartFormMetadata +import io +import pydantic +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CodatFileTypedDict(TypedDict): + content: Union[bytes, IO[bytes], io.BufferedReader] + file_name: str + content_type: NotRequired[str] + + +class CodatFile(BaseModel): + content: Annotated[ + Union[bytes, IO[bytes], io.BufferedReader], + pydantic.Field(alias=""), + FieldMetadata(multipart=MultipartFormMetadata(content=True)), + ] + + file_name: Annotated[ + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) + ] + + content_type: Annotated[ + Optional[str], + pydantic.Field(alias="Content-Type"), + FieldMetadata(multipart=True), + ] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companies.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companies.py new file mode 100644 index 000000000..4c1d4fb55 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companies.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .company import Company, CompanyTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompaniesTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[CompanyTypedDict]] + + +class Companies(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Company]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/company.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/company.py new file mode 100644 index 000000000..ae116c738 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/company.py @@ -0,0 +1,216 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from .connection import Connection, ConnectionTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompanyTypedDict(TypedDict): + r"""In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + + Typically each company is one of your customers. + + When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + """ + + id: str + r"""Unique identifier for your SMB in Codat.""" + name: str + r"""The name of the company""" + redirect: str + r"""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.""" + created: 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. + """ + created_by_user_name: NotRequired[Nullable[str]] + r"""Name of user that created the company in Codat.""" + data_connections: NotRequired[List[ConnectionTypedDict]] + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + last_sync: 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. + """ + products: NotRequired[List[str]] + r"""An array of products that are currently enabled for the company.""" + reference_parent_company: NotRequired[CompanyReferenceTypedDict] + reference_subsidiary_companies: NotRequired[List[CompanyReferenceTypedDict]] + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class Company(BaseModel): + r"""In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + + Typically each company is one of your customers. + + When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + """ + + id: str + r"""Unique identifier for your SMB in Codat.""" + + name: str + r"""The name of the company""" + + redirect: str + r"""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.""" + + created: Optional[str] = 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. + """ + + created_by_user_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="createdByUserName") + ] = UNSET + r"""Name of user that created the company in Codat.""" + + data_connections: Annotated[ + Optional[List[Connection]], pydantic.Field(alias="dataConnections") + ] = None + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = 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. + """ + + products: Optional[List[str]] = None + r"""An array of products that are currently enabled for the company.""" + + reference_parent_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceParentCompany") + ] = None + + reference_subsidiary_companies: Annotated[ + Optional[List[CompanyReference]], + pydantic.Field(alias="referenceSubsidiaryCompanies"), + ] = None + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + + 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 = [ + "created", + "createdByUserName", + "dataConnections", + "description", + "lastSync", + "products", + "referenceParentCompany", + "referenceSubsidiaryCompanies", + "tags", + ] + nullable_fields = ["createdByUserName"] + 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-expenses/src/codat_sync_for_expenses/models/shared/companyconfiguration.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyconfiguration.py new file mode 100644 index 000000000..09ba23e4a --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyconfiguration.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .bankaccountdetails import BankAccountDetails, BankAccountDetailsTypedDict +from .customerdetails import CustomerDetails, CustomerDetailsTypedDict +from .supplierdetails import SupplierDetails, SupplierDetailsTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class CompanyConfigurationTypedDict(TypedDict): + bank_account: BankAccountDetailsTypedDict + customer: CustomerDetailsTypedDict + supplier: SupplierDetailsTypedDict + + +class CompanyConfiguration(BaseModel): + bank_account: Annotated[BankAccountDetails, pydantic.Field(alias="bankAccount")] + + customer: CustomerDetails + + supplier: SupplierDetails diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyinformation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyinformation.py new file mode 100644 index 000000000..538a7abba --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyinformation.py @@ -0,0 +1,457 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountingaddresstype import AccountingAddressType +from .phonenumbertype import PhoneNumberType +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingAddressTypedDict(TypedDict): + type: AccountingAddressType + r"""The type of the address""" + city: NotRequired[Nullable[str]] + r"""City of the customer address.""" + country: NotRequired[Nullable[str]] + r"""Country of the customer address.""" + line1: NotRequired[Nullable[str]] + r"""Line 1 of the customer address.""" + line2: NotRequired[Nullable[str]] + r"""Line 2 of the customer address.""" + postal_code: NotRequired[Nullable[str]] + r"""Postal code or zip code.""" + region: NotRequired[Nullable[str]] + r"""Region of the customer address.""" + + +class AccountingAddress(BaseModel): + type: AccountingAddressType + r"""The type of the address""" + + city: OptionalNullable[str] = UNSET + r"""City of the customer address.""" + + country: OptionalNullable[str] = UNSET + r"""Country of the customer address.""" + + line1: OptionalNullable[str] = UNSET + r"""Line 1 of the customer address.""" + + line2: OptionalNullable[str] = UNSET + r"""Line 2 of the customer address.""" + + postal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="postalCode") + ] = UNSET + r"""Postal code or zip code.""" + + region: OptionalNullable[str] = UNSET + r"""Region of the customer address.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["city", "country", "line1", "line2", "postalCode", "region"] + nullable_fields = ["city", "country", "line1", "line2", "postalCode", "region"] + 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 + + +class PhoneTypedDict(TypedDict): + type: PhoneNumberType + r"""The type of phone number""" + number: NotRequired[Nullable[str]] + r"""A phone number.""" + + +class Phone(BaseModel): + type: PhoneNumberType + r"""The type of phone number""" + + number: OptionalNullable[str] = UNSET + r"""A phone number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["number"] + nullable_fields = ["number"] + 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 + + +class CompanyInformationType(str, Enum): + r"""The type of the weblink.""" + + WEBSITE = "Website" + SOCIAL = "Social" + UNKNOWN = "Unknown" + + +class WeblinkTypedDict(TypedDict): + r"""Weblink associated with the company.""" + + type: NotRequired[CompanyInformationType] + r"""The type of the weblink.""" + url: NotRequired[str] + r"""The full URL for the weblink.""" + + +class Weblink(BaseModel): + r"""Weblink associated with the company.""" + + type: Optional[CompanyInformationType] = None + r"""The type of the weblink.""" + + url: Optional[str] = None + r"""The full URL for the weblink.""" + + +class CompanyInformationTypedDict(TypedDict): + r"""Company info provides standard details about a linked company such as their address, phone number, and company registration. + + > **Company information or companies?** + > + > Company information is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + """ + + accounting_platform_ref: NotRequired[Nullable[str]] + r"""Identifier or reference for the company in the accounting software.""" + addresses: NotRequired[Nullable[List[AccountingAddressTypedDict]]] + r"""An array of Addresses.""" + base_currency: NotRequired[Nullable[str]] + r"""Currency set in the accounting software of the linked company. Used by the currency rate.""" + company_legal_name: NotRequired[Nullable[str]] + r"""Registered legal name of the linked company.""" + company_name: NotRequired[Nullable[str]] + r"""Name of the linked company.""" + created_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + financial_year_start_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + ledger_lock_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + phone_numbers: NotRequired[Nullable[List[PhoneTypedDict]]] + r"""An array of phone numbers.""" + registration_number: NotRequired[Nullable[str]] + r"""Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House.""" + source_urls: NotRequired[Nullable[Dict[str, str]]] + r"""URL addresses for the accounting source. + + For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + """ + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + tax_number: NotRequired[Nullable[str]] + r"""Company tax number.""" + web_links: NotRequired[Nullable[List[WeblinkTypedDict]]] + r"""An array of weblinks.""" + + +class CompanyInformation(BaseModel): + r"""Company info provides standard details about a linked company such as their address, phone number, and company registration. + + > **Company information or companies?** + > + > Company information is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + """ + + accounting_platform_ref: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountingPlatformRef") + ] = UNSET + r"""Identifier or reference for the company in the accounting software.""" + + addresses: OptionalNullable[List[AccountingAddress]] = UNSET + r"""An array of Addresses.""" + + base_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="baseCurrency") + ] = UNSET + r"""Currency set in the accounting software of the linked company. Used by the currency rate.""" + + company_legal_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="companyLegalName") + ] = UNSET + r"""Registered legal name of the linked company.""" + + company_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="companyName") + ] = UNSET + r"""Name of the linked company.""" + + created_date: Annotated[Optional[str], pydantic.Field(alias="createdDate")] = 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. + """ + + financial_year_start_date: Annotated[ + Optional[str], pydantic.Field(alias="financialYearStartDate") + ] = 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. + """ + + ledger_lock_date: Annotated[ + Optional[str], pydantic.Field(alias="ledgerLockDate") + ] = 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. + """ + + phone_numbers: Annotated[ + OptionalNullable[List[Phone]], pydantic.Field(alias="phoneNumbers") + ] = UNSET + r"""An array of phone numbers.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House.""" + + source_urls: Annotated[ + OptionalNullable[Dict[str, str]], pydantic.Field(alias="sourceUrls") + ] = UNSET + r"""URL addresses for the accounting source. + + For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + """ + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Company tax number.""" + + web_links: Annotated[ + OptionalNullable[List[Weblink]], pydantic.Field(alias="webLinks") + ] = UNSET + r"""An array of weblinks.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountingPlatformRef", + "addresses", + "baseCurrency", + "companyLegalName", + "companyName", + "createdDate", + "financialYearStartDate", + "ledgerLockDate", + "phoneNumbers", + "registrationNumber", + "sourceUrls", + "supplementalData", + "taxNumber", + "webLinks", + ] + nullable_fields = [ + "accountingPlatformRef", + "addresses", + "baseCurrency", + "companyLegalName", + "companyName", + "phoneNumbers", + "registrationNumber", + "sourceUrls", + "taxNumber", + "webLinks", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/companyreference.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyreference.py new file mode 100644 index 000000000..56f647a16 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyreference.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompanyReferenceLinksTypedDict(TypedDict): + r"""A collection of links for the company.""" + + portal: NotRequired[str] + r"""Link to the company page in the portal.""" + + +class CompanyReferenceLinks(BaseModel): + r"""A collection of links for the company.""" + + portal: Optional[str] = None + r"""Link to the company page in the portal.""" + + +class CompanyReferenceTypedDict(TypedDict): + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + links: NotRequired[CompanyReferenceLinksTypedDict] + r"""A collection of links for the company.""" + name: NotRequired[str] + r"""The name of the company""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyReference(BaseModel): + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + id: Optional[str] = None + r"""Unique identifier for your SMB in Codat.""" + + links: Optional[CompanyReferenceLinks] = None + r"""A collection of links for the company.""" + + name: Optional[str] = None + r"""The name of the company""" + + tags: Optional[Dict[str, str]] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyrequestbody.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyrequestbody.py new file mode 100644 index 000000000..0b0199996 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companyrequestbody.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompanyRequestBodyTypedDict(TypedDict): + name: 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 CompanyRequestBody(BaseModel): + name: str + 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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companysyncstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companysyncstatus.py new file mode 100644 index 000000000..ad5be8af1 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/companysyncstatus.py @@ -0,0 +1,152 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.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 CompanySyncStatusTypedDict(TypedDict): + company_id: NotRequired[Nullable[str]] + r"""Unique identifier for your SMB in Codat.""" + data_pushed: NotRequired[bool] + r"""Boolean of whether the sync resulted in data being pushed.""" + error_message: NotRequired[Nullable[str]] + r"""Error message of the sync.""" + sync_exception_message: NotRequired[Nullable[str]] + r"""Exception message of the sync.""" + sync_id: NotRequired[Nullable[str]] + r"""Unique identifier of the sync.""" + sync_status: NotRequired[Nullable[str]] + r"""Text status of the sync.""" + sync_status_code: NotRequired[int] + r"""Status code of the sync.""" + sync_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 CompanySyncStatus(BaseModel): + company_id: Annotated[OptionalNullable[str], pydantic.Field(alias="companyId")] = ( + UNSET + ) + r"""Unique identifier for your SMB in Codat.""" + + data_pushed: Annotated[Optional[bool], pydantic.Field(alias="dataPushed")] = None + r"""Boolean of whether the sync resulted in data being pushed.""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""Error message of the sync.""" + + sync_exception_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="syncExceptionMessage") + ] = UNSET + r"""Exception message of the sync.""" + + sync_id: Annotated[OptionalNullable[str], pydantic.Field(alias="syncId")] = UNSET + r"""Unique identifier of the sync.""" + + sync_status: Annotated[ + OptionalNullable[str], pydantic.Field(alias="syncStatus") + ] = UNSET + r"""Text status of the sync.""" + + sync_status_code: Annotated[ + Optional[int], pydantic.Field(alias="syncStatusCode") + ] = None + r"""Status code of the sync.""" + + sync_utc: Annotated[Optional[str], pydantic.Field(alias="syncUtc")] = 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 = [ + "companyId", + "dataPushed", + "errorMessage", + "syncExceptionMessage", + "syncId", + "syncStatus", + "syncStatusCode", + "syncUtc", + ] + nullable_fields = [ + "companyId", + "errorMessage", + "syncExceptionMessage", + "syncId", + "syncStatus", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/connection.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/connection.py new file mode 100644 index 000000000..ab894af1d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/connection.py @@ -0,0 +1,225 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .dataconnectionerror import DataConnectionError, DataConnectionErrorTypedDict +from .dataconnectionstatus import DataConnectionStatus +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SourceType(str, Enum): + r"""The type of platform of the connection.""" + + ACCOUNTING = "Accounting" + BANKING = "Banking" + BANK_FEED = "BankFeed" + COMMERCE = "Commerce" + EXPENSE = "Expense" + OTHER = "Other" + UNKNOWN = "Unknown" + + +class ConnectionTypedDict(TypedDict): + r"""A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + created: 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. + """ + id: str + r"""Unique identifier for a company's data connection.""" + integration_id: str + r"""A Codat ID representing the integration.""" + integration_key: str + r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" + link_url: str + r"""The link URL your customers can use to authorize access to their business application.""" + platform_name: str + r"""Name of integration connected to company.""" + source_id: str + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + source_type: SourceType + r"""The type of platform of the connection.""" + status: DataConnectionStatus + r"""The current authorization status of the data connection.""" + connection_info: NotRequired[Nullable[Dict[str, str]]] + data_connection_errors: NotRequired[Nullable[List[DataConnectionErrorTypedDict]]] + last_sync: 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 Connection(BaseModel): + r"""A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + created: 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. + """ + + id: str + r"""Unique identifier for a company's data connection.""" + + integration_id: Annotated[str, pydantic.Field(alias="integrationId")] + r"""A Codat ID representing the integration.""" + + integration_key: Annotated[str, pydantic.Field(alias="integrationKey")] + r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" + + link_url: Annotated[str, pydantic.Field(alias="linkUrl")] + r"""The link URL your customers can use to authorize access to their business application.""" + + platform_name: Annotated[str, pydantic.Field(alias="platformName")] + r"""Name of integration connected to company.""" + + source_id: Annotated[str, pydantic.Field(alias="sourceId")] + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + + source_type: Annotated[SourceType, pydantic.Field(alias="sourceType")] + r"""The type of platform of the connection.""" + + status: DataConnectionStatus + r"""The current authorization status of the data connection.""" + + connection_info: Annotated[ + OptionalNullable[Dict[str, str]], pydantic.Field(alias="connectionInfo") + ] = UNSET + + data_connection_errors: Annotated[ + OptionalNullable[List[DataConnectionError]], + pydantic.Field(alias="dataConnectionErrors"), + ] = UNSET + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = 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 = ["connectionInfo", "dataConnectionErrors", "lastSync"] + nullable_fields = ["connectionInfo", "dataConnectionErrors"] + 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-expenses/src/codat_sync_for_expenses/models/shared/connections.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/connections.py new file mode 100644 index 000000000..6b4d52560 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/connections.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connection import Connection, ConnectionTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[ConnectionTypedDict]] + + +class Connections(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Connection]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/contact.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/contact.py new file mode 100644 index 000000000..15fefadb0 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/contact.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .customerstatus import CustomerStatus +from .items import Items, ItemsTypedDict +from .phonenumber_items import PhoneNumberItems, PhoneNumberItemsTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ContactTypedDict(TypedDict): + status: CustomerStatus + r"""Status of customer.""" + address: NotRequired[ItemsTypedDict] + email: NotRequired[Nullable[str]] + r"""Email of a contact for a customer.""" + modified_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + name: NotRequired[Nullable[str]] + r"""Name of a contact for a customer.""" + phone: NotRequired[Nullable[List[PhoneNumberItemsTypedDict]]] + r"""An array of Phone numbers.""" + + +class Contact(BaseModel): + status: CustomerStatus + r"""Status of customer.""" + + address: Optional[Items] = None + + email: OptionalNullable[str] = UNSET + r"""Email of a contact for a customer.""" + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + name: OptionalNullable[str] = UNSET + r"""Name of a contact for a customer.""" + + phone: OptionalNullable[List[PhoneNumberItems]] = UNSET + r"""An array of Phone numbers.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["address", "email", "modifiedDate", "name", "phone"] + nullable_fields = ["email", "name", "phone"] + 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-expenses/src/codat_sync_for_expenses/models/shared/createaccountresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createaccountresponse.py new file mode 100644 index 000000000..5492e43f4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createaccountresponse.py @@ -0,0 +1,656 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .datatype import DataType +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class CreateAccountResponseMetadataTypedDict(TypedDict): + is_deleted: NotRequired[Nullable[bool]] + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + +class CreateAccountResponseMetadata(BaseModel): + is_deleted: Annotated[OptionalNullable[bool], pydantic.Field(alias="isDeleted")] = ( + UNSET + ) + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["isDeleted"] + nullable_fields = ["isDeleted"] + 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 + + +class CreateAccountResponseValidDataTypeLinksTypedDict(TypedDict): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: NotRequired[Nullable[List[str]]] + r"""Supported `dataTypes` that the record can be linked to.""" + property: NotRequired[Nullable[str]] + r"""The property from the account that can be linked.""" + + +class CreateAccountResponseValidDataTypeLinks(BaseModel): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: OptionalNullable[List[str]] = UNSET + r"""Supported `dataTypes` that the record can be linked to.""" + + property: OptionalNullable[str] = UNSET + r"""The property from the account that can be linked.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["links", "property"] + nullable_fields = ["links", "property"] + 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 + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingAccountTypedDict(TypedDict): + r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + + ## Overview + + Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + + The categories for an account include: + * Asset + * Expense + * Income + * Liability + * Equity. + + The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + + At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + + To determine the list of allowed categories for a specific integration, you can: + - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + - Refer to the integration's own documentation. + + > **Accounts with no category** + > + > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + > + > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + """ + + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + current_balance: NotRequired[Nullable[Decimal]] + r"""Current balance in the account.""" + description: NotRequired[Nullable[str]] + r"""Description for the account.""" + fully_qualified_category: NotRequired[Nullable[str]] + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + fully_qualified_name: NotRequired[Nullable[str]] + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + id: NotRequired[str] + r"""Identifier for the account, unique for the company.""" + is_bank_account: NotRequired[bool] + r"""Confirms whether the account is a bank account or not.""" + metadata: NotRequired[CreateAccountResponseMetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Name of the account.""" + nominal_code: NotRequired[Nullable[str]] + r"""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.""" + source_modified_date: NotRequired[str] + status: NotRequired[AccountStatus] + r"""Status of the account""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + type: NotRequired[AccountType] + r"""Type of account""" + valid_datatype_links: NotRequired[ + Nullable[List[CreateAccountResponseValidDataTypeLinksTypedDict]] + ] + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks).""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingAccount(BaseModel): + r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + + ## Overview + + Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + + The categories for an account include: + * Asset + * Expense + * Income + * Liability + * Equity. + + The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + + At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + + To determine the list of allowed categories for a specific integration, you can: + - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + - Refer to the integration's own documentation. + + > **Accounts with no category** + > + > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + > + > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + current_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currentBalance"), + ] = UNSET + r"""Current balance in the account.""" + + description: OptionalNullable[str] = UNSET + r"""Description for the account.""" + + fully_qualified_category: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedCategory") + ] = UNSET + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + + fully_qualified_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedName") + ] = UNSET + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + + id: Optional[str] = None + r"""Identifier for the account, unique for the company.""" + + is_bank_account: Annotated[ + Optional[bool], pydantic.Field(alias="isBankAccount") + ] = None + r"""Confirms whether the account is a bank account or not.""" + + metadata: Optional[CreateAccountResponseMetadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Name of the account.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""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.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[AccountStatus] = None + r"""Status of the account""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + type: Optional[AccountType] = None + r"""Type of account""" + + valid_datatype_links: Annotated[ + OptionalNullable[List[CreateAccountResponseValidDataTypeLinks]], + pydantic.Field(alias="validDatatypeLinks"), + ] = UNSET + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "currency", + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "id", + "isBankAccount", + "metadata", + "modifiedDate", + "name", + "nominalCode", + "sourceModifiedDate", + "status", + "supplementalData", + "type", + "validDatatypeLinks", + ] + nullable_fields = [ + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "name", + "nominalCode", + "validDatatypeLinks", + ] + 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 + + +class CreateAccountResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data: NotRequired[Nullable[AccountingAccountTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateAccountResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data: OptionalNullable[AccountingAccount] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/createbankaccountresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createbankaccountresponse.py new file mode 100644 index 000000000..7e2fb0f98 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createbankaccountresponse.py @@ -0,0 +1,510 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .bankaccountstatus import BankAccountStatus +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class CreateBankAccountResponseBankAccountType(str, Enum): + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + UNKNOWN = "Unknown" + CREDIT = "Credit" + DEBIT = "Debit" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBankAccountTypedDict(TypedDict): + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting software. + * The currency and balance of the account. + * The sort code and account number. + """ + + account_name: NotRequired[Nullable[str]] + r"""Name of the bank account in the accounting software.""" + account_number: NotRequired[Nullable[str]] + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + account_type: NotRequired[CreateBankAccountResponseBankAccountType] + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + available_balance: NotRequired[Nullable[Decimal]] + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + balance: NotRequired[Nullable[Decimal]] + r"""Balance of the bank account.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + i_ban: NotRequired[Nullable[str]] + r"""International bank account number of the account. Often used when making or receiving international payments.""" + id: NotRequired[str] + r"""Identifier for the account, unique for the company in the accounting software.""" + institution: NotRequired[Nullable[str]] + r"""The institution of the bank account.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + nominal_code: NotRequired[Nullable[str]] + r"""Code used to identify each nominal account for a business.""" + overdraft_limit: NotRequired[Nullable[Decimal]] + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + sort_code: NotRequired[Nullable[str]] + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + source_modified_date: NotRequired[str] + status: NotRequired[BankAccountStatus] + r"""Status of the bank account.""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBankAccount(BaseModel): + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting software. + * The currency and balance of the account. + * The sort code and account number. + """ + + account_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountName") + ] = UNSET + r"""Name of the bank account in the accounting software.""" + + account_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountNumber") + ] = UNSET + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + + account_type: Annotated[ + Optional[CreateBankAccountResponseBankAccountType], + pydantic.Field(alias="accountType"), + ] = None + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + available_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="availableBalance"), + ] = UNSET + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + + balance: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""Balance of the bank account.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + i_ban: Annotated[OptionalNullable[str], pydantic.Field(alias="iBan")] = UNSET + r"""International bank account number of the account. Often used when making or receiving international payments.""" + + id: Optional[str] = None + r"""Identifier for the account, unique for the company in the accounting software.""" + + institution: OptionalNullable[str] = UNSET + r"""The institution of the bank account.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Code used to identify each nominal account for a business.""" + + overdraft_limit: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="overdraftLimit"), + ] = UNSET + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[BankAccountStatus] = None + r"""Status of the bank account.""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountName", + "accountNumber", + "accountType", + "availableBalance", + "balance", + "currency", + "iBan", + "id", + "institution", + "metadata", + "modifiedDate", + "nominalCode", + "overdraftLimit", + "sortCode", + "sourceModifiedDate", + "status", + "supplementalData", + ] + nullable_fields = [ + "accountName", + "accountNumber", + "availableBalance", + "balance", + "iBan", + "institution", + "nominalCode", + "overdraftLimit", + "sortCode", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateBankAccountResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data: NotRequired[Nullable[AccountingBankAccountTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateBankAccountResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data: OptionalNullable[AccountingBankAccount] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/createcustomerresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createcustomerresponse.py new file mode 100644 index 000000000..f4c5bd908 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createcustomerresponse.py @@ -0,0 +1,415 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contact import Contact, ContactTypedDict +from .customerstatus import CustomerStatus +from .datatype import DataType +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingCustomerTypedDict(TypedDict): + r"""## Overview + + A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + + Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + """ + + status: CustomerStatus + r"""Status of customer.""" + addresses: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the identified customer.""" + contacts: NotRequired[Nullable[List[ContactTypedDict]]] + r"""An array of Contacts.""" + customer_name: NotRequired[Nullable[str]] + r"""Name of the customer as recorded in the accounting system, typically the company name.""" + default_currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + email_address: NotRequired[Nullable[str]] + r"""Email address the customer can be contacted by.""" + id: NotRequired[str] + r"""Identifier for the customer, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number the customer can be contacted by.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number. In the UK, this is typically the Companies House company registration number.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + tax_number: NotRequired[Nullable[str]] + r"""Company tax number.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingCustomer(BaseModel): + r"""## Overview + + A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + + Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + """ + + status: CustomerStatus + r"""Status of customer.""" + + addresses: OptionalNullable[List[Items]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the identified customer.""" + + contacts: OptionalNullable[List[Contact]] = UNSET + r"""An array of Contacts.""" + + customer_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="customerName") + ] = UNSET + r"""Name of the customer as recorded in the accounting system, typically the company name.""" + + default_currency: Annotated[ + Optional[str], pydantic.Field(alias="defaultCurrency") + ] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address the customer can be contacted by.""" + + id: Optional[str] = None + r"""Identifier for the customer, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number the customer can be contacted by.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number. In the UK, this is typically the Companies House company registration number.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "contacts", + "customerName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "contacts", + "customerName", + "emailAddress", + "phone", + "registrationNumber", + "taxNumber", + ] + 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 + + +class CreateCustomerResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data: NotRequired[Nullable[AccountingCustomerTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateCustomerResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data: OptionalNullable[AccountingCustomer] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/createexpenseresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createexpenseresponse.py new file mode 100644 index 000000000..ffc870a9f --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createexpenseresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateExpenseResponseTypedDict(TypedDict): + sync_id: NotRequired[str] + r"""Unique id of sync created""" + + +class CreateExpenseResponse(BaseModel): + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique id of sync created""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createreimbursableexpenseresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createreimbursableexpenseresponse.py new file mode 100644 index 000000000..c89692011 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createreimbursableexpenseresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateReimbursableExpenseResponseTypedDict(TypedDict): + sync_id: NotRequired[str] + r"""Unique id of sync created""" + + +class CreateReimbursableExpenseResponse(BaseModel): + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique id of sync created""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createsupplierresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createsupplierresponse.py new file mode 100644 index 000000000..292ff3d13 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/createsupplierresponse.py @@ -0,0 +1,388 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierstatus import SupplierStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingSupplierTypedDict(TypedDict): + r"""## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + addresses: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the supplier.""" + default_currency: NotRequired[Nullable[str]] + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: NotRequired[Nullable[str]] + r"""Email address that the supplier may be contacted on.""" + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number that the supplier may be contacted on.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_name: NotRequired[Nullable[str]] + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: NotRequired[Nullable[str]] + r"""Supplier's company tax number.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingSupplier(BaseModel): + r"""## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + + addresses: OptionalNullable[List[Items]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the supplier.""" + + default_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="defaultCurrency") + ] = UNSET + r"""Default currency the supplier's transactional data is recorded in.""" + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address that the supplier may be contacted on.""" + + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number that the supplier may be contacted on.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Supplier's company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "supplierName", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "phone", + "registrationNumber", + "supplierName", + "taxNumber", + ] + 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 + + +class CreateSupplierResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data: NotRequired[Nullable[AccountingSupplierTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateSupplierResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data: OptionalNullable[AccountingSupplier] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/customer.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customer.py new file mode 100644 index 000000000..a398c1dbc --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customer.py @@ -0,0 +1,199 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contact import Contact, ContactTypedDict +from .customerstatus import CustomerStatus +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CustomerTypedDict(TypedDict): + r"""## Overview + + A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + + Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + """ + + status: CustomerStatus + r"""Status of customer.""" + addresses: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the identified customer.""" + contacts: NotRequired[Nullable[List[ContactTypedDict]]] + r"""An array of Contacts.""" + customer_name: NotRequired[Nullable[str]] + r"""Name of the customer as recorded in the accounting system, typically the company name.""" + default_currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + email_address: NotRequired[Nullable[str]] + r"""Email address the customer can be contacted by.""" + id: NotRequired[str] + r"""Identifier for the customer, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number the customer can be contacted by.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number. In the UK, this is typically the Companies House company registration number.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + tax_number: NotRequired[Nullable[str]] + r"""Company tax number.""" + + +class Customer(BaseModel): + r"""## Overview + + A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + + Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + """ + + status: CustomerStatus + r"""Status of customer.""" + + addresses: OptionalNullable[List[Items]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the identified customer.""" + + contacts: OptionalNullable[List[Contact]] = UNSET + r"""An array of Contacts.""" + + customer_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="customerName") + ] = UNSET + r"""Name of the customer as recorded in the accounting system, typically the company name.""" + + default_currency: Annotated[ + Optional[str], pydantic.Field(alias="defaultCurrency") + ] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address the customer can be contacted by.""" + + id: Optional[str] = None + r"""Identifier for the customer, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number the customer can be contacted by.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number. In the UK, this is typically the Companies House company registration number.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "contacts", + "customerName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "contacts", + "customerName", + "emailAddress", + "phone", + "registrationNumber", + "taxNumber", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/customerdetails.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customerdetails.py new file mode 100644 index 000000000..eca6cfdcf --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customerdetails.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CustomerDetailsTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier for the customer, unique to the company in the accounting software.""" + + +class CustomerDetails(BaseModel): + id: Optional[str] = None + r"""Identifier for the customer, unique to the company in the accounting software.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customers.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customers.py new file mode 100644 index 000000000..2d6e72ea6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customers.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .customer import Customer, CustomerTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CustomersTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[CustomerTypedDict]] + + +class Customers(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Customer]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customerstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customerstatus.py new file mode 100644 index 000000000..1e060f7bd --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/customerstatus.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class CustomerStatus(str, Enum): + r"""Status of customer.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/dataconnectionerror.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/dataconnectionerror.py new file mode 100644 index 000000000..b13cb566f --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/dataconnectionerror.py @@ -0,0 +1,174 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + 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 ErrorStatus(str, Enum): + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + + ACTIVE = "Active" + RESOLVED = "Resolved" + + +class DataConnectionErrorTypedDict(TypedDict): + error_message: NotRequired[str] + r"""A message about a error returned by Codat.""" + errored_on_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. + """ + resolved_on_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. + """ + status: NotRequired[Nullable[ErrorStatus]] + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + status_code: NotRequired[str] + r"""The HTTP status code returned by the source platform when the error occurred.""" + status_text: NotRequired[str] + r"""A non-numeric status code/text returned by the source platform when the error occurred.""" + + +class DataConnectionError(BaseModel): + error_message: Annotated[Optional[str], pydantic.Field(alias="errorMessage")] = None + r"""A message about a error returned by Codat.""" + + errored_on_utc: Annotated[Optional[str], pydantic.Field(alias="erroredOnUtc")] = ( + 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. + """ + + resolved_on_utc: Annotated[Optional[str], pydantic.Field(alias="resolvedOnUtc")] = ( + 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. + """ + + status: OptionalNullable[ErrorStatus] = UNSET + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + + status_code: Annotated[Optional[str], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by the source platform when the error occurred.""" + + status_text: Annotated[Optional[str], pydantic.Field(alias="statusText")] = None + r"""A non-numeric status code/text returned by the source platform when the error occurred.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "errorMessage", + "erroredOnUtc", + "resolvedOnUtc", + "status", + "statusCode", + "statusText", + ] + nullable_fields = ["status"] + 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-expenses/src/codat_sync_for_expenses/models/shared/dataconnectionstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/dataconnectionstatus.py new file mode 100644 index 000000000..a97f7be30 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/dataconnectionstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class DataConnectionStatus(str, Enum): + r"""The current authorization status of the data connection.""" + + PENDING_AUTH = "PendingAuth" + LINKED = "Linked" + UNLINKED = "Unlinked" + DEAUTHORIZED = "Deauthorized" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/datastatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/datastatus.py new file mode 100644 index 000000000..051f0d1b5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/datastatus.py @@ -0,0 +1,133 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .status import Status +from codat_sync_for_expenses.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataTypes(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" + + +class DataStatusTypedDict(TypedDict): + r"""Describes the state of data in the Codat cache for a company and data type""" + + current_status: Status + r"""The current status of the dataset.""" + data_type: DataTypes + r"""Available data types""" + last_successful_sync: 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. + """ + latest_successful_sync_id: NotRequired[str] + r"""Unique identifier for the most recent successful sync of data type.""" + latest_sync_id: NotRequired[str] + r"""Unique identifier for most recent sync of data type.""" + + +class DataStatus(BaseModel): + r"""Describes the state of data in the Codat cache for a company and data type""" + + current_status: Annotated[Status, pydantic.Field(alias="currentStatus")] + r"""The current status of the dataset.""" + + data_type: Annotated[DataTypes, pydantic.Field(alias="dataType")] + r"""Available data types""" + + last_successful_sync: Annotated[str, pydantic.Field(alias="lastSuccessfulSync")] + 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. + """ + + latest_successful_sync_id: Annotated[ + Optional[str], pydantic.Field(alias="latestSuccessfulSyncId") + ] = None + r"""Unique identifier for the most recent successful sync of data type.""" + + latest_sync_id: Annotated[Optional[str], pydantic.Field(alias="latestSyncId")] = ( + None + ) + r"""Unique identifier for most recent sync of data type.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/datatype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/datatype.py new file mode 100644 index 000000000..e0aff6fb8 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/datatype.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class DataType(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/errorvalidation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/errorvalidation.py new file mode 100644 index 000000000..9b3823907 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/errorvalidation.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ErrorValidationTypedDict(TypedDict): + 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.""" + + errors: NotRequired[Nullable[List[ErrorValidationItemTypedDict]]] + warnings: NotRequired[Nullable[List[ErrorValidationItemTypedDict]]] + + +class ErrorValidation(BaseModel): + 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.""" + + errors: OptionalNullable[List[ErrorValidationItem]] = UNSET + + warnings: OptionalNullable[List[ErrorValidationItem]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errors", "warnings"] + nullable_fields = ["errors", "warnings"] + 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-expenses/src/codat_sync_for_expenses/models/shared/errorvalidationitem.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/errorvalidationitem.py new file mode 100644 index 000000000..ac3b4f2f6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/errorvalidationitem.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ErrorValidationItemTypedDict(TypedDict): + item_id: NotRequired[Nullable[str]] + r"""Unique identifier for a validation item.""" + message: NotRequired[Nullable[str]] + r"""A message outlining validation item's issue.""" + validator_name: NotRequired[Nullable[str]] + r"""Name of validator.""" + + +class ErrorValidationItem(BaseModel): + item_id: Annotated[OptionalNullable[str], pydantic.Field(alias="itemId")] = UNSET + r"""Unique identifier for a validation item.""" + + message: OptionalNullable[str] = UNSET + r"""A message outlining validation item's issue.""" + + validator_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="validatorName") + ] = UNSET + r"""Name of validator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["itemId", "message", "validatorName"] + nullable_fields = ["itemId", "message", "validatorName"] + 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-expenses/src/codat_sync_for_expenses/models/shared/expensecontactref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensecontactref.py new file mode 100644 index 000000000..d6d3d2463 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensecontactref.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from enum import Enum +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class Type(str, Enum): + r"""The type of contact.""" + + SUPPLIER = "Supplier" + + +class ExpenseContactRefTypedDict(TypedDict): + id: str + r"""Identifier of supplier or customer.""" + type: NotRequired[Type] + r"""The type of contact.""" + + +class ExpenseContactRef(BaseModel): + id: str + r"""Identifier of supplier or customer.""" + + type: Optional[Type] = Type.SUPPLIER + r"""The type of contact.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensessyncwebhook.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensessyncwebhook.py new file mode 100644 index 000000000..806c4e27d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensessyncwebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .expensessyncwebhookpayload import ( + ExpensesSyncWebhookPayload, + ExpensesSyncWebhookPayloadTypedDict, +) +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ExpensesSyncWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[ExpensesSyncWebhookPayloadTypedDict] + + +class ExpensesSyncWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[ExpensesSyncWebhookPayload] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensessyncwebhookpayload.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensessyncwebhookpayload.py new file mode 100644 index 000000000..7f930d8ab --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensessyncwebhookpayload.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from .transaction import Transaction, TransactionTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ExpensesSyncWebhookPayloadTypedDict(TypedDict): + reference_company: NotRequired[CompanyReferenceTypedDict] + sync_id: NotRequired[str] + r"""Unique identifier of the sync.""" + transactions: NotRequired[List[TransactionTypedDict]] + + +class ExpensesSyncWebhookPayload(BaseModel): + reference_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceCompany") + ] = None + + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique identifier of the sync.""" + + transactions: Optional[List[Transaction]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensetransaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensetransaction.py new file mode 100644 index 000000000..963ee77a6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensetransaction.py @@ -0,0 +1,258 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .expensecontactref import ExpenseContactRef, ExpenseContactRefTypedDict +from .expensetransactionline import ( + ExpenseTransactionLine, + ExpenseTransactionLineTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BankAccountReferenceTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier of the bank account.""" + + +class BankAccountReference(BaseModel): + id: Optional[str] = None + r"""Identifier of the bank account.""" + + +class ExpenseTransactionType(str, Enum): + r"""The type of transaction.""" + + PAYMENT = "Payment" + REFUND = "Refund" + REWARD = "Reward" + CHARGEBACK = "Chargeback" + + +class ExpenseTransactionTypedDict(TypedDict): + currency: str + r"""Currency the transaction was recorded in.""" + id: str + r"""Your unique identifier for the transaction.""" + issue_date: 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. + """ + type: ExpenseTransactionType + r"""The type of transaction.""" + bank_account_ref: NotRequired[BankAccountReferenceTypedDict] + contact_ref: NotRequired[ExpenseContactRefTypedDict] + currency_rate: NotRequired[Nullable[Decimal]] + r"""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. | + """ + lines: NotRequired[List[ExpenseTransactionLineTypedDict]] + r"""Array of transaction lines.""" + merchant_name: NotRequired[str] + r"""Name of the merchant where the purchase took place""" + notes: NotRequired[str] + r"""Any private, company notes about the transaction.""" + post_as_draft: NotRequired[Nullable[bool]] + r"""This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central.""" + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the expense transaction.""" + + +class ExpenseTransaction(BaseModel): + currency: str + r"""Currency the transaction was recorded in.""" + + id: str + r"""Your unique identifier for the transaction.""" + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + 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. + """ + + type: ExpenseTransactionType + r"""The type of transaction.""" + + bank_account_ref: Annotated[ + Optional[BankAccountReference], pydantic.Field(alias="bankAccountRef") + ] = None + + contact_ref: Annotated[ + Optional[ExpenseContactRef], pydantic.Field(alias="contactRef") + ] = None + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""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. | + """ + + lines: Optional[List[ExpenseTransactionLine]] = None + r"""Array of transaction lines.""" + + merchant_name: Annotated[Optional[str], pydantic.Field(alias="merchantName")] = None + r"""Name of the merchant where the purchase took place""" + + notes: Optional[str] = None + r"""Any private, company notes about the transaction.""" + + post_as_draft: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="postAsDraft") + ] = UNSET + r"""This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central.""" + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the expense transaction.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "bankAccountRef", + "contactRef", + "currencyRate", + "lines", + "merchantName", + "notes", + "postAsDraft", + "reference", + ] + nullable_fields = ["currencyRate", "postAsDraft", "reference"] + 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-expenses/src/codat_sync_for_expenses/models/shared/expensetransactionline.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensetransactionline.py new file mode 100644 index 000000000..80dd53802 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/expensetransactionline.py @@ -0,0 +1,115 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .invoiceto import InvoiceTo, InvoiceToTypedDict +from .itemref import ItemRef, ItemRefTypedDict +from .recordref import RecordRef, RecordRefTypedDict +from .trackingref import TrackingRef, TrackingRefTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ExpenseTransactionLineTypedDict(TypedDict): + net_amount: Decimal + r"""Amount of the line, exclusive of tax.""" + account_ref: NotRequired[RecordRefTypedDict] + invoice_to: NotRequired[Nullable[InvoiceToTypedDict]] + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + item_ref: NotRequired[Nullable[ItemRefTypedDict]] + tax_amount: NotRequired[Decimal] + r"""Amount of tax for the line.""" + tax_rate_ref: NotRequired[RecordRefTypedDict] + tracking_refs: NotRequired[Nullable[List[TrackingRefTypedDict]]] + + +class ExpenseTransactionLine(BaseModel): + net_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="netAmount"), + ] + r"""Amount of the line, exclusive of tax.""" + + account_ref: Annotated[Optional[RecordRef], pydantic.Field(alias="accountRef")] = ( + None + ) + + invoice_to: Annotated[ + OptionalNullable[InvoiceTo], pydantic.Field(alias="invoiceTo") + ] = UNSET + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + + item_ref: Annotated[OptionalNullable[ItemRef], pydantic.Field(alias="itemRef")] = ( + UNSET + ) + + tax_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] = None + r"""Amount of tax for the line.""" + + tax_rate_ref: Annotated[Optional[RecordRef], pydantic.Field(alias="taxRateRef")] = ( + None + ) + + tracking_refs: Annotated[ + OptionalNullable[List[TrackingRef]], pydantic.Field(alias="trackingRefs") + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "invoiceTo", + "itemRef", + "taxAmount", + "taxRateRef", + "trackingRefs", + ] + nullable_fields = ["invoiceTo", "itemRef", "trackingRefs"] + 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-expenses/src/codat_sync_for_expenses/models/shared/halref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/halref.py new file mode 100644 index 000000000..c1d40904e --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/halref.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class HalRefTypedDict(TypedDict): + href: NotRequired[str] + r"""Uri hypertext reference.""" + + +class HalRef(BaseModel): + href: Optional[str] = None + r"""Uri hypertext reference.""" diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/integrationtype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/integrationtype.py similarity index 57% rename from sync-for-expenses/src/codatsyncexpenses/models/shared/integrationtype.py rename to sync-for-expenses/src/codat_sync_for_expenses/models/shared/integrationtype.py index bb8db2b2c..92c91ae17 100644 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/integrationtype.py +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/integrationtype.py @@ -1,9 +1,11 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations from enum import Enum + class IntegrationType(str, Enum): r"""Type of transaction that has been processed e.g. Expense or Bank Feed.""" - EXPENSES = 'expenses' - BANKFEEDS = 'bankfeeds' + + EXPENSES = "expenses" + BANKFEEDS = "bankfeeds" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/invoiceto.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/invoiceto.py new file mode 100644 index 000000000..d7c0beaa8 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/invoiceto.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from enum import Enum +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class InvoiceToType(str, Enum): + r"""The type of contact.""" + + CUSTOMER = "customer" + + +class InvoiceToTypedDict(TypedDict): + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + + id: NotRequired[str] + r"""identifier of customer.""" + type: NotRequired[InvoiceToType] + r"""The type of contact.""" + + +class InvoiceTo(BaseModel): + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + + id: Optional[str] = None + r"""identifier of customer.""" + + type: Optional[InvoiceToType] = None + r"""The type of contact.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/itemref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/itemref.py new file mode 100644 index 000000000..79c9ce136 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/itemref.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ItemRefTypedDict(TypedDict): + id: NotRequired[str] + r"""Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both.""" + + +class ItemRef(BaseModel): + id: Optional[str] = None + r"""Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/items.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/items.py new file mode 100644 index 000000000..b8e4cada4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/items.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountingaddresstype import AccountingAddressType +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ItemsTypedDict(TypedDict): + type: AccountingAddressType + r"""The type of the address""" + city: NotRequired[Nullable[str]] + r"""City of the customer address.""" + country: NotRequired[Nullable[str]] + r"""Country of the customer address.""" + line1: NotRequired[Nullable[str]] + r"""Line 1 of the customer address.""" + line2: NotRequired[Nullable[str]] + r"""Line 2 of the customer address.""" + postal_code: NotRequired[Nullable[str]] + r"""Postal code or zip code.""" + region: NotRequired[Nullable[str]] + r"""Region of the customer address.""" + + +class Items(BaseModel): + type: AccountingAddressType + r"""The type of the address""" + + city: OptionalNullable[str] = UNSET + r"""City of the customer address.""" + + country: OptionalNullable[str] = UNSET + r"""Country of the customer address.""" + + line1: OptionalNullable[str] = UNSET + r"""Line 1 of the customer address.""" + + line2: OptionalNullable[str] = UNSET + r"""Line 2 of the customer address.""" + + postal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="postalCode") + ] = UNSET + r"""Postal code or zip code.""" + + region: OptionalNullable[str] = UNSET + r"""Region of the customer address.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["city", "country", "line1", "line2", "postalCode", "region"] + nullable_fields = ["city", "country", "line1", "line2", "postalCode", "region"] + 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-expenses/src/codat_sync_for_expenses/models/shared/links.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/links.py new file mode 100644 index 000000000..fe42a7b1e --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/links.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .halref import HalRef, HalRefTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LinksTypedDict(TypedDict): + current: HalRefTypedDict + self_: HalRefTypedDict + next: NotRequired[HalRefTypedDict] + previous: NotRequired[HalRefTypedDict] + + +class Links(BaseModel): + current: HalRef + + self_: Annotated[HalRef, pydantic.Field(alias="self")] + + next: Optional[HalRef] = None + + previous: Optional[HalRef] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/mappingoptions.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/mappingoptions.py new file mode 100644 index 000000000..42f914cd1 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/mappingoptions.py @@ -0,0 +1,94 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountmappinginfo import AccountMappingInfo, AccountMappingInfoTypedDict +from .taxratemappinginfo import TaxRateMappingInfo, TaxRateMappingInfoTypedDict +from .trackingcategorymappinginfo import ( + TrackingCategoryMappingInfo, + TrackingCategoryMappingInfoTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MappingOptionsTypedDict(TypedDict): + accounts: NotRequired[Nullable[List[AccountMappingInfoTypedDict]]] + r"""Array of available accounts for mapping.""" + expense_provider: NotRequired[Nullable[str]] + r"""Name of the expense integration.""" + tax_rates: NotRequired[Nullable[List[TaxRateMappingInfoTypedDict]]] + r"""Array of available tax rates for mapping.""" + tracking_categories: NotRequired[ + Nullable[List[TrackingCategoryMappingInfoTypedDict]] + ] + r"""Array of available tracking categories for mapping.""" + + +class MappingOptions(BaseModel): + accounts: OptionalNullable[List[AccountMappingInfo]] = UNSET + r"""Array of available accounts for mapping.""" + + expense_provider: Annotated[ + OptionalNullable[str], pydantic.Field(alias="expenseProvider") + ] = UNSET + r"""Name of the expense integration.""" + + tax_rates: Annotated[ + OptionalNullable[List[TaxRateMappingInfo]], pydantic.Field(alias="taxRates") + ] = UNSET + r"""Array of available tax rates for mapping.""" + + tracking_categories: Annotated[ + OptionalNullable[List[TrackingCategoryMappingInfo]], + pydantic.Field(alias="trackingCategories"), + ] = UNSET + r"""Array of available tracking categories for mapping.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accounts", + "expenseProvider", + "taxRates", + "trackingCategories", + ] + nullable_fields = [ + "accounts", + "expenseProvider", + "taxRates", + "trackingCategories", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/metadata.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/metadata.py new file mode 100644 index 000000000..d67e08473 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/metadata.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MetadataTypedDict(TypedDict): + is_deleted: NotRequired[Nullable[bool]] + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + +class Metadata(BaseModel): + is_deleted: Annotated[OptionalNullable[bool], pydantic.Field(alias="isDeleted")] = ( + UNSET + ) + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["isDeleted"] + nullable_fields = ["isDeleted"] + 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-expenses/src/codat_sync_for_expenses/models/shared/phonenumber_items.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/phonenumber_items.py new file mode 100644 index 000000000..607434890 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/phonenumber_items.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .phonenumbertype import PhoneNumberType +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class PhoneNumberItemsTypedDict(TypedDict): + type: PhoneNumberType + r"""The type of phone number""" + number: NotRequired[Nullable[str]] + r"""A phone number.""" + + +class PhoneNumberItems(BaseModel): + type: PhoneNumberType + r"""The type of phone number""" + + number: OptionalNullable[str] = UNSET + r"""A phone number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["number"] + nullable_fields = ["number"] + 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-expenses/src/codat_sync_for_expenses/models/shared/phonenumbertype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/phonenumbertype.py new file mode 100644 index 000000000..a8b448eb0 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/phonenumbertype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PhoneNumberType(str, Enum): + r"""The type of phone number""" + + PRIMARY = "Primary" + LANDLINE = "Landline" + MOBILE = "Mobile" + FAX = "Fax" + UNKNOWN = "Unknown" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pulloperation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pulloperation.py new file mode 100644 index 000000000..c59250b7b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pulloperation.py @@ -0,0 +1,224 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + 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 DatasetStatus(str, Enum): + r"""The current status of the dataset.""" + + INITIAL = "Initial" + QUEUED = "Queued" + FETCHING = "Fetching" + MAP_QUEUED = "MapQueued" + MAPPING = "Mapping" + COMPLETE = "Complete" + FETCH_ERROR = "FetchError" + MAP_ERROR = "MapError" + INTERNAL_ERROR = "InternalError" + PROCESSING_QUEUED = "ProcessingQueued" + PROCESSING = "Processing" + PROCESSING_ERROR = "ProcessingError" + VALIDATION_QUEUED = "ValidationQueued" + VALIDATING = "Validating" + VALIDATION_ERROR = "ValidationError" + AUTH_ERROR = "AuthError" + CANCELLED = "Cancelled" + NOT_SUPPORTED = "NotSupported" + RATE_LIMIT_ERROR = "RateLimitError" + PERMISSIONS_ERROR = "PermissionsError" + PREREQUISITE_NOT_MET = "PrerequisiteNotMet" + + +class PullOperationTypedDict(TypedDict): + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + + company_id: str + r"""Unique identifier of the company associated to this pull operation.""" + connection_id: str + r"""Unique identifier of the connection associated to this pull operation.""" + data_type: str + r"""The data type you are requesting in a pull operation.""" + id: str + r"""Unique identifier of the pull operation.""" + is_completed: bool + r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" + is_errored: bool + r"""`True` if the pull operation entered an error state.""" + progress: int + r"""An integer signifying the progress of the pull operation.""" + requested: 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. + """ + status: DatasetStatus + r"""The current status of the dataset.""" + completed: 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. + """ + error_message: NotRequired[Nullable[str]] + r"""A message about a transient or persistent error returned by Codat or the source platform.""" + status_description: NotRequired[Nullable[str]] + r"""Additional information about the dataset status.""" + + +class PullOperation(BaseModel): + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier of the company associated to this pull operation.""" + + connection_id: Annotated[str, pydantic.Field(alias="connectionId")] + r"""Unique identifier of the connection associated to this pull operation.""" + + data_type: Annotated[str, pydantic.Field(alias="dataType")] + r"""The data type you are requesting in a pull operation.""" + + id: str + r"""Unique identifier of the pull operation.""" + + is_completed: Annotated[bool, pydantic.Field(alias="isCompleted")] + r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" + + is_errored: Annotated[bool, pydantic.Field(alias="isErrored")] + r"""`True` if the pull operation entered an error state.""" + + progress: int + r"""An integer signifying the progress of the pull operation.""" + + requested: 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. + """ + + status: DatasetStatus + r"""The current status of the dataset.""" + + completed: Optional[str] = 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. + """ + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about a transient or persistent error returned by Codat or the source platform.""" + + status_description: Annotated[ + OptionalNullable[str], pydantic.Field(alias="statusDescription") + ] = UNSET + r"""Additional information about the dataset status.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["completed", "errorMessage", "statusDescription"] + nullable_fields = ["errorMessage", "statusDescription"] + 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-expenses/src/codat_sync_for_expenses/models/shared/pulloperations.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pulloperations.py new file mode 100644 index 000000000..52a611462 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pulloperations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .pulloperation import PullOperation, PullOperationTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PullOperationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PullOperationTypedDict]] + + +class PullOperations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PullOperation]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushchangetype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushchangetype.py new file mode 100644 index 000000000..76371e9e3 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushchangetype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushChangeType(str, Enum): + r"""Type of change being applied to record in third party platform.""" + + UNKNOWN = "Unknown" + CREATED = "Created" + MODIFIED = "Modified" + DELETED = "Deleted" + ATTACHMENT_UPLOADED = "AttachmentUploaded" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushfieldvalidation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushfieldvalidation.py new file mode 100644 index 000000000..4c0b4be83 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushfieldvalidation.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PushFieldValidationTypedDict(TypedDict): + details: str + r"""Details on the validation issue.""" + field: NotRequired[str] + r"""Field name that resulted in the validation issue.""" + ref: NotRequired[Nullable[str]] + r"""Unique reference identifier for the validation issue.""" + + +class PushFieldValidation(BaseModel): + details: str + r"""Details on the validation issue.""" + + field: Optional[str] = None + r"""Field name that resulted in the validation issue.""" + + ref: OptionalNullable[str] = UNSET + r"""Unique reference identifier for the validation issue.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["field", "ref"] + nullable_fields = ["ref"] + 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-expenses/src/codat_sync_for_expenses/models/shared/pushoperation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperation.py new file mode 100644 index 000000000..eeeaaa647 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperation.py @@ -0,0 +1,219 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class PushOperation(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/pushoperationchange.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationchange.py new file mode 100644 index 000000000..4163e2860 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationchange.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushchangetype import PushChangeType +from .pushoperationref import PushOperationRef, PushOperationRefTypedDict +from codat_sync_for_expenses.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 PushOperationChangeTypedDict(TypedDict): + attachment_id: NotRequired[Nullable[str]] + r"""Unique identifier for the attachment created otherwise null.""" + record_ref: NotRequired[PushOperationRefTypedDict] + type: NotRequired[PushChangeType] + r"""Type of change being applied to record in third party platform.""" + + +class PushOperationChange(BaseModel): + attachment_id: Annotated[ + OptionalNullable[str], pydantic.Field(alias="attachmentId") + ] = UNSET + r"""Unique identifier for the attachment created otherwise null.""" + + record_ref: Annotated[ + Optional[PushOperationRef], pydantic.Field(alias="recordRef") + ] = None + + type: Optional[PushChangeType] = None + r"""Type of change being applied to record in third party platform.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["attachmentId", "recordRef", "type"] + nullable_fields = ["attachmentId"] + 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-expenses/src/codat_sync_for_expenses/models/shared/pushoperationref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationref.py new file mode 100644 index 000000000..5ee213e44 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationref.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationRefTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + id: NotRequired[str] + r"""Unique identifier for a push operation.""" + + +class PushOperationRef(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + id: Optional[str] = None + r"""Unique identifier for a push operation.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperations.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperations.py new file mode 100644 index 000000000..9a263ced0 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .pushoperation import PushOperation, PushOperationTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PushOperationTypedDict]] + + +class PushOperations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PushOperation]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationstatus.py new file mode 100644 index 000000000..09fa8b1f2 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoperationstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushOperationStatus(str, Enum): + r"""The current status of the push operation.""" + + PENDING = "Pending" + FAILED = "Failed" + SUCCESS = "Success" + TIMED_OUT = "TimedOut" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoption.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoption.py new file mode 100644 index 000000000..c53eccc0d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoption.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionTypedDict(TypedDict): + display_name: str + r"""The property's display name.""" + required: bool + r"""The property is required if `True`.""" + type: PushOptionType + r"""The option type.""" + description: NotRequired[str] + r"""A description of the property.""" + options: NotRequired[Nullable[List[PushOptionChoiceTypedDict]]] + properties: NotRequired[Nullable[Dict[str, PushOptionPropertyTypedDict]]] + validation: NotRequired[PushValidationInfoTypedDict] + + +class PushOption(BaseModel): + display_name: Annotated[str, pydantic.Field(alias="displayName")] + r"""The property's display name.""" + + required: bool + r"""The property is required if `True`.""" + + type: PushOptionType + r"""The option type.""" + + description: Optional[str] = None + r"""A description of the property.""" + + options: OptionalNullable[List[PushOptionChoice]] = UNSET + + properties: OptionalNullable[Dict[str, PushOptionProperty]] = UNSET + + validation: Optional[PushValidationInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["description", "options", "properties", "validation"] + nullable_fields = ["options", "properties"] + 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-expenses/src/codat_sync_for_expenses/models/shared/pushoptionchoice.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptionchoice.py new file mode 100644 index 000000000..3b1e64e77 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptionchoice.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptiontype import PushOptionType +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionChoiceTypedDict(TypedDict): + description: NotRequired[str] + r"""A description of the property.""" + display_name: NotRequired[str] + r"""The property's display name.""" + required: NotRequired[bool] + r"""The property is required if `True`.""" + type: NotRequired[PushOptionType] + r"""The option type.""" + value: NotRequired[str] + r"""Allowed value for field.""" + + +class PushOptionChoice(BaseModel): + description: Optional[str] = None + r"""A description of the property.""" + + display_name: Annotated[Optional[str], pydantic.Field(alias="displayName")] = None + r"""The property's display name.""" + + required: Optional[bool] = None + r"""The property is required if `True`.""" + + type: Optional[PushOptionType] = None + r"""The option type.""" + + value: Optional[str] = None + r"""Allowed value for field.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptionproperty.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptionproperty.py new file mode 100644 index 000000000..dcabc2609 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptionproperty.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionPropertyTypedDict(TypedDict): + description: str + r"""A description of the property.""" + display_name: str + r"""The property's display name.""" + required: bool + r"""The property is required if `True`.""" + type: PushOptionType + r"""The option type.""" + options: NotRequired[Nullable[List[PushOptionChoiceTypedDict]]] + properties: NotRequired[Nullable[Dict[str, PushOptionPropertyTypedDict]]] + validation: NotRequired[PushValidationInfoTypedDict] + + +class PushOptionProperty(BaseModel): + description: str + r"""A description of the property.""" + + display_name: Annotated[str, pydantic.Field(alias="displayName")] + r"""The property's display name.""" + + required: bool + r"""The property is required if `True`.""" + + type: PushOptionType + r"""The option type.""" + + options: OptionalNullable[List[PushOptionChoice]] = UNSET + + properties: OptionalNullable[Dict[str, PushOptionProperty]] = UNSET + + validation: Optional[PushValidationInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["options", "properties", "validation"] + nullable_fields = ["options", "properties"] + 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-expenses/src/codat_sync_for_expenses/models/shared/pushoptiontype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptiontype.py new file mode 100644 index 000000000..c9c246f2a --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushoptiontype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushOptionType(str, Enum): + r"""The option type.""" + + ARRAY = "Array" + OBJECT = "Object" + STRING = "String" + NUMBER = "Number" + BOOLEAN = "Boolean" + DATE_TIME = "DateTime" + FILE = "File" + MULTI_PART = "MultiPart" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushvalidationinfo.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushvalidationinfo.py new file mode 100644 index 000000000..ea8947d3b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/pushvalidationinfo.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class PushValidationInfoTypedDict(TypedDict): + information: NotRequired[Nullable[List[PushFieldValidationTypedDict]]] + warnings: NotRequired[Nullable[List[PushFieldValidationTypedDict]]] + + +class PushValidationInfo(BaseModel): + information: OptionalNullable[List[PushFieldValidation]] = UNSET + + warnings: OptionalNullable[List[PushFieldValidation]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["information", "warnings"] + nullable_fields = ["information", "warnings"] + 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-expenses/src/codat_sync_for_expenses/models/shared/recordref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/recordref.py new file mode 100644 index 000000000..da8e3f0e4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/recordref.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class RecordRefTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier of linked reference from mapping options.""" + + +class RecordRef(BaseModel): + id: Optional[str] = None + r"""Identifier of linked reference from mapping options.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursableexpensetransaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursableexpensetransaction.py new file mode 100644 index 000000000..b9011d530 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursableexpensetransaction.py @@ -0,0 +1,263 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apaccountref import ApAccountRef, ApAccountRefTypedDict +from .reimbursableexpensetransactionline import ( + ReimbursableExpenseTransactionLine, + ReimbursableExpenseTransactionLineTypedDict, +) +from .reimbursementcontactref import ( + ReimbursementContactRef, + ReimbursementContactRefTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ReimbursableExpenseTransactionTypedDict(TypedDict): + contact_ref: ReimbursementContactRefTypedDict + currency: str + r"""Currency the transaction was recorded in.""" + due_date: 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. + """ + id: str + r"""Your unique identifier for the transaction.""" + issue_date: 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. + """ + ap_account_ref: NotRequired[Nullable[ApAccountRefTypedDict]] + currency_rate: NotRequired[Nullable[Decimal]] + r"""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. | + """ + lines: NotRequired[List[ReimbursableExpenseTransactionLineTypedDict]] + r"""Array of transaction lines.""" + notes: NotRequired[str] + r"""Any private, company notes about the transaction.""" + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the reimbursable expense.""" + + +class ReimbursableExpenseTransaction(BaseModel): + contact_ref: Annotated[ReimbursementContactRef, pydantic.Field(alias="contactRef")] + + currency: str + r"""Currency the transaction was recorded in.""" + + due_date: Annotated[str, pydantic.Field(alias="dueDate")] + 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. + """ + + id: str + r"""Your unique identifier for the transaction.""" + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + 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. + """ + + ap_account_ref: Annotated[ + OptionalNullable[ApAccountRef], pydantic.Field(alias="apAccountRef") + ] = UNSET + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""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. | + """ + + lines: Optional[List[ReimbursableExpenseTransactionLine]] = None + r"""Array of transaction lines.""" + + notes: Optional[str] = None + r"""Any private, company notes about the transaction.""" + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the reimbursable expense.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "apAccountRef", + "currencyRate", + "lines", + "notes", + "reference", + ] + nullable_fields = ["apAccountRef", "currencyRate", "reference"] + 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-expenses/src/codat_sync_for_expenses/models/shared/reimbursableexpensetransactionline.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursableexpensetransactionline.py new file mode 100644 index 000000000..0222cda5c --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursableexpensetransactionline.py @@ -0,0 +1,121 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .invoiceto import InvoiceTo, InvoiceToTypedDict +from .itemref import ItemRef, ItemRefTypedDict +from .recordref import RecordRef, RecordRefTypedDict +from .trackingref import TrackingRef, TrackingRefTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ReimbursableExpenseTransactionLineTypedDict(TypedDict): + net_amount: Decimal + r"""Amount of the line, exclusive of tax.""" + account_ref: NotRequired[RecordRefTypedDict] + description: NotRequired[str] + r"""line description""" + invoice_to: NotRequired[Nullable[InvoiceToTypedDict]] + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + item_ref: NotRequired[Nullable[ItemRefTypedDict]] + tax_amount: NotRequired[Decimal] + r"""Amount of tax for the line.""" + tax_rate_ref: NotRequired[RecordRefTypedDict] + tracking_refs: NotRequired[Nullable[List[TrackingRefTypedDict]]] + + +class ReimbursableExpenseTransactionLine(BaseModel): + net_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="netAmount"), + ] + r"""Amount of the line, exclusive of tax.""" + + account_ref: Annotated[Optional[RecordRef], pydantic.Field(alias="accountRef")] = ( + None + ) + + description: Optional[str] = None + r"""line description""" + + invoice_to: Annotated[ + OptionalNullable[InvoiceTo], pydantic.Field(alias="invoiceTo") + ] = UNSET + r"""Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.""" + + item_ref: Annotated[OptionalNullable[ItemRef], pydantic.Field(alias="itemRef")] = ( + UNSET + ) + + tax_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] = None + r"""Amount of tax for the line.""" + + tax_rate_ref: Annotated[Optional[RecordRef], pydantic.Field(alias="taxRateRef")] = ( + None + ) + + tracking_refs: Annotated[ + OptionalNullable[List[TrackingRef]], pydantic.Field(alias="trackingRefs") + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "description", + "invoiceTo", + "itemRef", + "taxAmount", + "taxRateRef", + "trackingRefs", + ] + nullable_fields = ["invoiceTo", "itemRef", "trackingRefs"] + 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-expenses/src/codat_sync_for_expenses/models/shared/reimbursementcontactref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursementcontactref.py new file mode 100644 index 000000000..51cb2d5ec --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/reimbursementcontactref.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing_extensions import TypedDict + + +class ReimbursementContactRefTypedDict(TypedDict): + id: str + r"""Identifier of contact.""" + + +class ReimbursementContactRef(BaseModel): + id: str + r"""Identifier of contact.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/schema_datatype.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/schema_datatype.py new file mode 100644 index 000000000..aa72f531c --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/schema_datatype.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SchemaDataType(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/schema_transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/schema_transaction.py new file mode 100644 index 000000000..473474b41 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/schema_transaction.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .integrationtype import IntegrationType +from .transactionstatus import TransactionStatus +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SchemaTransactionTypedDict(TypedDict): + integration_type: NotRequired[Nullable[IntegrationType]] + r"""Type of transaction that has been processed e.g. Expense or Bank Feed.""" + message: NotRequired[Nullable[str]] + r"""Metadata such as validation errors or the resulting record created in the accounting software.""" + status: NotRequired[Nullable[TransactionStatus]] + r"""Status of the transaction.""" + transaction_id: NotRequired[Nullable[str]] + r"""Your unique idenfier of the transaction.""" + + +class SchemaTransaction(BaseModel): + integration_type: Annotated[ + OptionalNullable[IntegrationType], pydantic.Field(alias="integrationType") + ] = IntegrationType.EXPENSES + r"""Type of transaction that has been processed e.g. Expense or Bank Feed.""" + + message: OptionalNullable[str] = UNSET + r"""Metadata such as validation errors or the resulting record created in the accounting software.""" + + status: OptionalNullable[TransactionStatus] = UNSET + r"""Status of the transaction.""" + + transaction_id: Annotated[ + OptionalNullable[str], pydantic.Field(alias="transactionId") + ] = UNSET + r"""Your unique idenfier of the transaction.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["integrationType", "message", "status", "transactionId"] + nullable_fields = ["integrationType", "message", "status", "transactionId"] + 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-expenses/src/codat_sync_for_expenses/models/shared/security.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/security.py new file mode 100644 index 000000000..0963a8d5f --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/security.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import FieldMetadata, SecurityMetadata +from typing_extensions import Annotated, TypedDict + + +class SecurityTypedDict(TypedDict): + auth_header: str + + +class Security(BaseModel): + auth_header: Annotated[ + str, + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="apiKey", + sub_type="header", + field_name="Authorization", + ) + ), + ] diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/status.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/status.py new file mode 100644 index 000000000..bab5b3828 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/status.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class Status(str, Enum): + r"""The current status of the dataset.""" + + INITIAL = "Initial" + QUEUED = "Queued" + FETCHING = "Fetching" + MAP_QUEUED = "MapQueued" + MAPPING = "Mapping" + COMPLETE = "Complete" + FETCH_ERROR = "FetchError" + MAP_ERROR = "MapError" + INTERNAL_ERROR = "InternalError" + PROCESSING_QUEUED = "ProcessingQueued" + PROCESSING = "Processing" + PROCESSING_ERROR = "ProcessingError" + VALIDATION_QUEUED = "ValidationQueued" + VALIDATING = "Validating" + VALIDATION_ERROR = "ValidationError" + AUTH_ERROR = "AuthError" + CANCELLED = "Cancelled" + NOT_SUPPORTED = "NotSupported" + RATE_LIMIT_ERROR = "RateLimitError" + PERMISSIONS_ERROR = "PermissionsError" + PREREQUISITE_NOT_MET = "PrerequisiteNotMet" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplementaldata.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplementaldata.py new file mode 100644 index 000000000..13efdf898 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplementaldata.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class SupplementalDataTypedDict(TypedDict): + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + content: NotRequired[Nullable[Dict[str, Dict[str, Any]]]] + + +class SupplementalData(BaseModel): + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + content: OptionalNullable[Dict[str, Dict[str, Any]]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["content"] + nullable_fields = ["content"] + 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-expenses/src/codat_sync_for_expenses/models/shared/supplier.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplier.py new file mode 100644 index 000000000..84c775d2b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplier.py @@ -0,0 +1,172 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierstatus import SupplierStatus +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SupplierTypedDict(TypedDict): + r"""## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + addresses: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the supplier.""" + default_currency: NotRequired[Nullable[str]] + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: NotRequired[Nullable[str]] + r"""Email address that the supplier may be contacted on.""" + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number that the supplier may be contacted on.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_name: NotRequired[Nullable[str]] + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: NotRequired[Nullable[str]] + r"""Supplier's company tax number.""" + + +class Supplier(BaseModel): + r"""## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + + addresses: OptionalNullable[List[Items]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the supplier.""" + + default_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="defaultCurrency") + ] = UNSET + r"""Default currency the supplier's transactional data is recorded in.""" + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address that the supplier may be contacted on.""" + + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number that the supplier may be contacted on.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Supplier's company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "supplierName", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "phone", + "registrationNumber", + "supplierName", + "taxNumber", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/supplierdetails.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplierdetails.py new file mode 100644 index 000000000..698b947c3 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplierdetails.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class SupplierDetailsTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + +class SupplierDetails(BaseModel): + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/suppliers.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/suppliers.py new file mode 100644 index 000000000..db0bc44e9 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/suppliers.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .supplier import Supplier, SupplierTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SuppliersTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[SupplierTypedDict]] + + +class Suppliers(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Supplier]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplierstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplierstatus.py new file mode 100644 index 000000000..0f7785837 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/supplierstatus.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SupplierStatus(str, Enum): + r"""Status of the supplier.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/synccompletewebhook.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/synccompletewebhook.py new file mode 100644 index 000000000..8eff079f5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/synccompletewebhook.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .synccompletewebhookdata import ( + SyncCompleteWebhookData, + SyncCompleteWebhookDataTypedDict, +) +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SyncCompleteWebhookTypedDict(TypedDict): + r"""Webhook request body used to notify that a sync has completed.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[SyncCompleteWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class SyncCompleteWebhook(BaseModel): + r"""Webhook request body used to notify that a sync has completed.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + 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.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[Optional[SyncCompleteWebhookData], pydantic.Field(alias="Data")] = ( + None + ) + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + 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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/synccompletewebhookdata.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/synccompletewebhookdata.py new file mode 100644 index 000000000..e833c7339 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/synccompletewebhookdata.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SyncCompleteWebhookDataTypedDict(TypedDict): + sync_id: NotRequired[str] + r"""Unique identifier for the failed sync.""" + sync_type: NotRequired[str] + r"""The type of sync being performed.""" + + +class SyncCompleteWebhookData(BaseModel): + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique identifier for the failed sync.""" + + sync_type: Annotated[Optional[str], pydantic.Field(alias="syncType")] = None + r"""The type of sync being performed.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/syncfailedwebhook.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/syncfailedwebhook.py new file mode 100644 index 000000000..a40d0a888 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/syncfailedwebhook.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .syncfailedwebhookdata import SyncFailedWebhookData, SyncFailedWebhookDataTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SyncFailedWebhookTypedDict(TypedDict): + r"""Webhook request body used to notify that a sync has failed.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[SyncFailedWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class SyncFailedWebhook(BaseModel): + r"""Webhook request body used to notify that a sync has failed.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + 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.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[Optional[SyncFailedWebhookData], pydantic.Field(alias="Data")] = ( + None + ) + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + 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.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/syncfailedwebhookdata.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/syncfailedwebhookdata.py new file mode 100644 index 000000000..ee84bab4d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/syncfailedwebhookdata.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SyncFailedWebhookDataTypedDict(TypedDict): + failure_stage: NotRequired[str] + r"""The stage of the job the sync failed.""" + sync_id: NotRequired[str] + r"""Unique identifier for the failed sync.""" + sync_type: NotRequired[str] + r"""The type of sync being performed.""" + + +class SyncFailedWebhookData(BaseModel): + failure_stage: Annotated[Optional[str], pydantic.Field(alias="FailureStage")] = None + r"""The stage of the job the sync failed.""" + + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique identifier for the failed sync.""" + + sync_type: Annotated[Optional[str], pydantic.Field(alias="syncType")] = None + r"""The type of sync being performed.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/taxratemappinginfo.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/taxratemappinginfo.py new file mode 100644 index 000000000..1ac6d178d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/taxratemappinginfo.py @@ -0,0 +1,108 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .validtransactiontypes import ValidTransactionTypes +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TaxRateMappingInfoTypedDict(TypedDict): + code: NotRequired[Nullable[str]] + r"""Code for the tax rate from the accounting software.""" + effective_tax_rate: NotRequired[Decimal] + r"""Effective tax rate.""" + id: NotRequired[str] + r"""Unique identifier of tax rate.""" + name: NotRequired[str] + r"""Name of the tax rate in the accounting software.""" + total_tax_rate: NotRequired[Decimal] + r"""Total (not compounded) sum of the components of a tax rate.""" + valid_transaction_types: NotRequired[List[ValidTransactionTypes]] + r"""Supported transaction types for the account.""" + + +class TaxRateMappingInfo(BaseModel): + code: OptionalNullable[str] = UNSET + r"""Code for the tax rate from the accounting software.""" + + effective_tax_rate: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="effectiveTaxRate"), + ] = None + r"""Effective tax rate.""" + + id: Optional[str] = None + r"""Unique identifier of tax rate.""" + + name: Optional[str] = None + r"""Name of the tax rate in the accounting software.""" + + total_tax_rate: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalTaxRate"), + ] = None + r"""Total (not compounded) sum of the components of a tax rate.""" + + valid_transaction_types: Annotated[ + Optional[List[ValidTransactionTypes]], + pydantic.Field(alias="validTransactionTypes"), + ] = None + r"""Supported transaction types for the account.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "code", + "effectiveTaxRate", + "id", + "name", + "totalTaxRate", + "validTransactionTypes", + ] + nullable_fields = ["code"] + 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-expenses/src/codat_sync_for_expenses/models/shared/trackingcategorymappinginfo.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingcategorymappinginfo.py new file mode 100644 index 000000000..c79ee992d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingcategorymappinginfo.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.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 TrackingCategoryMappingInfoTypedDict(TypedDict): + has_children: NotRequired[bool] + r"""Boolean of whether the tracking category has child categories.""" + id: NotRequired[str] + r"""Unique identifier of the tracking category.""" + name: NotRequired[str] + r"""Name of the tracking category as it appears in the accounting software.""" + parent_id: NotRequired[Nullable[str]] + r"""ID of the parent tracking category""" + + +class TrackingCategoryMappingInfo(BaseModel): + has_children: Annotated[Optional[bool], pydantic.Field(alias="hasChildren")] = None + r"""Boolean of whether the tracking category has child categories.""" + + id: Optional[str] = None + r"""Unique identifier of the tracking category.""" + + name: Optional[str] = None + r"""Name of the tracking category as it appears in the accounting software.""" + + parent_id: Annotated[OptionalNullable[str], pydantic.Field(alias="parentId")] = ( + UNSET + ) + r"""ID of the parent tracking category""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["hasChildren", "id", "name", "parentId"] + nullable_fields = ["parentId"] + 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-expenses/src/codat_sync_for_expenses/models/shared/trackingref.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingref.py new file mode 100644 index 000000000..09b3016f6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingref.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TrackingRefDataType(str, Enum): + r"""The type of the linked reference""" + + TRACKING_CATEGORIES = "trackingCategories" + CUSTOMERS = "customers" + + +class TrackingRefTypedDict(TypedDict): + data_type: NotRequired[TrackingRefDataType] + r"""The type of the linked reference""" + id: NotRequired[str] + r"""Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer.""" + + +class TrackingRef(BaseModel): + data_type: Annotated[ + Optional[TrackingRefDataType], pydantic.Field(alias="dataType") + ] = TrackingRefDataType.TRACKING_CATEGORIES + r"""The type of the linked reference""" + + id: Optional[str] = None + r"""Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingrefadjustmenttransaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingrefadjustmenttransaction.py new file mode 100644 index 000000000..aec2a8b86 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/trackingrefadjustmenttransaction.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TrackingRefAdjustmentTransactionDataType(str, Enum): + r"""The type of the linked reference""" + + TRACKING_CATEGORIES = "trackingCategories" + CUSTOMERS = "customers" + SUPPLIERS = "suppliers" + + +class TrackingRefAdjustmentTransactionTypedDict(TypedDict): + data_type: NotRequired[TrackingRefAdjustmentTransactionDataType] + r"""The type of the linked reference""" + id: NotRequired[str] + r"""Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier.""" + + +class TrackingRefAdjustmentTransaction(BaseModel): + data_type: Annotated[ + Optional[TrackingRefAdjustmentTransactionDataType], + pydantic.Field(alias="dataType"), + ] = TrackingRefAdjustmentTransactionDataType.TRACKING_CATEGORIES + r"""The type of the linked reference""" + + id: Optional[str] = None + r"""Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transaction.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transaction.py new file mode 100644 index 000000000..ba7331ef8 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transaction.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + 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 TransactionDefinitionsStatus(str, Enum): + r"""Status of transaction.""" + + UNKNOWN = "Unknown" + PUSH_ERROR = "PushError" + COMPLETED = "Completed" + FAILED = "Failed" + PENDING = "Pending" + + +class TransactionTypedDict(TypedDict): + error_message: NotRequired[Nullable[str]] + r"""Error message for failed transaction.""" + id: NotRequired[str] + r"""Unique identifier of the transaction.""" + status: NotRequired[TransactionDefinitionsStatus] + r"""Status of transaction.""" + + +class Transaction(BaseModel): + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""Error message for failed transaction.""" + + id: Optional[str] = None + r"""Unique identifier of the transaction.""" + + status: Optional[TransactionDefinitionsStatus] = None + r"""Status of transaction.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errorMessage", "id", "status"] + nullable_fields = ["errorMessage"] + 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-expenses/src/codat_sync_for_expenses/models/shared/transactions.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transactions.py new file mode 100644 index 000000000..45eb316fc --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transactions.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .schema_transaction import SchemaTransaction, SchemaTransactionTypedDict +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TransactionsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[SchemaTransactionTypedDict]] + + +class Transactions(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[SchemaTransaction]] = None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transactionstatus.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transactionstatus.py new file mode 100644 index 000000000..a6a2deccc --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transactionstatus.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class TransactionStatus(str, Enum): + r"""Status of the transaction.""" + + UNKNOWN = "Unknown" + PENDING = "Pending" + VALIDATION_ERROR = "ValidationError" + COMPLETED = "Completed" + PUSH_ERROR = "PushError" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transfertransactionrequest.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transfertransactionrequest.py new file mode 100644 index 000000000..03b548288 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transfertransactionrequest.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountReferenceTypedDict(TypedDict): + r"""Reference of the account you are transferring money from.""" + + id: str + r"""'id' from the Accounts data type.""" + + +class AccountReference(BaseModel): + r"""Reference of the account you are transferring money from.""" + + id: str + r"""'id' from the Accounts data type.""" + + +class FromTypedDict(TypedDict): + account_ref: AccountReferenceTypedDict + r"""Reference of the account you are transferring money from.""" + amount: Decimal + r"""Amount that has been transferred from the account in the native currency of the account.""" + + +class From(BaseModel): + account_ref: Annotated[AccountReference, pydantic.Field(alias="accountRef")] + r"""Reference of the account you are transferring money from.""" + + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount that has been transferred from the account in the native currency of the account.""" + + +class TransferTransactionRequestAccountReferenceTypedDict(TypedDict): + r"""Reference of the account you are transferring money to.""" + + id: str + r"""'id' from the Accounts data type.""" + + +class TransferTransactionRequestAccountReference(BaseModel): + r"""Reference of the account you are transferring money to.""" + + id: str + r"""'id' from the Accounts data type.""" + + +class ToTypedDict(TypedDict): + account_ref: TransferTransactionRequestAccountReferenceTypedDict + r"""Reference of the account you are transferring money to.""" + amount: Decimal + r"""Amount that has been transferred to the account in the native currency of the account.""" + + +class To(BaseModel): + account_ref: Annotated[ + TransferTransactionRequestAccountReference, pydantic.Field(alias="accountRef") + ] + r"""Reference of the account you are transferring money to.""" + + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount that has been transferred to the account in the native currency of the account.""" + + +class TransferTransactionRequestTypedDict(TypedDict): + date_: str + from_: FromTypedDict + to: ToTypedDict + description: NotRequired[str] + r"""Any private, company notes about the transaction.""" + + +class TransferTransactionRequest(BaseModel): + date_: Annotated[str, pydantic.Field(alias="date")] + + from_: Annotated[From, pydantic.Field(alias="from")] + + to: To + + description: Optional[str] = None + r"""Any private, company notes about the transaction.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transfertransactionresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transfertransactionresponse.py new file mode 100644 index 000000000..00e6cfa64 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/transfertransactionresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TransferTransactionResponseTypedDict(TypedDict): + sync_id: NotRequired[str] + r"""Unique id of sync created""" + + +class TransferTransactionResponse(BaseModel): + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique id of sync created""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatecustomerresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatecustomerresponse.py new file mode 100644 index 000000000..9711d525b --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatecustomerresponse.py @@ -0,0 +1,415 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contact import Contact, ContactTypedDict +from .customerstatus import CustomerStatus +from .datatype import DataType +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateCustomerResponseAccountingCustomerTypedDict(TypedDict): + r"""## Overview + + A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + + Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + """ + + status: CustomerStatus + r"""Status of customer.""" + addresses: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the identified customer.""" + contacts: NotRequired[Nullable[List[ContactTypedDict]]] + r"""An array of Contacts.""" + customer_name: NotRequired[Nullable[str]] + r"""Name of the customer as recorded in the accounting system, typically the company name.""" + default_currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + email_address: NotRequired[Nullable[str]] + r"""Email address the customer can be contacted by.""" + id: NotRequired[str] + r"""Identifier for the customer, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number the customer can be contacted by.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number. In the UK, this is typically the Companies House company registration number.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + tax_number: NotRequired[Nullable[str]] + r"""Company tax number.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateCustomerResponseAccountingCustomer(BaseModel): + r"""## Overview + + A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + + Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + """ + + status: CustomerStatus + r"""Status of customer.""" + + addresses: OptionalNullable[List[Items]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the identified customer.""" + + contacts: OptionalNullable[List[Contact]] = UNSET + r"""An array of Contacts.""" + + customer_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="customerName") + ] = UNSET + r"""Name of the customer as recorded in the accounting system, typically the company name.""" + + default_currency: Annotated[ + Optional[str], pydantic.Field(alias="defaultCurrency") + ] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address the customer can be contacted by.""" + + id: Optional[str] = None + r"""Identifier for the customer, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number the customer can be contacted by.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number. In the UK, this is typically the Companies House company registration number.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "contacts", + "customerName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "contacts", + "customerName", + "emailAddress", + "phone", + "registrationNumber", + "taxNumber", + ] + 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 + + +class UpdateCustomerResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data: NotRequired[Nullable[UpdateCustomerResponseAccountingCustomerTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class UpdateCustomerResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data: OptionalNullable[UpdateCustomerResponseAccountingCustomer] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/updateexpenserequest.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updateexpenserequest.py new file mode 100644 index 000000000..bdeddb1f2 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updateexpenserequest.py @@ -0,0 +1,202 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .expensecontactref import ExpenseContactRef, ExpenseContactRefTypedDict +from .expensetransactionline import ( + ExpenseTransactionLine, + ExpenseTransactionLineTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateExpenseRequestBankAccountReferenceTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier of the bank account.""" + + +class UpdateExpenseRequestBankAccountReference(BaseModel): + id: Optional[str] = None + r"""Identifier of the bank account.""" + + +class UpdateExpenseRequestType(str, Enum): + r"""The type of transaction.""" + + PAYMENT = "Payment" + REFUND = "Refund" + REWARD = "Reward" + CHARGEBACK = "Chargeback" + + +class UpdateExpenseRequestTypedDict(TypedDict): + currency: str + r"""Currency the transaction was recorded in.""" + issue_date: str + r"""Date the transaction was recorded.""" + type: UpdateExpenseRequestType + r"""The type of transaction.""" + bank_account_ref: NotRequired[UpdateExpenseRequestBankAccountReferenceTypedDict] + contact_ref: NotRequired[ExpenseContactRefTypedDict] + currency_rate: NotRequired[Nullable[Decimal]] + r"""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. | + """ + lines: NotRequired[List[ExpenseTransactionLineTypedDict]] + r"""Array of transaction lines.""" + merchant_name: NotRequired[str] + r"""Name of the merchant where the purchase took place""" + notes: NotRequired[str] + r"""Any private, company notes about the transaction.""" + + +class UpdateExpenseRequest(BaseModel): + currency: str + r"""Currency the transaction was recorded in.""" + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + r"""Date the transaction was recorded.""" + + type: UpdateExpenseRequestType + r"""The type of transaction.""" + + bank_account_ref: Annotated[ + Optional[UpdateExpenseRequestBankAccountReference], + pydantic.Field(alias="bankAccountRef"), + ] = None + + contact_ref: Annotated[ + Optional[ExpenseContactRef], pydantic.Field(alias="contactRef") + ] = None + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""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. | + """ + + lines: Optional[List[ExpenseTransactionLine]] = None + r"""Array of transaction lines.""" + + merchant_name: Annotated[Optional[str], pydantic.Field(alias="merchantName")] = None + r"""Name of the merchant where the purchase took place""" + + notes: Optional[str] = None + r"""Any private, company notes about the transaction.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "bankAccountRef", + "contactRef", + "currencyRate", + "lines", + "merchantName", + "notes", + ] + nullable_fields = ["currencyRate"] + 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-expenses/src/codat_sync_for_expenses/models/shared/updateexpenseresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updateexpenseresponse.py new file mode 100644 index 000000000..66ba82a8d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updateexpenseresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateExpenseResponseTypedDict(TypedDict): + sync_id: NotRequired[str] + r"""Unique identifier for the update expense sync.""" + + +class UpdateExpenseResponse(BaseModel): + sync_id: Annotated[Optional[str], pydantic.Field(alias="syncId")] = None + r"""Unique identifier for the update expense sync.""" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatereimbursableexpensetransactionrequest.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatereimbursableexpensetransactionrequest.py new file mode 100644 index 000000000..bb5b62e0c --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatereimbursableexpensetransactionrequest.py @@ -0,0 +1,258 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apaccountref import ApAccountRef, ApAccountRefTypedDict +from .reimbursableexpensetransactionline import ( + ReimbursableExpenseTransactionLine, + ReimbursableExpenseTransactionLineTypedDict, +) +from .reimbursementcontactref import ( + ReimbursementContactRef, + ReimbursementContactRefTypedDict, +) +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_expenses.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateReimbursableExpenseTransactionRequestTypedDict(TypedDict): + contact_ref: ReimbursementContactRefTypedDict + currency: str + r"""Currency the transaction was recorded in.""" + due_date: 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. + """ + issue_date: 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. + """ + ap_account_ref: NotRequired[Nullable[ApAccountRefTypedDict]] + currency_rate: NotRequired[Nullable[Decimal]] + r"""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. | + """ + lines: NotRequired[List[ReimbursableExpenseTransactionLineTypedDict]] + r"""Array of transaction lines.""" + notes: NotRequired[str] + r"""Any private, company notes about the transaction.""" + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the reimbursable expense.""" + + +class UpdateReimbursableExpenseTransactionRequest(BaseModel): + contact_ref: Annotated[ReimbursementContactRef, pydantic.Field(alias="contactRef")] + + currency: str + r"""Currency the transaction was recorded in.""" + + due_date: Annotated[str, pydantic.Field(alias="dueDate")] + 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. + """ + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + 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. + """ + + ap_account_ref: Annotated[ + OptionalNullable[ApAccountRef], pydantic.Field(alias="apAccountRef") + ] = UNSET + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""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. | + """ + + lines: Optional[List[ReimbursableExpenseTransactionLine]] = None + r"""Array of transaction lines.""" + + notes: Optional[str] = None + r"""Any private, company notes about the transaction.""" + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the reimbursable expense.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "apAccountRef", + "currencyRate", + "lines", + "notes", + "reference", + ] + nullable_fields = ["apAccountRef", "currencyRate", "reference"] + 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-expenses/src/codat_sync_for_expenses/models/shared/updatesupplierresponse.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatesupplierresponse.py new file mode 100644 index 000000000..7a8d837f3 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/updatesupplierresponse.py @@ -0,0 +1,388 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierstatus import SupplierStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateSupplierResponseAccountingSupplierTypedDict(TypedDict): + r"""## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + addresses: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the supplier.""" + default_currency: NotRequired[Nullable[str]] + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: NotRequired[Nullable[str]] + r"""Email address that the supplier may be contacted on.""" + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number that the supplier may be contacted on.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_name: NotRequired[Nullable[str]] + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: NotRequired[Nullable[str]] + r"""Supplier's company tax number.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateSupplierResponseAccountingSupplier(BaseModel): + r"""## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + + addresses: OptionalNullable[List[Items]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the supplier.""" + + default_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="defaultCurrency") + ] = UNSET + r"""Default currency the supplier's transactional data is recorded in.""" + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address that the supplier may be contacted on.""" + + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number that the supplier may be contacted on.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Supplier's company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "supplierName", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "phone", + "registrationNumber", + "supplierName", + "taxNumber", + ] + 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 + + +class UpdateSupplierResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: str + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_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. + """ + data: NotRequired[Nullable[UpdateSupplierResponseAccountingSupplierTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class UpdateSupplierResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + + data: OptionalNullable[UpdateSupplierResponseAccountingSupplier] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + 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-expenses/src/codat_sync_for_expenses/models/shared/validation.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validation.py new file mode 100644 index 000000000..a9a645b05 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validation.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .validationitem import ValidationItem, ValidationItemTypedDict +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ValidationTypedDict(TypedDict): + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + errors: NotRequired[Nullable[List[ValidationItemTypedDict]]] + warnings: NotRequired[Nullable[List[ValidationItemTypedDict]]] + + +class Validation(BaseModel): + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + errors: OptionalNullable[List[ValidationItem]] = UNSET + + warnings: OptionalNullable[List[ValidationItem]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errors", "warnings"] + nullable_fields = ["errors", "warnings"] + 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-expenses/src/codat_sync_for_expenses/models/shared/validationitem.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validationitem.py new file mode 100644 index 000000000..5b161f9c5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validationitem.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_expenses.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ValidationItemTypedDict(TypedDict): + item_id: NotRequired[Nullable[str]] + r"""Unique identifier for a validation item.""" + message: NotRequired[Nullable[str]] + r"""A message outlining validation item's issue.""" + validator_name: NotRequired[Nullable[str]] + r"""Name of validator.""" + + +class ValidationItem(BaseModel): + item_id: Annotated[OptionalNullable[str], pydantic.Field(alias="itemId")] = UNSET + r"""Unique identifier for a validation item.""" + + message: OptionalNullable[str] = UNSET + r"""A message outlining validation item's issue.""" + + validator_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="validatorName") + ] = UNSET + r"""Name of validator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["itemId", "message", "validatorName"] + nullable_fields = ["itemId", "message", "validatorName"] + 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-expenses/src/codat_sync_for_expenses/models/shared/validfor.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validfor.py new file mode 100644 index 000000000..5141d7a42 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validfor.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class ValidFor(str, Enum): + EXPENSE_TRANSACTIONS_PAYMENT = "expense-transactions.Payment" + EXPENSE_TRANSACTIONS_REFUND = "expense-transactions.Refund" + EXPENSE_TRANSACTIONS_REWARD = "expense-transactions.Reward" + EXPENSE_TRANSACTIONS_CHARGEBACK = "expense-transactions.Chargeback" + REIMBURSABLE_EXPENSE_TRANSACTIONS = "reimbursable-expense-transactions" + TRANSFER_TRANSACTIONS = "transfer-transactions" + ADJUSTMENT_TRANSACTIONS = "adjustment-transactions" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validtransactiontypes.py b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validtransactiontypes.py new file mode 100644 index 000000000..3751f5020 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/models/shared/validtransactiontypes.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class ValidTransactionTypes(str, Enum): + PAYMENT = "Payment" + REFUND = "Refund" + REWARD = "Reward" + CHARGEBACK = "Chargeback" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/push_operations.py b/sync-for-expenses/src/codat_sync_for_expenses/push_operations.py new file mode 100644 index 000000000..e1b4c96be --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/push_operations.py @@ -0,0 +1,434 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class PushOperations(BaseSDK): + r"""View historic push operations.""" + + def get( + self, + *, + request: Union[ + operations.GetPushOperationRequest, + operations.GetPushOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Get push operation + + Retrieve push operation. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPushOperationRequest) + request = cast(operations.GetPushOperationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/push/{pushOperationKey}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-push-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetPushOperationRequest, + operations.GetPushOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Get push operation + + Retrieve push operation. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPushOperationRequest) + request = cast(operations.GetPushOperationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/push/{pushOperationKey}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-push-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListPushOperationsRequest, + operations.ListPushOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperations]: + r"""List push operations + + List push operation records. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListPushOperationsRequest) + request = cast(operations.ListPushOperationsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/push", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-push-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListPushOperationsRequest, + operations.ListPushOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperations]: + r"""List push operations + + List push operation records. + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListPushOperationsRequest) + request = cast(operations.ListPushOperationsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/push", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-push-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/py.typed b/sync-for-expenses/src/codat_sync_for_expenses/py.typed new file mode 100644 index 000000000..3e38f1a92 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. The package enables type hints. diff --git a/sync-for-expenses/src/codat_sync_for_expenses/reimbursements.py b/sync-for-expenses/src/codat_sync_for_expenses/reimbursements.py new file mode 100644 index 000000000..6b349cd54 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/reimbursements.py @@ -0,0 +1,518 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Optional, Union, cast + + +class Reimbursements(BaseSDK): + r"""Create and update transactions that represent your customers' repayable spend.""" + + def create( + self, + *, + request: Union[ + operations.CreateReimbursableExpenseTransactionRequest, + operations.CreateReimbursableExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateReimbursableExpenseResponse]: + r"""Create reimbursable expense transaction + + Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. + + [Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). + + ### Supported Integrations + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Desktop | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateReimbursableExpenseTransactionRequest + ) + request = cast(operations.CreateReimbursableExpenseTransactionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/sync/expenses/reimbursable-expense-transactions", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[List[shared.ReimbursableExpenseTransaction]], + ), + 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( + operation_id="create-reimbursable-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateReimbursableExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateReimbursableExpenseTransactionRequest, + operations.CreateReimbursableExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateReimbursableExpenseResponse]: + r"""Create reimbursable expense transaction + + Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. + + [Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). + + ### Supported Integrations + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Desktop | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateReimbursableExpenseTransactionRequest + ) + request = cast(operations.CreateReimbursableExpenseTransactionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/sync/expenses/reimbursable-expense-transactions", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[List[shared.ReimbursableExpenseTransaction]], + ), + 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( + operation_id="create-reimbursable-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateReimbursableExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def update( + self, + *, + request: Union[ + operations.UpdateReimbursableExpenseTransactionRequest, + operations.UpdateReimbursableExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateReimbursableExpenseResponse]: + r"""Update reimbursable expense transaction + + The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. + + Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). + + ### Supported Integrations + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdateReimbursableExpenseTransactionRequest + ) + request = cast(operations.UpdateReimbursableExpenseTransactionRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/sync/expenses/reimbursable-expense-transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_reimbursable_expense_transaction_request, + False, + True, + "json", + Optional[shared.UpdateReimbursableExpenseTransactionRequest], + ), + 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( + operation_id="update-reimbursable-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateReimbursableExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateReimbursableExpenseTransactionRequest, + operations.UpdateReimbursableExpenseTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateReimbursableExpenseResponse]: + r"""Update reimbursable expense transaction + + The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. + + Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). + + ### Supported Integrations + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdateReimbursableExpenseTransactionRequest + ) + request = cast(operations.UpdateReimbursableExpenseTransactionRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/sync/expenses/reimbursable-expense-transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_reimbursable_expense_transaction_request, + False, + True, + "json", + Optional[shared.UpdateReimbursableExpenseTransactionRequest], + ), + 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( + operation_id="update-reimbursable-expense-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateReimbursableExpenseResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/sdk.py b/sync-for-expenses/src/codat_sync_for_expenses/sdk.py new file mode 100644 index 000000000..7d5b511a9 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/sdk.py @@ -0,0 +1,209 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, HttpClient +from .sdkconfiguration import SDKConfiguration +from .utils.logger import Logger, get_default_logger +from .utils.retries import RetryConfig +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import SDKHooks +from codat_sync_for_expenses.accounts import Accounts +from codat_sync_for_expenses.adjustments import Adjustments +from codat_sync_for_expenses.attachments import Attachments +from codat_sync_for_expenses.bank_accounts import BankAccounts +from codat_sync_for_expenses.companies import Companies +from codat_sync_for_expenses.company_info import CompanyInfo +from codat_sync_for_expenses.configuration import Configuration +from codat_sync_for_expenses.connections import Connections +from codat_sync_for_expenses.customers import Customers +from codat_sync_for_expenses.expenses import Expenses +from codat_sync_for_expenses.manage_data import ManageData +from codat_sync_for_expenses.mapping_options import MappingOptions +from codat_sync_for_expenses.models import shared +from codat_sync_for_expenses.push_operations import PushOperations +from codat_sync_for_expenses.reimbursements import Reimbursements +from codat_sync_for_expenses.suppliers import Suppliers +from codat_sync_for_expenses.sync import Sync +from codat_sync_for_expenses.transaction_status import TransactionStatus +from codat_sync_for_expenses.transfers import Transfers +from codat_sync_for_expenses.types import OptionalNullable, UNSET +import httpx +from typing import Callable, Dict, Optional, Union + + +class CodatSyncExpenses(BaseSDK): + r"""Sync for Expenses: The API for Sync for Expenses. + + Sync for Expenses is an API and a set of supporting tools. It has been built to + enable corporate card and expense management platforms to provide high-quality + integrations with multiple accounting software through a standardized API. + + [Explore product](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) + + Not seeing the endpoints you're expecting? We've [reorganized our products](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Sync for Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). + + --- + + ## Endpoints + + | Endpoints | Description | + | :- |:- | + | Companies | Create and manage your SMB users' companies. | + | Connections | Create new and manage existing data connections for a company. | + | Configuration | View and manage mapping configuration and defaults for expense transactions. | + | Sync | Monitor the status of data syncs. | + | Expenses | Create and update transactions that represent your customers' spend. | + | Transfers | Create and update transactions that represent the movement of your customers' money. | + | Reimbursements | Create and update transactions that represent your customers' repayable spend. | + | Attachments | Attach receipts to a transaction for a complete audit trail. | + | Transaction status | Monitor the status of individual transactions in data syncs. | + | Manage data | Control and monitor the retrieval of data from an integration. | + | Push operations | View historic push operations. | + | Accounts | Create accounts and view account schemas. | + | Customers | Get, create, and update customers. | + | Suppliers | Get, create, and update suppliers. | + + """ + + companies: Companies + r"""Create and manage your SMB users' companies.""" + connections: Connections + r"""Create new and manage existing data connections for a company.""" + bank_accounts: BankAccounts + r"""Create bank accounts and view create bank account options.""" + accounts: Accounts + r"""Create accounts and view create account options.""" + customers: Customers + r"""Get, create, and update customers.""" + suppliers: Suppliers + r"""Get, create, and update suppliers.""" + manage_data: ManageData + r"""Control and monitor the retrieval of data from an integration.""" + company_info: CompanyInfo + r"""View the company information of your customers' linked accounting software.""" + push_operations: PushOperations + r"""View historic push operations.""" + adjustments: Adjustments + r"""Create transactions that represent your adjustments to your customers' spend.""" + configuration: Configuration + r"""View and manage mapping configuration and defaults for expense transactions.""" + expenses: Expenses + r"""Create and update transactions that represent your customers' spend.""" + mapping_options: MappingOptions + r"""Get accounts, trackingCategories and taxRates that can be used in your create and update requests.""" + reimbursements: Reimbursements + r"""Create and update transactions that represent your customers' repayable spend.""" + sync: Sync + r"""Monitor the status of data syncs.""" + transaction_status: TransactionStatus + r"""Monitor the status of individual transactions in data syncs.""" + attachments: Attachments + r"""Attach receipts to a transaction for a complete audit trail.""" + transfers: Transfers + r"""Create and update transactions that represent the movement of your customers' money.""" + + def __init__( + self, + security: Union[shared.Security, Callable[[], shared.Security]], + server_idx: Optional[int] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. + + :param security: The security details required for authentication + :param server_idx: The index of the server to use for all methods + :param server_url: The server URL to use for all methods + :param url_params: Parameters to optionally template the server URL with + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds + """ + if client is None: + client = httpx.Client() + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + if async_client is None: + async_client = httpx.AsyncClient() + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." + + if server_url is not None: + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + async_client=async_client, + security=security, + server_url=server_url, + server_idx=server_idx, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), + ) + + hooks = SDKHooks() + + 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 + ) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + # pylint: disable=protected-access + self.sdk_configuration.__dict__["_hooks"] = hooks + + self._init_sdks() + + def _init_sdks(self): + self.companies = Companies(self.sdk_configuration) + self.connections = Connections(self.sdk_configuration) + self.bank_accounts = BankAccounts(self.sdk_configuration) + self.accounts = Accounts(self.sdk_configuration) + self.customers = Customers(self.sdk_configuration) + self.suppliers = Suppliers(self.sdk_configuration) + self.manage_data = ManageData(self.sdk_configuration) + self.company_info = CompanyInfo(self.sdk_configuration) + self.push_operations = PushOperations(self.sdk_configuration) + self.adjustments = Adjustments(self.sdk_configuration) + self.configuration = Configuration(self.sdk_configuration) + self.expenses = Expenses(self.sdk_configuration) + self.mapping_options = MappingOptions(self.sdk_configuration) + self.reimbursements = Reimbursements(self.sdk_configuration) + self.sync = Sync(self.sdk_configuration) + self.transaction_status = TransactionStatus(self.sdk_configuration) + self.attachments = Attachments(self.sdk_configuration) + self.transfers = Transfers(self.sdk_configuration) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.sdk_configuration.client is not None: + self.sdk_configuration.client.close() + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if self.sdk_configuration.async_client is not None: + await self.sdk_configuration.async_client.aclose() diff --git a/sync-for-expenses/src/codat_sync_for_expenses/sdkconfiguration.py b/sync-for-expenses/src/codat_sync_for_expenses/sdkconfiguration.py new file mode 100644 index 000000000..7f4b37530 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/sdkconfiguration.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._hooks import SDKHooks +from .httpclient import AsyncHttpClient, HttpClient +from .utils import Logger, RetryConfig, remove_suffix +from codat_sync_for_expenses.models import shared +from codat_sync_for_expenses.types import OptionalNullable, UNSET +from dataclasses import dataclass +from pydantic import Field +from typing import Callable, Dict, Optional, Tuple, Union + + +SERVERS = [ + "https://api.codat.io", +] +"""Contains the list of servers available to the SDK""" + + +@dataclass +class SDKConfiguration: + client: HttpClient + async_client: AsyncHttpClient + 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 = "prealpha" + sdk_version: str = "7.0.0" + gen_version: str = "2.463.0" + user_agent: str = ( + "speakeasy-sdk/python 7.0.0 2.463.0 prealpha codat-sync-for-expenses" + ) + 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, "/"), {} + if self.server_idx is None: + self.server_idx = 0 + + return SERVERS[self.server_idx], {} + + def get_hooks(self) -> SDKHooks: + return self._hooks diff --git a/sync-for-expenses/src/codat_sync_for_expenses/suppliers.py b/sync-for-expenses/src/codat_sync_for_expenses/suppliers.py new file mode 100644 index 000000000..317ae723d --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/suppliers.py @@ -0,0 +1,920 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Suppliers(BaseSDK): + r"""Get, create, and update suppliers.""" + + def create( + self, + *, + request: Union[ + operations.CreateSupplierRequest, operations.CreateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateSupplierResponse]: + r"""Create supplier + + The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). + + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateSupplierRequest) + request = cast(operations.CreateSupplierRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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( + operation_id="create-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateSupplierRequest, operations.CreateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateSupplierResponse]: + r"""Create supplier + + The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). + + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateSupplierRequest) + request = cast(operations.CreateSupplierRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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( + operation_id="create-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CreateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get( + self, + *, + request: Union[ + operations.GetSupplierRequest, operations.GetSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Supplier]: + r"""Get supplier + + The *Get supplier* endpoint returns a single supplier for a given supplierId. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetSupplierRequest) + request = cast(operations.GetSupplierRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/suppliers/{supplierId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Supplier]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetSupplierRequest, operations.GetSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Supplier]: + r"""Get supplier + + The *Get supplier* endpoint returns a single supplier for a given supplierId. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetSupplierRequest) + request = cast(operations.GetSupplierRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/suppliers/{supplierId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Supplier]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListSuppliersRequest, operations.ListSuppliersRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Suppliers]: + r"""List suppliers + + The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListSuppliersRequest) + request = cast(operations.ListSuppliersRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/suppliers", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-suppliers", + oauth2_scopes=[], + 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, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Suppliers]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListSuppliersRequest, operations.ListSuppliersRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Suppliers]: + r"""List suppliers + + The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListSuppliersRequest) + request = cast(operations.ListSuppliersRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/suppliers", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-suppliers", + oauth2_scopes=[], + 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, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Suppliers]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def update( + self, + *, + request: Union[ + operations.UpdateSupplierRequest, operations.UpdateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateSupplierResponse]: + r"""Update supplier + + The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateSupplierRequest) + request = cast(operations.UpdateSupplierRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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( + operation_id="update-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.UpdateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateSupplierRequest, operations.UpdateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateSupplierResponse]: + r"""Update supplier + + The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateSupplierRequest) + request = cast(operations.UpdateSupplierRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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( + operation_id="update-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.UpdateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/sync.py b/sync-for-expenses/src/codat_sync_for_expenses/sync.py new file mode 100644 index 000000000..2aabca6c3 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/sync.py @@ -0,0 +1,862 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Optional, Union, cast + + +class Sync(BaseSDK): + r"""Monitor the status of data syncs.""" + + def get( + self, + *, + request: Union[ + operations.GetSyncByIDRequest, operations.GetSyncByIDRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanySyncStatus]: + r"""Get sync status + + Get the sync status for a specified sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetSyncByIDRequest) + request = cast(operations.GetSyncByIDRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-sync-by-id", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanySyncStatus] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetSyncByIDRequest, operations.GetSyncByIDRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanySyncStatus]: + r"""Get sync status + + Get the sync status for a specified sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetSyncByIDRequest) + request = cast(operations.GetSyncByIDRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-sync-by-id", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanySyncStatus] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get_last_successful_sync( + self, + *, + request: Union[ + operations.GetLastSuccessfulSyncRequest, + operations.GetLastSuccessfulSyncRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanySyncStatus]: + r"""Last successful sync + + Gets the status of the last successful sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetLastSuccessfulSyncRequest) + request = cast(operations.GetLastSuccessfulSyncRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/lastSuccessful/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-last-successful-sync", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanySyncStatus] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_last_successful_sync_async( + self, + *, + request: Union[ + operations.GetLastSuccessfulSyncRequest, + operations.GetLastSuccessfulSyncRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanySyncStatus]: + r"""Last successful sync + + Gets the status of the last successful sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetLastSuccessfulSyncRequest) + request = cast(operations.GetLastSuccessfulSyncRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/lastSuccessful/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-last-successful-sync", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanySyncStatus] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def get_latest_sync( + self, + *, + request: Union[ + operations.GetLatestSyncRequest, operations.GetLatestSyncRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanySyncStatus]: + r"""Latest sync status + + Gets the latest sync status + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetLatestSyncRequest) + request = cast(operations.GetLatestSyncRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/latest/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-latest-sync", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanySyncStatus] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_latest_sync_async( + self, + *, + request: Union[ + operations.GetLatestSyncRequest, operations.GetLatestSyncRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanySyncStatus]: + r"""Latest sync status + + Gets the latest sync status + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetLatestSyncRequest) + request = cast(operations.GetLatestSyncRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/latest/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-latest-sync", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanySyncStatus] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListSyncsRequest, operations.ListSyncsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[List[shared.CompanySyncStatus]]: + r"""List sync statuses + + Gets a list of sync statuses + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListSyncsRequest) + request = cast(operations.ListSyncsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/list/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-syncs", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[List[shared.CompanySyncStatus]] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListSyncsRequest, operations.ListSyncsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[List[shared.CompanySyncStatus]]: + r"""List sync statuses + + Gets a list of sync statuses + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListSyncsRequest) + request = cast(operations.ListSyncsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/list/status", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-syncs", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[List[shared.CompanySyncStatus]] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/transaction_status.py b/sync-for-expenses/src/codat_sync_for_expenses/transaction_status.py new file mode 100644 index 000000000..cf61b00cf --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/transaction_status.py @@ -0,0 +1,438 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Optional, Union, cast + + +class TransactionStatus(BaseSDK): + r"""Monitor the status of individual transactions in data syncs.""" + + def get( + self, + *, + request: Union[ + operations.GetSyncTransactionRequest, + operations.GetSyncTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[List[shared.SchemaTransaction]]: + r"""Get sync transaction + + Gets the status of a transaction for a sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetSyncTransactionRequest) + request = cast(operations.GetSyncTransactionRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-sync-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[List[shared.SchemaTransaction]] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetSyncTransactionRequest, + operations.GetSyncTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[List[shared.SchemaTransaction]]: + r"""Get sync transaction + + Gets the status of a transaction for a sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetSyncTransactionRequest) + request = cast(operations.GetSyncTransactionRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="get-sync-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[List[shared.SchemaTransaction]] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) + + def list( + self, + *, + request: Union[ + operations.ListSyncTransactionsRequest, + operations.ListSyncTransactionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Transactions]: + r"""List sync transactions + + Gets the transactions and status for a sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListSyncTransactionsRequest) + request = cast(operations.ListSyncTransactionsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-sync-transactions", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Transactions]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListSyncTransactionsRequest, + operations.ListSyncTransactionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Transactions]: + r"""List sync transactions + + Gets the transactions and status for a sync + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListSyncTransactionsRequest) + request = cast(operations.ListSyncTransactionsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions", + 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", + security=self.sdk_configuration.security, + 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( + operation_id="list-sync-transactions", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Transactions]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/transfers.py b/sync-for-expenses/src/codat_sync_for_expenses/transfers.py new file mode 100644 index 000000000..1aab01156 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/transfers.py @@ -0,0 +1,270 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_expenses import utils +from codat_sync_for_expenses._hooks import HookContext +from codat_sync_for_expenses.models import errors, operations, shared +from codat_sync_for_expenses.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Transfers(BaseSDK): + r"""Create and update transactions that represent the movement of your customers' money.""" + + def create( + self, + *, + request: Union[ + operations.CreateTransferTransactionRequest, + operations.CreateTransferTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TransferTransactionResponse]: + r"""Create transfer transaction + + Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. + + Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. + + The `from.amount` and `to.amount` fields are in the native currency of the account. + + ### Supported Integrations + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Desktop | Yes | + | QuickBooks Online | Yes | + | Xero | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateTransferTransactionRequest + ) + request = cast(operations.CreateTransferTransactionRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/sync/expenses/transfer-transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.transfer_transaction_request, + False, + True, + "json", + Optional[shared.TransferTransactionRequest], + ), + 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( + operation_id="create-transfer-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.TransferTransactionResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + 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, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateTransferTransactionRequest, + operations.CreateTransferTransactionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TransferTransactionResponse]: + r"""Create transfer transaction + + Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. + + Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. + + The `from.amount` and `to.amount` fields are in the native currency of the account. + + ### Supported Integrations + | Integration | Supported | + |-----------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Desktop | Yes | + | QuickBooks Online | Yes | + | Xero | Yes | + + :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 + """ + 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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateTransferTransactionRequest + ) + request = cast(operations.CreateTransferTransactionRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/sync/expenses/transfer-transactions/{transactionId}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.transfer_transaction_request, + False, + True, + "json", + Optional[shared.TransferTransactionRequest], + ), + 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( + operation_id="create-transfer-transaction", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.TransferTransactionResponse] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "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, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/types/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/types/__init__.py new file mode 100644 index 000000000..fc76fe0c5 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/types/__init__.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basemodel import ( + BaseModel, + Nullable, + OptionalNullable, + UnrecognizedInt, + UnrecognizedStr, + UNSET, + UNSET_SENTINEL, +) + +__all__ = [ + "BaseModel", + "Nullable", + "OptionalNullable", + "UnrecognizedInt", + "UnrecognizedStr", + "UNSET", + "UNSET_SENTINEL", +] diff --git a/sync-for-expenses/src/codat_sync_for_expenses/types/basemodel.py b/sync-for-expenses/src/codat_sync_for_expenses/types/basemodel.py new file mode 100644 index 000000000..a6187efa6 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/types/basemodel.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from pydantic import ConfigDict, model_serializer +from pydantic import BaseModel as PydanticBaseModel +from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from typing_extensions import TypeAliasType, TypeAlias + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() + ) + + +class Unset(BaseModel): + @model_serializer(mode="plain") + def serialize_model(self): + return UNSET_SENTINEL + + def __bool__(self) -> Literal[False]: + return False + + +UNSET = Unset() +UNSET_SENTINEL = "~?~unset~?~sentinel~?~" + + +T = TypeVar("T") +if TYPE_CHECKING: + Nullable: TypeAlias = Union[T, None] + OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] +else: + Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) + OptionalNullable = TypeAliasType( + "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) + ) + +UnrecognizedInt = NewType("UnrecognizedInt", int) +UnrecognizedStr = NewType("UnrecognizedStr", str) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/__init__.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/__init__.py new file mode 100644 index 000000000..26d51ae8f --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/__init__.py @@ -0,0 +1,97 @@ +"""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 + +__all__ = [ + "BackoffStrategy", + "FieldMetadata", + "find_metadata", + "FormMetadata", + "generate_url", + "get_body_content", + "get_default_logger", + "get_discriminator", + "get_global_from_env", + "get_headers", + "get_pydantic_model", + "get_query_params", + "get_response_headers", + "get_security", + "HeaderMetadata", + "Logger", + "marshal_json", + "match_content_type", + "match_status_codes", + "match_response", + "MultipartFormMetadata", + "OpenEnumMeta", + "PathParamMetadata", + "QueryParamMetadata", + "remove_suffix", + "Retries", + "retry", + "retry_async", + "RetryConfig", + "RequestMetadata", + "SecurityMetadata", + "serialize_decimal", + "serialize_float", + "serialize_int", + "serialize_request_body", + "SerializedRequestBody", + "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", + "template_url", + "unmarshal", + "unmarshal_json", + "validate_decimal", + "validate_const", + "validate_float", + "validate_int", + "validate_open_enum", +] diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/annotations.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/annotations.py new file mode 100644 index 000000000..387874edd --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/annotations.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +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. + + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. + + Returns: + str: The name of the discriminator attribute. + + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() + + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" + + if isinstance(field, dict): + if key in field: + return f'{field[key]}' + + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + 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 None + + + if isinstance(model, list): + for field in model: + discriminator = get_field_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = get_field_discriminator(model) + if discriminator is not None: + return discriminator + + raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/enums.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/enums.py new file mode 100644 index 000000000..c650b10cb --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/enums.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import enum + + +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, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/eventstreaming.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/eventstreaming.py new file mode 100644 index 000000000..74a63f757 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/eventstreaming.py @@ -0,0 +1,238 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import json +from typing import ( + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) +import httpx + +T = TypeVar("T") + + +class EventStream(Generic[T]): + response: httpx.Response + generator: Generator[T, None, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events(response, decoder, sentinel) + + def __iter__(self): + return self + + def __next__(self): + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.response.close() + + +class EventStreamAsync(Generic[T]): + response: httpx.Response + generator: AsyncGenerator[T, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events_async(response, decoder, sentinel) + + def __aiter__(self): + return self + + async def __anext__(self): + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + await self.response.aclose() + + +class ServerEvent: + id: Optional[str] = None + event: Optional[str] = None + data: Optional[str] = None + retry: Optional[int] = None + + +MESSAGE_BOUNDARIES = [ + b"\r\n\r\n", + b"\n\n", + b"\r\r", +] + + +async def stream_events_async( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> AsyncGenerator[T, None]: + buffer = bytearray() + position = 0 + discard = False + 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 + + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard = _parse_event(block, decoder, sentinel) + if event is not None: + yield event + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard = _parse_event(buffer, decoder, sentinel) + if event is not None: + yield event + + +def stream_events( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> Generator[T, None, None]: + buffer = bytearray() + position = 0 + discard = False + 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 + + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard = _parse_event(block, decoder, sentinel) + if event is not None: + yield event + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard = _parse_event(buffer, decoder, sentinel) + if event is not None: + yield event + + +def _parse_event( + raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None +) -> Tuple[Optional[T], bool]: + block = raw.decode() + lines = re.split(r"\r?\n|\r", block) + publish = False + event = ServerEvent() + data = "" + for line in lines: + if not line: + continue + + delim = line.find(":") + 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:] + + if field == "event": + event.event = value + publish = True + elif field == "data": + data += value + "\n" + publish = True + elif field == "id": + event.id = value + publish = True + elif field == "retry": + event.retry = int(value) if value.isdigit() else None + publish = True + + if sentinel and data == f"{sentinel}\n": + return None, True + + 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 + + out = None + if publish: + out = decoder(json.dumps(event.__dict__)) + + return out, False + + +def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): + if len(sequence) > (len(buffer) - position): + return None + + for i, seq in enumerate(sequence): + if buffer[position + i] != seq: + return None + + return sequence diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/forms.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/forms.py new file mode 100644 index 000000000..9f5a731e9 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/forms.py @@ -0,0 +1,208 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .serializers import marshal_json + +from .metadata import ( + FormMetadata, + MultipartFormMetadata, + find_field_metadata, +) +from .values import _is_set, _val_to_string + + +def _populate_form( + field_name: str, + explode: bool, + obj: Any, + delimiter: str, + form: Dict[str, List[str]], +): + if not _is_set(obj): + return form + + if isinstance(obj, BaseModel): + items = [] + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_field_name = obj_field.alias if obj_field.alias is not None else name + if obj_field_name == "": + continue + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + form[obj_field_name] = [_val_to_string(val)] + else: + items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, Dict): + items = [] + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + form[key] = [_val_to_string(value)] + else: + items.append(f"{key}{delimiter}{_val_to_string(value)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + if explode: + if not field_name in form: + form[field_name] = [] + form[field_name].append(_val_to_string(value)) + else: + items.append(_val_to_string(value)) + + if len(items) > 0: + form[field_name] = [delimiter.join([str(item) for item in items])] + else: + form[field_name] = [_val_to_string(obj)] + + return form + + +def serialize_multipart_form( + media_type: str, request: Any +) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: + form: Dict[str, Any] = {} + files: Dict[str, Any] = {} + + if not isinstance(request, BaseModel): + raise TypeError("invalid request body type") + + request_fields: Dict[str, FieldInfo] = request.__class__.model_fields + request_field_types = get_type_hints(request.__class__) + + for name in request_fields: + field = request_fields[name] + + val = getattr(request, name) + if not _is_set(val): + continue + + field_metadata = find_field_metadata(field, MultipartFormMetadata) + if not field_metadata: + continue + + f_name = field.alias if field.alias is not None 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 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 = 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) + else: + files[field_name] = (file_name, content) + elif field_metadata.json: + files[f_name] = ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ) + else: + if isinstance(val, List): + values = [] + + for value in val: + if not _is_set(value): + continue + values.append(_val_to_string(value)) + + form[f_name + "[]"] = values + else: + form[f_name] = _val_to_string(val) + return media_type, form, files + + +def serialize_form_data(data: Any) -> Dict[str, Any]: + form: Dict[str, List[str]] = {} + + if isinstance(data, BaseModel): + data_fields: Dict[str, FieldInfo] = data.__class__.model_fields + data_field_types = get_type_hints(data.__class__) + for name in data_fields: + field = data_fields[name] + + val = getattr(data, name) + if not _is_set(val): + continue + + metadata = find_field_metadata(field, FormMetadata) + if metadata is None: + continue + + f_name = field.alias if field.alias is not None else name + + if metadata.json: + form[f_name] = [marshal_json(val, data_field_types[name])] + else: + if metadata.style == "form": + _populate_form( + f_name, + metadata.explode, + val, + ",", + form, + ) + else: + raise ValueError(f"Invalid form style for field {name}") + elif isinstance(data, Dict): + for key, value in data.items(): + if _is_set(value): + form[key] = [_val_to_string(value)] + else: + raise TypeError(f"Invalid request body type {type(data)} for form data") + + return form diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/headers.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/headers.py new file mode 100644 index 000000000..37864cbbb --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/headers.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + List, + Optional, +) +from httpx import Headers +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + HeaderMetadata, + find_field_metadata, +) + +from .values import _is_set, _populate_from_globals, _val_to_string + + +def get_headers(headers_params: Any, gbls: Optional[Any] = None) -> Dict[str, str]: + headers: Dict[str, str] = {} + + globals_already_populated = [] + if _is_set(headers_params): + globals_already_populated = _populate_headers(headers_params, gbls, headers, []) + if _is_set(gbls): + _populate_headers(gbls, None, headers, globals_already_populated) + + return headers + + +def _populate_headers( + headers_params: Any, + gbls: Any, + header_values: Dict[str, str], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(headers_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = headers_params.__class__.model_fields + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + f_name = field.alias if field.alias is not None else name + + metadata = find_field_metadata(field, HeaderMetadata) + if metadata is None: + continue + + value, global_found = _populate_from_globals( + name, getattr(headers_params, name), HeaderMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + value = _serialize_header(metadata.explode, value) + + if value != "": + header_values[f_name] = value + + return globals_already_populated + + +def _serialize_header(explode: bool, obj: Any) -> str: + if not _is_set(obj): + return "" + + if isinstance(obj, BaseModel): + items = [] + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_param_metadata = find_field_metadata(obj_field, HeaderMetadata) + + if not obj_param_metadata: + continue + + f_name = obj_field.alias if obj_field.alias is not None else name + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + items.append(f"{f_name}={_val_to_string(val)}") + else: + items.append(f_name) + items.append(_val_to_string(val)) + + if len(items) > 0: + return ",".join(items) + elif isinstance(obj, Dict): + items = [] + + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + items.append(f"{key}={_val_to_string(value)}") + else: + items.append(key) + items.append(_val_to_string(value)) + + if len(items) > 0: + return ",".join([str(item) for item in items]) + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + items.append(_val_to_string(value)) + + if len(items) > 0: + return ",".join(items) + elif _is_set(obj): + return f"{_val_to_string(obj)}" + + return "" + + +def get_response_headers(headers: Headers) -> Dict[str, List[str]]: + res: Dict[str, List[str]] = {} + for k, v in headers.items(): + if not k in res: + res[k] = [] + + res[k].append(v) + return res diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/logger.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/logger.py new file mode 100644 index 000000000..b661aff65 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/logger.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Any, Protocol + + +class Logger(Protocol): + def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: + pass + + +class NoOpLogger: + def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: + pass + + +def get_body_content(req: httpx.Request) -> str: + return "" if not hasattr(req, "_content") else str(req.content) + + +def get_default_logger() -> Logger: + return NoOpLogger() diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/metadata.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/metadata.py new file mode 100644 index 000000000..173b3e5ce --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/metadata.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Optional, Type, TypeVar, Union +from dataclasses import dataclass +from pydantic.fields import FieldInfo + + +T = TypeVar("T") + + +@dataclass +class SecurityMetadata: + option: bool = False + scheme: bool = False + scheme_type: Optional[str] = None + sub_type: Optional[str] = None + field_name: Optional[str] = None + + def get_field_name(self, default: str) -> str: + return self.field_name or default + + +@dataclass +class ParamMetadata: + serialization: Optional[str] = None + style: str = "simple" + explode: bool = False + + +@dataclass +class PathParamMetadata(ParamMetadata): + pass + + +@dataclass +class QueryParamMetadata(ParamMetadata): + style: str = "form" + explode: bool = True + + +@dataclass +class HeaderMetadata(ParamMetadata): + pass + + +@dataclass +class RequestMetadata: + media_type: str = "application/octet-stream" + + +@dataclass +class MultipartFormMetadata: + file: bool = False + content: bool = False + json: bool = False + + +@dataclass +class FormMetadata: + json: bool = False + style: str = "form" + explode: bool = True + + +class FieldMetadata: + security: Optional[SecurityMetadata] = None + path: Optional[PathParamMetadata] = None + query: Optional[QueryParamMetadata] = None + header: Optional[HeaderMetadata] = None + request: Optional[RequestMetadata] = None + form: Optional[FormMetadata] = None + multipart: Optional[MultipartFormMetadata] = None + + def __init__( + self, + security: Optional[SecurityMetadata] = None, + path: Optional[Union[PathParamMetadata, bool]] = None, + query: Optional[Union[QueryParamMetadata, bool]] = None, + header: Optional[Union[HeaderMetadata, bool]] = None, + request: Optional[Union[RequestMetadata, bool]] = None, + form: Optional[Union[FormMetadata, bool]] = None, + multipart: Optional[Union[MultipartFormMetadata, bool]] = None, + ): + self.security = security + self.path = PathParamMetadata() if isinstance(path, bool) else path + self.query = QueryParamMetadata() if isinstance(query, bool) else query + self.header = HeaderMetadata() if isinstance(header, bool) else header + self.request = RequestMetadata() if isinstance(request, bool) else request + self.form = FormMetadata() if isinstance(form, bool) else form + self.multipart = ( + MultipartFormMetadata() if isinstance(multipart, bool) else multipart + ) + + +def find_field_metadata(field_info: FieldInfo, metadata_type: Type[T]) -> Optional[T]: + metadata = find_metadata(field_info, FieldMetadata) + if not metadata: + return None + + fields = metadata.__dict__ + + for field in fields: + if isinstance(fields[field], metadata_type): + return fields[field] + + return None + + +def find_metadata(field_info: FieldInfo, metadata_type: Type[T]) -> Optional[T]: + metadata = field_info.metadata + if not metadata: + return None + + for md in metadata: + if isinstance(md, metadata_type): + return md + + return None diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/queryparams.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/queryparams.py new file mode 100644 index 000000000..37a6e7f9a --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/queryparams.py @@ -0,0 +1,205 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, +) + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + QueryParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) +from .forms import _populate_form + + +def get_query_params( + query_params: Any, + gbls: Optional[Any] = None, +) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} + + globals_already_populated = _populate_query_params(query_params, gbls, params, []) + if _is_set(gbls): + _populate_query_params(gbls, None, params, globals_already_populated) + + return params + + +def _populate_query_params( + query_params: Any, + gbls: Any, + query_param_values: Dict[str, List[str]], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(query_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields + param_field_types = get_type_hints(query_params.__class__) + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + + metadata = find_field_metadata(field, QueryParamMetadata) + if not metadata: + continue + + value = getattr(query_params, name) if _is_set(query_params) else None + + value, global_found = _populate_from_globals( + name, value, QueryParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + f_name = field.alias if field.alias is not None else name + serialization = metadata.serialization + if serialization is not None: + serialized_parms = _get_serialized_params( + metadata, f_name, value, param_field_types[name] + ) + for key, value in serialized_parms.items(): + if key in query_param_values: + query_param_values[key].extend(value) + else: + query_param_values[key] = [value] + else: + style = metadata.style + if style == "deepObject": + _populate_deep_object_query_params(f_name, value, query_param_values) + elif style == "form": + _populate_delimited_query_params( + metadata, f_name, value, ",", query_param_values + ) + elif style == "pipeDelimited": + _populate_delimited_query_params( + metadata, f_name, value, "|", query_param_values + ) + else: + raise NotImplementedError( + f"query param style {style} not yet supported" + ) + + return globals_already_populated + + +def _populate_deep_object_query_params( + field_name: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj): + return + + if isinstance(obj, BaseModel): + _populate_deep_object_query_params_basemodel(field_name, obj, params) + elif isinstance(obj, Dict): + _populate_deep_object_query_params_dict(field_name, obj, params) + + +def _populate_deep_object_query_params_basemodel( + prior_params_key: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj) or not isinstance(obj, BaseModel): + return + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + + f_name = obj_field.alias if obj_field.alias is not None else name + + params_key = f"{prior_params_key}[{f_name}]" + + obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) + if not _is_set(obj_param_metadata): + continue + + obj_val = getattr(obj, name) + if not _is_set(obj_val): + continue + + if isinstance(obj_val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, obj_val, params) + elif isinstance(obj_val, Dict): + _populate_deep_object_query_params_dict(params_key, obj_val, params) + elif isinstance(obj_val, List): + _populate_deep_object_query_params_list(params_key, obj_val, params) + else: + params[params_key] = [_val_to_string(obj_val)] + + +def _populate_deep_object_query_params_dict( + prior_params_key: str, + value: Dict, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for key, val in value.items(): + if not _is_set(val): + continue + + params_key = f"{prior_params_key}[{key}]" + + if isinstance(val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, val, params) + elif isinstance(val, Dict): + _populate_deep_object_query_params_dict(params_key, val, params) + elif isinstance(val, List): + _populate_deep_object_query_params_list(params_key, val, params) + else: + params[params_key] = [_val_to_string(val)] + + +def _populate_deep_object_query_params_list( + params_key: str, + value: List, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for val in value: + if not _is_set(val): + continue + + if params.get(params_key) is None: + params[params_key] = [] + + params[params_key].append(_val_to_string(val)) + + +def _populate_delimited_query_params( + metadata: QueryParamMetadata, + field_name: str, + obj: Any, + delimiter: str, + query_param_values: Dict[str, List[str]], +): + _populate_form( + field_name, + metadata.explode, + obj, + delimiter, + query_param_values, + ) diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/requestbodies.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/requestbodies.py new file mode 100644 index 000000000..4f586ae79 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/requestbodies.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import io +from dataclasses import dataclass +import re +from typing import ( + Any, + Optional, +) + +from .forms import serialize_form_data, serialize_multipart_form + +from .serializers import marshal_json + +SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", +} + + +@dataclass +class SerializedRequestBody: + media_type: str + content: Optional[Any] = None + data: Optional[Any] = None + files: Optional[Any] = None + + +def serialize_request_body( + request_body: Any, + nullable: bool, + optional: bool, + serialization_method: str, + request_body_type, +) -> Optional[SerializedRequestBody]: + if request_body is None: + if not nullable and optional: + return None + + media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] + + serialized_request_body = SerializedRequestBody(media_type) + + 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: + ( + 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: + 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 + elif isinstance(request_body, str): + serialized_request_body.content = request_body + else: + raise TypeError( + f"invalid request body type {type(request_body)} for mediaType {media_type}" + ) + + return serialized_request_body diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/retries.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/retries.py new file mode 100644 index 000000000..4d6086716 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/retries.py @@ -0,0 +1,217 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import asyncio +import random +import time +from typing import List + +import httpx + + +class BackoffStrategy: + initial_interval: int + max_interval: int + exponent: float + max_elapsed_time: int + + def __init__( + self, + initial_interval: int, + max_interval: int, + exponent: float, + max_elapsed_time: int, + ): + self.initial_interval = initial_interval + self.max_interval = max_interval + self.exponent = exponent + self.max_elapsed_time = max_elapsed_time + + +class RetryConfig: + strategy: str + backoff: BackoffStrategy + retry_connection_errors: bool + + def __init__( + self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + ): + self.strategy = strategy + self.backoff = backoff + self.retry_connection_errors = retry_connection_errors + + +class Retries: + config: RetryConfig + status_codes: List[str] + + def __init__(self, config: RetryConfig, status_codes: List[str]): + self.config = config + self.status_codes = status_codes + + +class TemporaryError(Exception): + response: httpx.Response + + def __init__(self, response: httpx.Response): + self.response = response + + +class PermanentError(Exception): + inner: Exception + + def __init__(self, inner: Exception): + self.inner = inner + + +def retry(func, retries: Retries): + if retries.config.strategy == "backoff": + + def do_request() -> httpx.Response: + res: httpx.Response + try: + res = func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except httpx.ConnectError as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except httpx.TimeoutException as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return retry_with_backoff( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return func() + + +async def retry_async(func, retries: Retries): + if retries.config.strategy == "backoff": + + async def do_request() -> httpx.Response: + res: httpx.Response + try: + res = await func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except httpx.ConnectError as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except httpx.TimeoutException as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return await retry_with_backoff_async( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return await func() + + +def retry_with_backoff( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = min(sleep, max_interval / 1000) + time.sleep(sleep) + retries += 1 + + +async def retry_with_backoff_async( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return await func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = min(sleep, max_interval / 1000) + await asyncio.sleep(sleep) + retries += 1 diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/security.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/security.py new file mode 100644 index 000000000..295a3f400 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/security.py @@ -0,0 +1,174 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import base64 +from typing import ( + Any, + Dict, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + SecurityMetadata, + find_field_metadata, +) + + +def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: + headers: Dict[str, str] = {} + query_params: Dict[str, List[str]] = {} + + if security is None: + return headers, query_params + + if not isinstance(security, BaseModel): + raise TypeError("security must be a pydantic model") + + sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields + for name in sec_fields: + sec_field = sec_fields[name] + + value = getattr(security, name) + if value is None: + continue + + metadata = find_field_metadata(sec_field, SecurityMetadata) + if metadata is None: + continue + if metadata.option: + _parse_security_option(headers, query_params, value) + return headers, query_params + if metadata.scheme: + # Special case for basic auth or custom auth which could be a flattened model + if metadata.sub_type in ["basic", "custom"] and not isinstance( + value, BaseModel + ): + _parse_security_scheme(headers, query_params, metadata, name, security) + else: + _parse_security_scheme(headers, query_params, metadata, name, value) + + return headers, query_params + + +def _parse_security_option( + headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any +): + if not isinstance(option, BaseModel): + raise TypeError("security option must be a pydantic model") + + opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields + for name in opt_fields: + opt_field = opt_fields[name] + + metadata = find_field_metadata(opt_field, SecurityMetadata) + if metadata is None or not metadata.scheme: + continue + _parse_security_scheme( + headers, query_params, metadata, name, getattr(option, name) + ) + + +def _parse_security_scheme( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + field_name: str, + scheme: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + if isinstance(scheme, BaseModel): + if scheme_type == "http": + if sub_type == "basic": + _parse_basic_auth_scheme(headers, scheme) + return + if sub_type == "custom": + return + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + value = getattr(scheme, name) + + _parse_security_scheme_value( + headers, query_params, scheme_metadata, metadata, name, value + ) + else: + _parse_security_scheme_value( + headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme + ) + + +def _parse_security_scheme_value( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + security_metadata: SecurityMetadata, + field_name: str, + value: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + header_name = security_metadata.get_field_name(field_name) + + if scheme_type == "apiKey": + if sub_type == "header": + headers[header_name] = value + elif sub_type == "query": + query_params[header_name] = [value] + else: + raise ValueError("sub type {sub_type} not supported") + elif scheme_type == "openIdConnect": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "oauth2": + if sub_type != "client_credentials": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "http": + if sub_type == "bearer": + headers[header_name] = _apply_bearer(value) + elif sub_type == "custom": + return + else: + raise ValueError("sub type {sub_type} not supported") + else: + raise ValueError("scheme type {scheme_type} not supported") + + +def _apply_bearer(token: str) -> str: + return token.lower().startswith("bearer ") and token or f"Bearer {token}" + + +def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): + username = "" + password = "" + + if not isinstance(scheme, BaseModel): + raise TypeError("basic auth scheme must be a pydantic model") + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + field_name = metadata.field_name + value = getattr(scheme, name) + + if field_name == "username": + username = value + if field_name == "password": + password = value + + data = f"{username}:{password}".encode() + headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/serializers.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/serializers.py new file mode 100644 index 000000000..c5eb36597 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/serializers.py @@ -0,0 +1,215 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +import json +from typing import Any, Dict, List, Union, get_args +import httpx +from typing_extensions import get_origin +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: + return None + if isinstance(d, Unset): + return d + + if not isinstance(d, Decimal): + raise ValueError("Expected Decimal object") + + return str(d) if as_str else float(d) + + return serialize + + +def validate_decimal(d): + if d is None: + return None + + if isinstance(d, (Decimal, Unset)): + return d + + if not isinstance(d, (str, int, float)): + raise ValueError("Expected string, int or float") + + return Decimal(str(d)) + + +def serialize_float(as_str: bool): + def serialize(f): + if is_optional_type(type(f)) and f is None: + return None + if isinstance(f, Unset): + return f + + if not isinstance(f, float): + raise ValueError("Expected float") + + return str(f) if as_str else f + + return serialize + + +def validate_float(f): + if f is None: + return None + + if isinstance(f, (float, Unset)): + return f + + if not isinstance(f, str): + raise ValueError("Expected string") + + return float(f) + + +def serialize_int(as_str: bool): + def serialize(i): + if is_optional_type(type(i)) and i is None: + return None + if isinstance(i, Unset): + return i + + if not isinstance(i, int): + raise ValueError("Expected int") + + return str(i) if as_str else i + + return serialize + + +def validate_int(b): + if b is None: + return None + + if isinstance(b, (int, Unset)): + return b + + if not isinstance(b, str): + raise ValueError("Expected string") + + 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: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + +def unmarshal_json(raw, typ: Any) -> Any: + return unmarshal(from_json(raw), typ) + + +def unmarshal(val, typ: Any) -> Any: + unmarshaller = create_model( + "Unmarshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = unmarshaller(body=val) + + # pyright: ignore[reportAttributeAccessIssue] + return m.body # type: ignore + + +def marshal_json(val, typ): + if is_nullable(typ) and val is None: + return "null" + + marshaller = create_model( + "Marshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = marshaller(body=val) + + d = m.model_dump(by_alias=True, mode="json", exclude_none=True) + + if len(d) == 0: + return "" + + return json.dumps(d[next(iter(d))], separators=(",", ":"), sort_keys=True) + + +def is_nullable(field): + origin = get_origin(field) + if origin is Nullable or origin is OptionalNullable: + return True + + if not origin is Union or type(None) not in get_args(field): + return False + + for arg in get_args(field): + if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: + return True + + return False + + +def stream_to_text(stream: httpx.Response) -> str: + return "".join(stream.iter_text()) + + +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + +def get_pydantic_model(data: Any, typ: Any) -> Any: + if not _contains_pydantic_model(data): + return unmarshal(data, typ) + + return data + + +def _contains_pydantic_model(data: Any) -> bool: + if isinstance(data, BaseModel): + return True + if isinstance(data, List): + return any(_contains_pydantic_model(item) for item in data) + if isinstance(data, Dict): + return any(_contains_pydantic_model(value) for value in data.values()) + + return False diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/url.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/url.py new file mode 100644 index 000000000..c78ccbae4 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/url.py @@ -0,0 +1,155 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, + Union, + get_args, + get_origin, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + PathParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) + + +def generate_url( + server_url: str, + path: str, + path_params: Any, + gbls: Optional[Any] = None, +) -> str: + path_param_values: Dict[str, str] = {} + + globals_already_populated = _populate_path_params( + path_params, gbls, path_param_values, [] + ) + if _is_set(gbls): + _populate_path_params(gbls, None, path_param_values, globals_already_populated) + + for key, value in path_param_values.items(): + path = path.replace("{" + key + "}", value, 1) + + return remove_suffix(server_url, "/") + path + + +def _populate_path_params( + path_params: Any, + gbls: Any, + path_param_values: Dict[str, str], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(path_params, BaseModel): + return globals_already_populated + + path_param_fields: Dict[str, FieldInfo] = path_params.__class__.model_fields + path_param_field_types = get_type_hints(path_params.__class__) + for name in path_param_fields: + if name in skip_fields: + continue + + field = path_param_fields[name] + + param_metadata = find_field_metadata(field, PathParamMetadata) + if param_metadata is None: + continue + + param = getattr(path_params, name) if _is_set(path_params) else None + param, global_found = _populate_from_globals( + name, param, PathParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + if not _is_set(param): + continue + + f_name = field.alias if field.alias is not None else name + serialization = param_metadata.serialization + if serialization is not None: + serialized_params = _get_serialized_params( + param_metadata, f_name, param, path_param_field_types[name] + ) + for key, value in serialized_params.items(): + path_param_values[key] = value + else: + pp_vals: List[str] = [] + if param_metadata.style == "simple": + if isinstance(param, List): + for pp_val in param: + if not _is_set(pp_val): + continue + pp_vals.append(_val_to_string(pp_val)) + path_param_values[f_name] = ",".join(pp_vals) + elif isinstance(param, Dict): + for pp_key in param: + if not _is_set(param[pp_key]): + continue + if param_metadata.explode: + pp_vals.append(f"{pp_key}={_val_to_string(param[pp_key])}") + else: + pp_vals.append(f"{pp_key},{_val_to_string(param[pp_key])}") + path_param_values[f_name] = ",".join(pp_vals) + elif not isinstance(param, (str, int, float, complex, bool, Decimal)): + param_fields: Dict[str, FieldInfo] = param.__class__.model_fields + for name in param_fields: + param_field = param_fields[name] + + param_value_metadata = find_field_metadata( + param_field, PathParamMetadata + ) + if param_value_metadata is None: + continue + + param_name = ( + param_field.alias if param_field.alias is not None else name + ) + + param_field_val = getattr(param, name) + if not _is_set(param_field_val): + continue + if param_metadata.explode: + pp_vals.append( + f"{param_name}={_val_to_string(param_field_val)}" + ) + else: + pp_vals.append( + f"{param_name},{_val_to_string(param_field_val)}" + ) + path_param_values[f_name] = ",".join(pp_vals) + elif _is_set(param): + path_param_values[f_name] = _val_to_string(param) + + return globals_already_populated + + +def is_optional(field): + return get_origin(field) is Union and type(None) in get_args(field) + + +def template_url(url_with_params: str, params: Dict[str, str]) -> str: + for key, value in params.items(): + url_with_params = url_with_params.replace("{" + key + "}", value) + + return url_with_params + + +def remove_suffix(input_string, suffix): + if suffix and input_string.endswith(suffix): + return input_string[: -len(suffix)] + return input_string diff --git a/sync-for-expenses/src/codat_sync_for_expenses/utils/values.py b/sync-for-expenses/src/codat_sync_for_expenses/utils/values.py new file mode 100644 index 000000000..2b4b68321 --- /dev/null +++ b/sync-for-expenses/src/codat_sync_for_expenses/utils/values.py @@ -0,0 +1,134 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +from enum import Enum +from email.message import Message +import os +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union + +from httpx import Response +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from ..types.basemodel import Unset + +from .serializers import marshal_json + +from .metadata import ParamMetadata, find_field_metadata + + +def match_content_type(content_type: str, pattern: str) -> bool: + if pattern in (content_type, "*", "*/*"): + return True + + msg = Message() + msg["content-type"] = content_type + media_type = msg.get_content_type() + + if media_type == pattern: + return True + + parts = media_type.split("/") + if len(parts) == 2: + if pattern in (f"{parts[0]}/*", f"*/{parts[1]}"): + return True + + return False + + +def match_status_codes(status_codes: List[str], status_code: int) -> bool: + if "default" in status_codes: + return True + + for code in status_codes: + if code == str(status_code): + return True + + if code.endswith("XX") and code.startswith(str(status_code)[:1]): + return True + return False + + +T = TypeVar("T") + + +def get_global_from_env( + value: Optional[T], env_key: str, type_cast: Callable[[str], T] +) -> Optional[T]: + if value is not None: + return value + env_value = os.getenv(env_key) + if env_value is not None: + try: + return type_cast(env_value) + except ValueError: + pass + return None + + +def match_response( + response: Response, code: Union[str, List[str]], content_type: str +) -> bool: + codes = code if isinstance(code, list) else [code] + return match_status_codes(codes, response.status_code) and match_content_type( + response.headers.get("content-type", "application/octet-stream"), content_type + ) + + +def _populate_from_globals( + param_name: str, value: Any, param_metadata_type: type, gbls: Any +) -> Tuple[Any, bool]: + if gbls is None: + return value, False + + if not isinstance(gbls, BaseModel): + raise TypeError("globals must be a pydantic model") + + global_fields: Dict[str, FieldInfo] = gbls.__class__.model_fields + found = False + for name in global_fields: + field = global_fields[name] + if name is not param_name: + continue + + found = True + + if value is not None: + return value, True + + global_value = getattr(gbls, name) + + param_metadata = find_field_metadata(field, param_metadata_type) + if param_metadata is None: + return value, True + + return global_value, True + + return value, found + + +def _val_to_string(val) -> str: + if isinstance(val, bool): + return str(val).lower() + if isinstance(val, datetime): + return str(val.isoformat().replace("+00:00", "Z")) + if isinstance(val, Enum): + return str(val.value) + + return str(val) + + +def _get_serialized_params( + metadata: ParamMetadata, field_name: str, obj: Any, typ: type +) -> Dict[str, str]: + params: Dict[str, str] = {} + + serialization = metadata.serialization + if serialization == "json": + params[field_name] = marshal_json(obj, typ) + + return params + + +def _is_set(value: Any) -> bool: + return value is not None and not isinstance(value, Unset) diff --git a/sync-for-expenses/src/codatsyncexpenses/__init__.py b/sync-for-expenses/src/codatsyncexpenses/__init__.py deleted file mode 100644 index e6c0deeb6..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdk import * -from .sdkconfiguration import * diff --git a/sync-for-expenses/src/codatsyncexpenses/_hooks/__init__.py b/sync-for-expenses/src/codatsyncexpenses/_hooks/__init__.py deleted file mode 100644 index 5fd985a8a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/_hooks/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdkhooks import * -from .types import * -from .registration import * diff --git a/sync-for-expenses/src/codatsyncexpenses/accounts.py b/sync-for-expenses/src/codatsyncexpenses/accounts.py deleted file mode 100644 index f2a36a5ce..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/accounts.py +++ /dev/null @@ -1,200 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Accounts: - r"""Accounts""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateAccountRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateAccountResponse: - r"""Create account - The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. - - [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - - **Integration-specific behaviour** - - Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. - """ - hook_ctx = HookContext(operation_id='create-account', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}/push/accounts', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateAccountRequest, "account_prototype", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateAccountResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateAccountResponse]) - res.create_account_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_create_model(self, request: operations.GetCreateChartOfAccountsModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateChartOfAccountsModelResponse: - r"""Get create account model - The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. - - [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - - **Integration-specific behaviour** - - See the *response examples* for integration-specific indicative models. - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. - """ - hook_ctx = HookContext(operation_id='get-create-chartOfAccounts-model', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCreateChartOfAccountsModelResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) - res.push_option = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/attachments.py b/sync-for-expenses/src/codatsyncexpenses/attachments.py deleted file mode 100644 index a9e923e27..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/attachments.py +++ /dev/null @@ -1,115 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Attachments: - r"""Upload attachmens to expenses, transfers and reimbursable expense transactions.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def upload(self, request: operations.UploadExpenseAttachmentRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UploadExpenseAttachmentResponse: - r"""Upload attachment - The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. - - [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. - - **Integration-specific behaviour** - - Each accounting software supports different file formats and sizes. - - | Integration | File Size | File Extension | - |-------------|-------------|--------------------------------------------------------------------------------------------------------------| - | Xero | 4MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | - | QuickBooks Online | 100MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | - | NetSuite | 100MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | - | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that \"You can attach any type of file, such as text, image, or video files\". | - """ - hook_ctx = HookContext(operation_id='upload-expense-attachment', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UploadExpenseAttachmentRequest, "attachment_upload", False, True, 'multipart') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UploadExpenseAttachmentResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Attachment]) - res.attachment = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/companies.py b/sync-for-expenses/src/codatsyncexpenses/companies.py deleted file mode 100644 index 283034e2f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/companies.py +++ /dev/null @@ -1,443 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Companies: - r"""Create and manage your Codat companies.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse: - r"""Create company - Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. - - A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - - 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`. - """ - hook_ctx = HookContext(operation_id='create-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = base_url + '/companies' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CompanyRequestBody], "request", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteCompanyResponse: - r"""Delete a company - The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. - - A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - """ - hook_ctx = HookContext(operation_id='delete-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.DeleteCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 204: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCompanyResponse: - r"""Get company - The *Get company* endpoint returns a single company for a given `companyId`. - - A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - """ - hook_ctx = HookContext(operation_id='get-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListCompaniesResponse: - r"""List companies - The *List companies* endpoint returns a list of [companies] associated to your instances. - - A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - """ - hook_ctx = HookContext(operation_id='list-companies', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = base_url + '/companies' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListCompaniesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Companies]) - res.companies = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateCompanyResponse: - r"""Update company - Use the *Update company* endpoint to update both the name and description of the company. - If you use [groups](https://docs.codat.io/sync-for-expenses-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/sync-for-expenses-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/sync-for-expenses-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. - - A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - """ - hook_ctx = HookContext(operation_id='update-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCompanyRequest, "company_request_body", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/configuration.py b/sync-for-expenses/src/codatsyncexpenses/configuration.py deleted file mode 100644 index 58cf7d7d8..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/configuration.py +++ /dev/null @@ -1,264 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Configuration: - r"""Manage mapping options and sync configuration.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, request: operations.GetCompanyConfigurationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCompanyConfigurationResponse: - r"""Get company configuration - Gets a companies expense sync configuration - """ - hook_ctx = HookContext(operation_id='get-company-configuration', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/config', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCompanyConfigurationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CompanyConfiguration]) - res.company_configuration = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_mapping_options(self, request: operations.GetMappingOptionsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetMappingOptionsResponse: - r"""Mapping options - Gets the expense mapping options for a companies accounting software - """ - hook_ctx = HookContext(operation_id='get-mapping-options', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/mappingOptions', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetMappingOptionsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.MappingOptions]) - res.mapping_options = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def set(self, request: operations.SetCompanyConfigurationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.SetCompanyConfigurationResponse: - r"""Set company configuration - Sets a companies expense sync configuration - """ - hook_ctx = HookContext(operation_id='set-company-configuration', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/config', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.SetCompanyConfigurationRequest, "company_configuration", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.SetCompanyConfigurationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CompanyConfiguration]) - res.company_configuration = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/connections.py b/sync-for-expenses/src/codatsyncexpenses/connections.py deleted file mode 100644 index fb72120bc..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/connections.py +++ /dev/null @@ -1,509 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Connections: - r"""Create and manage partner expense connection.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateConnectionResponse: - r"""Create connection - Creates a connection for the company by providing a valid `platformKey`. - - Use the [List Integrations](https://docs.codat.io/sync-for-expenses-api#/operations/list-integrations) endpoint to access valid platform keys. - """ - hook_ctx = HookContext(operation_id='create-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateConnectionRequest, "request_body", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def create_partner_expense_connection(self, request: operations.CreatePartnerExpenseConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreatePartnerExpenseConnectionResponse: - r"""Create partner expense connection - Creates a partner expense data connection - """ - hook_ctx = HookContext(operation_id='create-partner-expense-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/connections/partnerExpense', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreatePartnerExpenseConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteConnectionResponse: - r"""Delete connection - Revoke and remove a connection from a company. - This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - """ - hook_ctx = HookContext(operation_id='delete-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.DeleteConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetConnectionResponse: - r"""Get connection - Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - """ - hook_ctx = HookContext(operation_id='get-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListConnectionsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListConnectionsResponse: - r"""List connections - List the connections for a company. - """ - hook_ctx = HookContext(operation_id='list-connections', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListConnectionsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connections]) - res.connections = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UnlinkConnectionResponse: - r"""Unlink connection - This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - """ - hook_ctx = HookContext(operation_id='unlink-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UnlinkConnectionRequest, "request_body", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PATCH', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UnlinkConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/customers.py b/sync-for-expenses/src/codatsyncexpenses/customers.py deleted file mode 100644 index 4e0437391..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/customers.py +++ /dev/null @@ -1,377 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Customers: - r"""Customers""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateCustomerRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateCustomerResponse: - r"""Create customer - The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - - [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - - **Integration-specific behaviour** - - Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support creating an account. - """ - hook_ctx = HookContext(operation_id='create-customer', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}/push/customers', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateCustomerRequest, "customer", True, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateCustomerResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateCustomerResponse]) - res.create_customer_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetCustomerRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCustomerResponse: - r"""Get customer - The *Get customer* endpoint returns a single customer for a given customerId. - - [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a specific customer. - - Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - """ - hook_ctx = HookContext(operation_id='get-customer', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/customers/{customerId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','409','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCustomerResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Customer]) - res.customer = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 409, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListCustomersRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListCustomersResponse: - r"""List customers - The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - - [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - - Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - """ - hook_ctx = HookContext(operation_id='list-customers', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/customers', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','409','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListCustomersResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Customers]) - res.customers = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 409, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateCustomerRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateCustomerResponse: - r"""Update customer - The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - - [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - - **Integration-specific behaviour** - - Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support creating an account. - """ - hook_ctx = HookContext(operation_id='update-customer', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}/push/customers/{customerId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCustomerRequest, "customer", True, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateCustomerResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.UpdateCustomerResponse]) - res.update_customer_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/expenses.py b/sync-for-expenses/src/codatsyncexpenses/expenses.py deleted file mode 100644 index f970a1a1e..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/expenses.py +++ /dev/null @@ -1,207 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Expenses: - r"""Create expense transactions.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateExpenseTransactionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateExpenseTransactionResponse: - r"""Create expense transaction - The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting platform for a given company's connection. - - [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. - - - **Integration-specific behaviour** - - Some accounting platforms support the option of pushing transactions to a draft state. This can be done by setting the postAsDraft property on the transaction to true. For platforms without this feature, the postAsDraft property should be ignored or set to false. - - | Integration | Draft State | Details | - |-------------|-------------|--------------------------------------------------------------------------------------------------------------| - | Dynamics 365 Business Central | Yes | Setting postAsDraft to true will push the transactions to a drafted state rather than posting directly to the ledger. For transactions in a draft state, they can then be approved and posted within the accounting platform. | - | Quickbooks Online | No | - | - | Xero | No | - | - | NetSuite | No | - | - """ - hook_ctx = HookContext(operation_id='create-expense-transaction', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/data/expense-transactions', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateExpenseTransactionRequest, "create_expense_request", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateExpenseTransactionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateExpenseResponse]) - res.create_expense_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateExpenseTransactionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateExpenseTransactionResponse: - r"""Update expense transactions - The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting platform for a given company's connection. - - [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. - - - **Integration-specific behaviour** - - At the moment you can update expenses only for Xero ([Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction type only). - """ - hook_ctx = HookContext(operation_id='update-expense-transaction', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateExpenseTransactionRequest, "update_expense_request", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','422','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateExpenseTransactionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 202: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.UpdateExpenseResponse]) - res.update_expense_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 422, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/manage_data.py b/sync-for-expenses/src/codatsyncexpenses/manage_data.py deleted file mode 100644 index b9252b35f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/manage_data.py +++ /dev/null @@ -1,426 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Dict, Optional - -class ManageData: - r"""Asynchronously retrieve data from an integration to refresh data in Codat.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, request: operations.GetDataStatusRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetDataStatusResponse: - r"""Get data status - Get the state of each data type for a company - """ - hook_ctx = HookContext(operation_id='get-data-status', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/dataStatus', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetDataStatusResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[Dict[str, shared.DataStatus]]) - res.data_statuses = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_pull_operation(self, request: operations.GetPullOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPullOperationResponse: - r"""Get pull operation - Retrieve information about a single dataset or pull operation. - """ - hook_ctx = HookContext(operation_id='get-pull-operation', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/history/{datasetId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetPullOperationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) - res.pull_operation = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list_pull_operations(self, request: operations.ListPullOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPullOperationsResponse: - r"""List pull operations - Gets the pull operation history (datasets) for a given company. - """ - hook_ctx = HookContext(operation_id='list-pull-operations', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/history', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListPullOperationsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) - res.pull_operations = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def refresh_all_data_types(self, request: operations.RefreshAllDataTypesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshAllDataTypesResponse: - r"""Refresh all data - Refreshes all data types with `fetch on first link` set to `true` for a given company. - - This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - - [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - """ - hook_ctx = HookContext(operation_id='refresh-all-data-types', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/all', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.RefreshAllDataTypesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 204: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def refresh_data_type(self, request: operations.RefreshDataTypeRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshDataTypeResponse: - r"""Refresh data type - Refreshes a given data type for a given company. - - This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - """ - hook_ctx = HookContext(operation_id='refresh-data-type', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/queue/{dataType}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.RefreshDataTypeResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) - res.pull_operation = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/__init__.py b/sync-for-expenses/src/codatsyncexpenses/models/__init__.py deleted file mode 100644 index 722bb9982..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - - -# package diff --git a/sync-for-expenses/src/codatsyncexpenses/models/errors/__init__.py b/sync-for-expenses/src/codatsyncexpenses/models/errors/__init__.py deleted file mode 100644 index bf15fd116..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/errors/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .errormessage import * -from .sdkerror import * - -__all__ = ["ErrorMessage","SDKError"] diff --git a/sync-for-expenses/src/codatsyncexpenses/models/errors/errormessage.py b/sync-for-expenses/src/codatsyncexpenses/models/errors/errormessage.py deleted file mode 100644 index e89b1edc2..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/errors/errormessage.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from ...models.shared import errorvalidation as shared_errorvalidation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) - -@dataclasses.dataclass -class ErrorMessage(Exception): - r"""The request made is not valid.""" - UNSET='__SPEAKEASY_UNSET__' - can_be_retried: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('canBeRetried'), 'exclude': lambda f: f is None }}) - r"""`True` if the error occurred transiently and can be retried.""" - correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" - detailed_error_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detailedErrorCode'), 'exclude': lambda f: f is None }}) - r"""Machine readable error code used to automate processes based on the code returned.""" - error: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error'), 'exclude': lambda f: f is None }}) - r"""A brief description of the error.""" - service: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('service'), 'exclude': lambda f: f is None }}) - r"""Codat's service the returned the error.""" - status_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) - r"""The HTTP status code returned by the error.""" - validation: Optional[shared_errorvalidation.ErrorValidation] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is ErrorMessage.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.""" - - - def __str__(self) -> str: - return utils.marshal_json(self, type(self)) diff --git a/sync-for-expenses/src/codatsyncexpenses/models/errors/sdkerror.py b/sync-for-expenses/src/codatsyncexpenses/models/errors/sdkerror.py deleted file mode 100644 index 6bb02bbd6..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/errors/sdkerror.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http - - -class SDKError(Exception): - """Represents an error returned by the API.""" - message: str - status_code: int - body: str - raw_response: requests_http.Response - - def __init__(self, message: str, status_code: int, body: str, raw_response: requests_http.Response): - self.message = message - self.status_code = status_code - self.body = body - self.raw_response = raw_response - - def __str__(self): - body = '' - if len(self.body) > 0: - body = f'\n{self.body}' - - return f'{self.message}: Status {self.status_code}{body}' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/__init__.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/__init__.py deleted file mode 100644 index cf96bfa51..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/__init__.py +++ /dev/null @@ -1,48 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .create_account import * -from .create_company import * -from .create_connection import * -from .create_customer import * -from .create_expense_transaction import * -from .create_partner_expense_connection import * -from .create_reimbursable_expense_transaction import * -from .create_supplier import * -from .create_transfer_transaction import * -from .delete_company import * -from .delete_connection import * -from .get_company import * -from .get_company_configuration import * -from .get_connection import * -from .get_create_chartofaccounts_model import * -from .get_customer import * -from .get_data_status import * -from .get_last_successful_sync import * -from .get_latest_sync import * -from .get_mapping_options import * -from .get_pull_operation import * -from .get_push_operation import * -from .get_supplier import * -from .get_sync_by_id import * -from .get_sync_transaction import * -from .initiate_sync import * -from .list_companies import * -from .list_connections import * -from .list_customers import * -from .list_pull_operations import * -from .list_push_operations import * -from .list_suppliers import * -from .list_sync_transactions import * -from .list_syncs import * -from .refresh_all_data_types import * -from .refresh_data_type import * -from .set_company_configuration import * -from .unlink_connection import * -from .update_company import * -from .update_customer import * -from .update_expense_transaction import * -from .update_reimbursable_expense_transaction import * -from .update_supplier import * -from .upload_expense_attachment import * - -__all__ = ["CreateAccountRequest","CreateAccountResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateCustomerRequest","CreateCustomerResponse","CreateExpenseTransactionRequest","CreateExpenseTransactionResponse","CreatePartnerExpenseConnectionRequest","CreatePartnerExpenseConnectionResponse","CreateReimbursableExpenseTransactionRequest","CreateReimbursableExpenseTransactionResponse","CreateSupplierRequest","CreateSupplierResponse","CreateTransferTransactionRequest","CreateTransferTransactionResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","GetCompanyConfigurationRequest","GetCompanyConfigurationResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","GetCreateChartOfAccountsModelRequest","GetCreateChartOfAccountsModelResponse","GetCustomerRequest","GetCustomerResponse","GetDataStatusRequest","GetDataStatusResponse","GetLastSuccessfulSyncRequest","GetLastSuccessfulSyncResponse","GetLatestSyncRequest","GetLatestSyncResponse","GetMappingOptionsRequest","GetMappingOptionsResponse","GetPullOperationRequest","GetPullOperationResponse","GetPushOperationRequest","GetPushOperationResponse","GetSupplierRequest","GetSupplierResponse","GetSyncByIDRequest","GetSyncByIDResponse","GetSyncTransactionRequest","GetSyncTransactionResponse","InitiateSyncRequest","InitiateSyncResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListCustomersRequest","ListCustomersResponse","ListPullOperationsRequest","ListPullOperationsResponse","ListPushOperationsRequest","ListPushOperationsResponse","ListSuppliersRequest","ListSuppliersResponse","ListSyncTransactionsRequest","ListSyncTransactionsResponse","ListSyncsRequest","ListSyncsResponse","RefreshAllDataTypesRequest","RefreshAllDataTypesResponse","RefreshDataTypeRequest","RefreshDataTypeResponse","SetCompanyConfigurationRequest","SetCompanyConfigurationResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UnlinkConnectionUpdateConnection","UpdateCompanyRequest","UpdateCompanyResponse","UpdateCustomerRequest","UpdateCustomerResponse","UpdateExpenseTransactionRequest","UpdateExpenseTransactionResponse","UpdateReimbursableExpenseTransactionRequest","UpdateReimbursableExpenseTransactionResponse","UpdateSupplierRequest","UpdateSupplierResponse","UploadExpenseAttachmentRequest","UploadExpenseAttachmentResponse"] diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_account.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_account.py deleted file mode 100644 index d3518e85f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_account.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import accountprototype as shared_accountprototype -from ...models.shared import createaccountresponse as shared_createaccountresponse -from typing import Optional - - -@dataclasses.dataclass -class CreateAccountRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - account_prototype: Optional[shared_accountprototype.AccountPrototype] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - allow_sync_on_push_complete: Optional[bool] = dataclasses.field(default=True, metadata={'query_param': { 'field_name': 'allowSyncOnPushComplete', 'style': 'form', 'explode': True }}) - r"""Allow a sync upon push completion.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) - r"""Time limit for the push operation to complete before it is timed out.""" - - - - -@dataclasses.dataclass -class CreateAccountResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_account_response: Optional[shared_createaccountresponse.CreateAccountResponse] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_company.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_company.py deleted file mode 100644 index d7751fcaf..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_company.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import company as shared_company -from typing import Optional - - -@dataclasses.dataclass -class CreateCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_connection.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_connection.py deleted file mode 100644 index 60e47c30d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_connection.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateConnectionRequestBody: - platform_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformKey'), 'exclude': lambda f: f is 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.""" - - - - -@dataclasses.dataclass -class CreateConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - request_body: Optional[CreateConnectionRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class CreateConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_customer.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_customer.py deleted file mode 100644 index 4100d3c7a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_customer.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import createcustomerresponse as shared_createcustomerresponse -from ...models.shared import customer as shared_customer -from typing import Optional - - -@dataclasses.dataclass -class CreateCustomerRequest: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - customer: Optional[shared_customer.Customer] = dataclasses.field(default=UNSET, metadata={'request': { 'media_type': 'application/json' }}) - allow_sync_on_push_complete: Optional[bool] = dataclasses.field(default=True, metadata={'query_param': { 'field_name': 'allowSyncOnPushComplete', 'style': 'form', 'explode': True }}) - r"""Allow a sync upon push completion.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) - r"""Time limit for the push operation to complete before it is timed out.""" - - - - -@dataclasses.dataclass -class CreateCustomerResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_customer_response: Optional[shared_createcustomerresponse.CreateCustomerResponse] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_expense_transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_expense_transaction.py deleted file mode 100644 index 875623e16..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_expense_transaction.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import createexpenserequest as shared_createexpenserequest -from ...models.shared import createexpenseresponse as shared_createexpenseresponse -from typing import Optional - - -@dataclasses.dataclass -class CreateExpenseTransactionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - create_expense_request: Optional[shared_createexpenserequest.CreateExpenseRequest] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class CreateExpenseTransactionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_expense_response: Optional[shared_createexpenseresponse.CreateExpenseResponse] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_partner_expense_connection.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_partner_expense_connection.py deleted file mode 100644 index c77e6e944..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_partner_expense_connection.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from typing import Optional - - -@dataclasses.dataclass -class CreatePartnerExpenseConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class CreatePartnerExpenseConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_reimbursable_expense_transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_reimbursable_expense_transaction.py deleted file mode 100644 index 46bac0ba1..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_reimbursable_expense_transaction.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import createreimbursableexpenserequest as shared_createreimbursableexpenserequest -from ...models.shared import createreimbursableexpenseresponse as shared_createreimbursableexpenseresponse -from typing import Optional - - -@dataclasses.dataclass -class CreateReimbursableExpenseTransactionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - create_reimbursable_expense_request: Optional[shared_createreimbursableexpenserequest.CreateReimbursableExpenseRequest] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class CreateReimbursableExpenseTransactionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_reimbursable_expense_response: Optional[shared_createreimbursableexpenseresponse.CreateReimbursableExpenseResponse] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_supplier.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_supplier.py deleted file mode 100644 index 8550e10e2..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_supplier.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import createsupplierresponse as shared_createsupplierresponse -from ...models.shared import supplier as shared_supplier -from typing import Optional - - -@dataclasses.dataclass -class CreateSupplierRequest: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - supplier: Optional[shared_supplier.Supplier] = dataclasses.field(default=UNSET, metadata={'request': { 'media_type': 'application/json' }}) - allow_sync_on_push_complete: Optional[bool] = dataclasses.field(default=True, metadata={'query_param': { 'field_name': 'allowSyncOnPushComplete', 'style': 'form', 'explode': True }}) - r"""Allow a sync upon push completion.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) - r"""Time limit for the push operation to complete before it is timed out.""" - - - - -@dataclasses.dataclass -class CreateSupplierResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_supplier_response: Optional[shared_createsupplierresponse.CreateSupplierResponse] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_transfer_transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/create_transfer_transaction.py deleted file mode 100644 index 25434fb17..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/create_transfer_transaction.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import createtransferrequest as shared_createtransferrequest -from ...models.shared import createtransferresponse as shared_createtransferresponse -from typing import Optional - - -@dataclasses.dataclass -class CreateTransferTransactionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - transaction_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'transactionId', 'style': 'simple', 'explode': False }}) - r"""The unique identifier for your SMB's transaction.""" - create_transfer_request: Optional[shared_createtransferrequest.CreateTransferRequest] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class CreateTransferTransactionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_transfer_response: Optional[shared_createtransferresponse.CreateTransferResponse] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/delete_company.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/delete_company.py deleted file mode 100644 index e544df054..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/delete_company.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DeleteCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class DeleteCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/delete_connection.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/delete_connection.py deleted file mode 100644 index f6a77abb5..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/delete_connection.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DeleteConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class DeleteConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_company.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_company.py deleted file mode 100644 index 65e6aba22..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_company.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import company as shared_company -from typing import Optional - - -@dataclasses.dataclass -class GetCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_company_configuration.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_company_configuration.py deleted file mode 100644 index c187bf7d3..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_company_configuration.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companyconfiguration as shared_companyconfiguration -from typing import Optional - - -@dataclasses.dataclass -class GetCompanyConfigurationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetCompanyConfigurationResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company_configuration: Optional[shared_companyconfiguration.CompanyConfiguration] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_connection.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_connection.py deleted file mode 100644 index 083a24ed2..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_connection.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from typing import Optional - - -@dataclasses.dataclass -class GetConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class GetConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_create_chartofaccounts_model.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_create_chartofaccounts_model.py deleted file mode 100644 index db617ad13..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_create_chartofaccounts_model.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import pushoption as shared_pushoption -from typing import Optional - - -@dataclasses.dataclass -class GetCreateChartOfAccountsModelRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class GetCreateChartOfAccountsModelResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_customer.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_customer.py deleted file mode 100644 index ace38e272..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_customer.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import customer as shared_customer -from typing import Optional - - -@dataclasses.dataclass -class GetCustomerRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - customer_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customerId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a customer.""" - - - - -@dataclasses.dataclass -class GetCustomerResponse: - UNSET='__SPEAKEASY_UNSET__' - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - customer: Optional[shared_customer.Customer] = dataclasses.field(default=UNSET) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_data_status.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_data_status.py deleted file mode 100644 index 23cfdc107..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_data_status.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import datastatus as shared_datastatus -from typing import Dict, Optional - - -@dataclasses.dataclass -class GetDataStatusRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetDataStatusResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - data_statuses: Optional[Dict[str, shared_datastatus.DataStatus]] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_last_successful_sync.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_last_successful_sync.py deleted file mode 100644 index 0ea1b275b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_last_successful_sync.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companysyncstatus as shared_companysyncstatus -from typing import Optional - - -@dataclasses.dataclass -class GetLastSuccessfulSyncRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetLastSuccessfulSyncResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company_sync_status: Optional[shared_companysyncstatus.CompanySyncStatus] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_latest_sync.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_latest_sync.py deleted file mode 100644 index 870412d8a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_latest_sync.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companysyncstatus as shared_companysyncstatus -from typing import Optional - - -@dataclasses.dataclass -class GetLatestSyncRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetLatestSyncResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company_sync_status: Optional[shared_companysyncstatus.CompanySyncStatus] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_mapping_options.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_mapping_options.py deleted file mode 100644 index 2525beaf6..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_mapping_options.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import mappingoptions as shared_mappingoptions -from typing import Optional - - -@dataclasses.dataclass -class GetMappingOptionsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetMappingOptionsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - mapping_options: Optional[shared_mappingoptions.MappingOptions] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_pull_operation.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_pull_operation.py deleted file mode 100644 index ecdbbb805..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_pull_operation.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import pulloperation as shared_pulloperation -from typing import Optional - - -@dataclasses.dataclass -class GetPullOperationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - dataset_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'datasetId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for the dataset that completed its sync.""" - - - - -@dataclasses.dataclass -class GetPullOperationResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_push_operation.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_push_operation.py deleted file mode 100644 index bcca4f62d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_push_operation.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import pushoperation as shared_pushoperation -from typing import Optional - - -@dataclasses.dataclass -class GetPushOperationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - push_operation_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'pushOperationKey', 'style': 'simple', 'explode': False }}) - r"""Push operation key.""" - - - - -@dataclasses.dataclass -class GetPushOperationResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - push_operation: Optional[shared_pushoperation.PushOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_supplier.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_supplier.py deleted file mode 100644 index 3a7996908..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_supplier.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import supplier as shared_supplier -from typing import Optional - - -@dataclasses.dataclass -class GetSupplierRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - supplier_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'supplierId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a supplier.""" - - - - -@dataclasses.dataclass -class GetSupplierResponse: - UNSET='__SPEAKEASY_UNSET__' - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - supplier: Optional[shared_supplier.Supplier] = dataclasses.field(default=UNSET) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_sync_by_id.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_sync_by_id.py deleted file mode 100644 index 0f00bd02c..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_sync_by_id.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companysyncstatus as shared_companysyncstatus -from typing import Optional - - -@dataclasses.dataclass -class GetSyncByIDRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - sync_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'syncId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a sync.""" - - - - -@dataclasses.dataclass -class GetSyncByIDResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company_sync_status: Optional[shared_companysyncstatus.CompanySyncStatus] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_sync_transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/get_sync_transaction.py deleted file mode 100644 index c8559d9bc..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/get_sync_transaction.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import transaction as shared_transaction -from typing import List, Optional - - -@dataclasses.dataclass -class GetSyncTransactionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - sync_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'syncId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a sync.""" - transaction_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'transactionId', 'style': 'simple', 'explode': False }}) - r"""The unique identifier for your SMB's transaction.""" - - - - -@dataclasses.dataclass -class GetSyncTransactionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - transaction_response: Optional[List[shared_transaction.Transaction]] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/initiate_sync.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/initiate_sync.py deleted file mode 100644 index 2856806e8..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/initiate_sync.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import initiatesync as shared_initiatesync -from ...models.shared import syncinitiated as shared_syncinitiated -from typing import Optional - - -@dataclasses.dataclass -class InitiateSyncRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - initiate_sync: Optional[shared_initiatesync.InitiateSync] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class InitiateSyncResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - sync_initiated: Optional[shared_syncinitiated.SyncInitiated] = dataclasses.field(default=None) - r"""Returns the newly created syncId""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_companies.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_companies.py deleted file mode 100644 index 41f52fdfb..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_companies.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companies as shared_companies -from typing import Optional - - -@dataclasses.dataclass -class ListCompaniesRequest: - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListCompaniesResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - companies: Optional[shared_companies.Companies] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_connections.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_connections.py deleted file mode 100644 index e4665b548..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_connections.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connections as shared_connections -from typing import Optional - - -@dataclasses.dataclass -class ListConnectionsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListConnectionsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connections: Optional[shared_connections.Connections] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_customers.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_customers.py deleted file mode 100644 index ae1a0d67b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_customers.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import customers as shared_customers -from typing import Optional - - -@dataclasses.dataclass -class ListCustomersRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListCustomersResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - customers: Optional[shared_customers.Customers] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_pull_operations.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_pull_operations.py deleted file mode 100644 index d25577197..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_pull_operations.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import pulloperations as shared_pulloperations -from typing import Optional - - -@dataclasses.dataclass -class ListPullOperationsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListPullOperationsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - pull_operations: Optional[shared_pulloperations.PullOperations] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_push_operations.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_push_operations.py deleted file mode 100644 index 97806aade..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_push_operations.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import pushoperations as shared_pushoperations -from typing import Optional - - -@dataclasses.dataclass -class ListPushOperationsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListPushOperationsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - push_operations: Optional[shared_pushoperations.PushOperations] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_suppliers.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_suppliers.py deleted file mode 100644 index fe6f22f49..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_suppliers.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import suppliers as shared_suppliers -from typing import Optional - - -@dataclasses.dataclass -class ListSuppliersRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListSuppliersResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - suppliers: Optional[shared_suppliers.Suppliers] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_sync_transactions.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_sync_transactions.py deleted file mode 100644 index f85c22eaa..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_sync_transactions.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import transactions as shared_transactions -from typing import Optional - - -@dataclasses.dataclass -class ListSyncTransactionsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - sync_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'syncId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a sync.""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - - - - -@dataclasses.dataclass -class ListSyncTransactionsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - transactions: Optional[shared_transactions.Transactions] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_syncs.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/list_syncs.py deleted file mode 100644 index 2b6e0413f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/list_syncs.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companysyncstatus as shared_companysyncstatus -from typing import List, Optional - - -@dataclasses.dataclass -class ListSyncsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class ListSyncsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - classes: Optional[List[shared_companysyncstatus.CompanySyncStatus]] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/refresh_all_data_types.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/refresh_all_data_types.py deleted file mode 100644 index 043fdd704..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/refresh_all_data_types.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class RefreshAllDataTypesRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class RefreshAllDataTypesResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/refresh_data_type.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/refresh_data_type.py deleted file mode 100644 index 1c2f20d9f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/refresh_data_type.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import pulloperation as shared_pulloperation -from ...models.shared import schema_datatype as shared_schema_datatype -from typing import Optional - - -@dataclasses.dataclass -class RefreshDataTypeRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - data_type: shared_schema_datatype.SchemaDataType = dataclasses.field(metadata={'path_param': { 'field_name': 'dataType', 'style': 'simple', 'explode': False }}) - r"""The key of a Codat data type""" - connection_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'connectionId', 'style': 'form', 'explode': True }}) - r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" - - - - -@dataclasses.dataclass -class RefreshDataTypeResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/set_company_configuration.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/set_company_configuration.py deleted file mode 100644 index 15118b04a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/set_company_configuration.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companyconfiguration as shared_companyconfiguration -from typing import Optional - - -@dataclasses.dataclass -class SetCompanyConfigurationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - company_configuration: Optional[shared_companyconfiguration.CompanyConfiguration] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class SetCompanyConfigurationResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company_configuration: Optional[shared_companyconfiguration.CompanyConfiguration] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/unlink_connection.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/unlink_connection.py deleted file mode 100644 index fdbba5aeb..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/unlink_connection.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from ...models.shared import dataconnectionstatus as shared_dataconnectionstatus -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UnlinkConnectionUpdateConnection: - status: Optional[shared_dataconnectionstatus.DataConnectionStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""The current authorization status of the data connection.""" - - - - -@dataclasses.dataclass -class UnlinkConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - request_body: Optional[UnlinkConnectionUpdateConnection] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UnlinkConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_company.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/update_company.py deleted file mode 100644 index 4eae4a4d0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_company.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import company as shared_company -from ...models.shared import companyrequestbody as shared_companyrequestbody -from typing import Optional - - -@dataclasses.dataclass -class UpdateCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - company_request_body: Optional[shared_companyrequestbody.CompanyRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UpdateCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_customer.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/update_customer.py deleted file mode 100644 index b272d05c3..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_customer.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import customer as shared_customer -from ...models.shared import updatecustomerresponse as shared_updatecustomerresponse -from typing import Optional - - -@dataclasses.dataclass -class UpdateCustomerRequest: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - customer_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customerId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a customer.""" - customer: Optional[shared_customer.Customer] = dataclasses.field(default=UNSET, metadata={'request': { 'media_type': 'application/json' }}) - allow_sync_on_push_complete: Optional[bool] = dataclasses.field(default=True, metadata={'query_param': { 'field_name': 'allowSyncOnPushComplete', 'style': 'form', 'explode': True }}) - r"""Allow a sync upon push completion.""" - force_update: Optional[bool] = dataclasses.field(default=False, metadata={'query_param': { 'field_name': 'forceUpdate', 'style': 'form', 'explode': True }}) - r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) - r"""Time limit for the push operation to complete before it is timed out.""" - - - - -@dataclasses.dataclass -class UpdateCustomerResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - update_customer_response: Optional[shared_updatecustomerresponse.UpdateCustomerResponse] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_expense_transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/update_expense_transaction.py deleted file mode 100644 index 89beb553d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_expense_transaction.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import updateexpenserequest as shared_updateexpenserequest -from ...models.shared import updateexpenseresponse as shared_updateexpenseresponse -from typing import Optional - - -@dataclasses.dataclass -class UpdateExpenseTransactionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - transaction_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'transactionId', 'style': 'simple', 'explode': False }}) - r"""The unique identifier for your SMB's transaction.""" - update_expense_request: Optional[shared_updateexpenserequest.UpdateExpenseRequest] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UpdateExpenseTransactionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - update_expense_response: Optional[shared_updateexpenseresponse.UpdateExpenseResponse] = dataclasses.field(default=None) - r"""Accepted""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_reimbursable_expense_transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/update_reimbursable_expense_transaction.py deleted file mode 100644 index 25c992d22..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_reimbursable_expense_transaction.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import createreimbursableexpenserequest as shared_createreimbursableexpenserequest -from ...models.shared import createreimbursableexpenseresponse as shared_createreimbursableexpenseresponse -from typing import Optional - - -@dataclasses.dataclass -class UpdateReimbursableExpenseTransactionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - transaction_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'transactionId', 'style': 'simple', 'explode': False }}) - r"""The unique identifier for your SMB's transaction.""" - create_reimbursable_expense_request: Optional[shared_createreimbursableexpenserequest.CreateReimbursableExpenseRequest] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UpdateReimbursableExpenseTransactionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - create_reimbursable_expense_response: Optional[shared_createreimbursableexpenseresponse.CreateReimbursableExpenseResponse] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_supplier.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/update_supplier.py deleted file mode 100644 index 55b47bb57..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/update_supplier.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import supplier as shared_supplier -from ...models.shared import updatesupplierresponse as shared_updatesupplierresponse -from typing import Optional - - -@dataclasses.dataclass -class UpdateSupplierRequest: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - supplier_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'supplierId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a supplier.""" - supplier: Optional[shared_supplier.Supplier] = dataclasses.field(default=UNSET, metadata={'request': { 'media_type': 'application/json' }}) - allow_sync_on_push_complete: Optional[bool] = dataclasses.field(default=True, metadata={'query_param': { 'field_name': 'allowSyncOnPushComplete', 'style': 'form', 'explode': True }}) - r"""Allow a sync upon push completion.""" - force_update: Optional[bool] = dataclasses.field(default=False, metadata={'query_param': { 'field_name': 'forceUpdate', 'style': 'form', 'explode': True }}) - r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) - r"""Time limit for the push operation to complete before it is timed out.""" - - - - -@dataclasses.dataclass -class UpdateSupplierResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - update_supplier_response: Optional[shared_updatesupplierresponse.UpdateSupplierResponse] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/operations/upload_expense_attachment.py b/sync-for-expenses/src/codatsyncexpenses/models/operations/upload_expense_attachment.py deleted file mode 100644 index 9f637907b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/operations/upload_expense_attachment.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import attachment as shared_attachment -from ...models.shared import attachmentupload as shared_attachmentupload -from typing import Optional - - -@dataclasses.dataclass -class UploadExpenseAttachmentRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - sync_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'syncId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a sync.""" - transaction_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'transactionId', 'style': 'simple', 'explode': False }}) - r"""The unique identifier for your SMB's transaction.""" - attachment_upload: Optional[shared_attachmentupload.AttachmentUpload] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'multipart/form-data' }}) - - - - -@dataclasses.dataclass -class UploadExpenseAttachmentResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - attachment: Optional[shared_attachment.Attachment] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/__init__.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/__init__.py deleted file mode 100644 index 9f7333258..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/__init__.py +++ /dev/null @@ -1,101 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .accountingaddresstype import * -from .accountmappinginfo import * -from .accountprototype import * -from .accountref import * -from .accountstatus import * -from .accounttype import * -from .attachment import * -from .attachmentupload import * -from .bankaccount import * -from .clientratelimitreachedwebhook import * -from .clientratelimitreachedwebhookdata import * -from .clientratelimitresetwebhook import * -from .clientratelimitresetwebhookdata import * -from .codatfile import * -from .companies import * -from .company import * -from .companyconfiguration import * -from .companyrequestbody import * -from .companysyncstatus import * -from .connection import * -from .connections import * -from .contact import * -from .contactref import * -from .createaccountresponse import * -from .createcustomerresponse import * -from .createexpenserequest import * -from .createexpenseresponse import * -from .createreimbursableexpenserequest import * -from .createreimbursableexpenseresponse import * -from .createsupplierresponse import * -from .createtransferrequest import * -from .createtransferresponse import * -from .customer import * -from .customerdetails import * -from .customers import * -from .customerstatus import * -from .dataconnectionerror import * -from .dataconnectionstatus import * -from .datastatus import * -from .datatype import * -from .errorvalidation import * -from .errorvalidationitem import * -from .expensetransaction import * -from .expensetransactionline import * -from .group_items import * -from .halref import * -from .initiatesync import * -from .integrationtype import * -from .invoiceto import * -from .items import * -from .links import * -from .mappingoptions import * -from .metadata import * -from .phonenumbertype import * -from .pulloperation import * -from .pulloperations import * -from .pushchangetype import * -from .pushfieldvalidation import * -from .pushoperation import * -from .pushoperationchange import * -from .pushoperationref import * -from .pushoperations import * -from .pushoperationstatus import * -from .pushoption import * -from .pushoptionchoice import * -from .pushoptionproperty import * -from .pushoptiontype import * -from .pushvalidationinfo import * -from .recordref import * -from .reimbursableexpensetransaction import * -from .reimbursableexpensetransactionline import * -from .schema_datatype import * -from .security import * -from .supplementaldata import * -from .supplier import * -from .supplierdetails import * -from .suppliers import * -from .supplierstatus import * -from .synccompletewebhook import * -from .synccompletewebhookdata import * -from .syncfailedwebhook import * -from .syncfailedwebhookdata import * -from .syncinitiated import * -from .syncstartedwebhook import * -from .taxratemappinginfo import * -from .trackingcategorymappinginfo import * -from .trackingref import * -from .transaction import * -from .transactions import * -from .transactionstatus import * -from .transferdetails import * -from .updatecustomerresponse import * -from .updateexpenserequest import * -from .updateexpenseresponse import * -from .updatesupplierresponse import * -from .validation import * -from .validationitem import * - -__all__ = ["AccountMappingInfo","AccountMappingInfoAccountType","AccountPrototype","AccountRef","AccountStatus","AccountType","AccountingAccount","AccountingAddress","AccountingAddressType","AccountingCustomer","AccountingSupplier","Attachment","AttachmentUpload","BankAccount","BankAccountReference","ClientRateLimitReachedWebhook","ClientRateLimitReachedWebhookData","ClientRateLimitResetWebhook","ClientRateLimitResetWebhookData","CodatFile","Companies","Company","CompanyConfiguration","CompanyRequestBody","CompanySyncStatus","Connection","Connections","Contact","ContactRef","CreateAccountResponse","CreateAccountResponseMetadata","CreateAccountResponseValidDataTypeLinks","CreateCustomerResponse","CreateCustomerResponseAccountingAddress","CreateExpenseRequest","CreateExpenseResponse","CreateReimbursableExpenseRequest","CreateReimbursableExpenseResponse","CreateSupplierResponse","CreateTransferRequest","CreateTransferResponse","Customer","CustomerDetails","CustomerStatus","Customers","Data","DataConnectionError","DataConnectionStatus","DataStatus","DataType","DataTypes","ErrorValidation","ErrorValidationItem","ExpenseTransaction","ExpenseTransactionBankAccountReference","ExpenseTransactionLine","ExpenseTransactionType","GroupItems","GroupReference","HalRef","InitiateSync","IntegrationType","InvoiceTo","InvoiceToDataType","Items","Links","MappingOptions","Metadata","Phone","PhoneNumberType","PullOperation","PullOperations","PushChangeType","PushFieldValidation","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperations","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","RecordRef","ReimbursableExpenseTransaction","ReimbursableExpenseTransactionLine","SchemaDataType","Security","SourceType","Status","SupplementalData","Supplier","SupplierDetails","SupplierStatus","Suppliers","SyncCompleteWebhook","SyncCompleteWebhookData","SyncFailedWebhook","SyncFailedWebhookData","SyncInitiated","SyncStartedWebhook","TaxRateMappingInfo","TaxRateMappingInfoValidTransactionTypes","TrackingCategoryMappingInfo","TrackingRef","TrackingRefDataType","Transaction","TransactionStatus","Transactions","TransferDetails","Type","UpdateCustomerResponse","UpdateCustomerResponseAccountingAddress","UpdateCustomerResponseAccountingCustomer","UpdateExpenseRequest","UpdateExpenseRequestBankAccountReference","UpdateExpenseResponse","UpdateSupplierResponse","UpdateSupplierResponseAccountingSupplier","ValidDataTypeLinks","ValidTransactionTypes","Validation","ValidationItem"] diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountingaddresstype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/accountingaddresstype.py deleted file mode 100644 index d8bad9974..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountingaddresstype.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class AccountingAddressType(str, Enum): - r"""The type of the address""" - UNKNOWN = 'Unknown' - BILLING = 'Billing' - DELIVERY = 'Delivery' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountmappinginfo.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/accountmappinginfo.py deleted file mode 100644 index cc621b1c8..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountmappinginfo.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import List, Optional - -class AccountMappingInfoAccountType(str, Enum): - r"""Type of the account.""" - ASSET = 'Asset' - LIABILITY = 'Liability' - INCOME = 'Income' - EXPENSE = 'Expense' - EQUITY = 'Equity' - -class ValidTransactionTypes(str, Enum): - PAYMENT = 'Payment' - REFUND = 'Refund' - REWARD = 'Reward' - CHARGEBACK = 'Chargeback' - TRANSFER_IN = 'TransferIn' - TRANSFER_OUT = 'TransferOut' - ADJUSTMENT_IN = 'AdjustmentIn' - ADJUSTMENT_OUT = 'AdjustmentOut' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountMappingInfo: - UNSET='__SPEAKEASY_UNSET__' - account_type: Optional[AccountMappingInfoAccountType] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountType'), 'exclude': lambda f: f is AccountMappingInfo.UNSET }}) - r"""Type of the account.""" - currency: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is AccountMappingInfo.UNSET }}) - r"""Currency of the account.""" - id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is AccountMappingInfo.UNSET }}) - r"""Unique identifier of account.""" - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is AccountMappingInfo.UNSET }}) - r"""Name of the account as it appears in the companies accounting software.""" - valid_transaction_types: Optional[List[ValidTransactionTypes]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validTransactionTypes'), 'exclude': lambda f: f is AccountMappingInfo.UNSET }}) - r"""Supported transaction types for the account.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountprototype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/accountprototype.py deleted file mode 100644 index d8f721cf0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountprototype.py +++ /dev/null @@ -1,113 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountstatus import AccountStatus -from .accounttype import AccountType -from .supplementaldata import SupplementalData -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ValidDataTypeLinks: - r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. - - For example, `validDatatypeLinks` might indicate the following references: - - - Which tax rates are valid to use on the line item of a bill. - - Which items can be used when creating an invoice. - - You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. - - ## `validDatatypeLinks` example - - The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. - - ```json validDatatypeLinks for an account - { - \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", - \"nominalCode\": \"090\", - \"name\": \"Business Bank Account\", - #... - \"validDatatypeLinks\": [ - { - \"property\": \"Id\", - \"links\": [ - \"Payment.AccountRef.Id\", - \"BillPayment.AccountRef.Id\", - \"DirectIncome.LineItems.AccountRef.Id\", - \"DirectCost.LineItems.AccountRef.Id\" - ] - } - ] - } - ``` - - - - ## Support for `validDatatypeLinks` - - Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. - - If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. - """ - UNSET='__SPEAKEASY_UNSET__' - links: Optional[List[str]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('links'), 'exclude': lambda f: f is ValidDataTypeLinks.UNSET }}) - r"""Supported `dataTypes` that the record can be linked to.""" - property: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('property'), 'exclude': lambda f: f is ValidDataTypeLinks.UNSET }}) - r"""The property from the account that can be linked.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountPrototype: - UNSET='__SPEAKEASY_UNSET__' - currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) - r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - - ## Unknown currencies - - In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - - There are only a very small number of edge cases where this currency code is returned by the Codat system. - """ - current_balance: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentBalance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""Current balance in the account.""" - description: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""Description for the account.""" - fully_qualified_category: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fullyQualifiedCategory'), 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""Full category of the account. - - For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. - """ - fully_qualified_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fullyQualifiedName'), 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""Full name of the account, for example: - - `Cash On Hand` - - `Rents Held In Trust` - - `Fixed Asset` - """ - is_bank_account: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isBankAccount'), 'exclude': lambda f: f is None }}) - r"""Confirms whether the account is a bank account or not.""" - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""Name of the account.""" - nominal_code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('nominalCode'), 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""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.""" - status: Optional[AccountStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""Status of the account""" - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - type: Optional[AccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Type of account""" - valid_datatype_links: Optional[List[ValidDataTypeLinks]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validDatatypeLinks'), 'exclude': lambda f: f is AccountPrototype.UNSET }}) - r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks).""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountref.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/accountref.py deleted file mode 100644 index 7e6262d98..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountref.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountRef: - r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""'id' from the Accounts data type.""" - name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) - r"""'name' from the Accounts data type.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/accountstatus.py deleted file mode 100644 index 2335b70e5..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/accountstatus.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class AccountStatus(str, Enum): - r"""Status of the account""" - UNKNOWN = 'Unknown' - ACTIVE = 'Active' - ARCHIVED = 'Archived' - PENDING = 'Pending' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/accounttype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/accounttype.py deleted file mode 100644 index 0ae490aa0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/accounttype.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class AccountType(str, Enum): - r"""Type of account""" - UNKNOWN = 'Unknown' - ASSET = 'Asset' - EXPENSE = 'Expense' - INCOME = 'Income' - LIABILITY = 'Liability' - EQUITY = 'Equity' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/attachment.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/attachment.py deleted file mode 100644 index c913350f6..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/attachment.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Attachment: - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is None }}) - r"""Unique ID of company in Codat""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of attachment""" - transaction_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('transactionId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of transaction""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/attachmentupload.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/attachmentupload.py deleted file mode 100644 index 5ff7f47c9..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/attachmentupload.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .codatfile import CodatFile - - -@dataclasses.dataclass -class AttachmentUpload: - file: CodatFile = dataclasses.field(metadata={'multipart_form': { 'file': True }}) - r"""The file to be uploaded as an attachment.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/bankaccount.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/bankaccount.py deleted file mode 100644 index 2ad68940c..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/bankaccount.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BankAccount: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""The id of the account from which purchases are made""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitreachedwebhook.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitreachedwebhook.py deleted file mode 100644 index ae0fc1fc7..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitreachedwebhook.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .clientratelimitreachedwebhookdata import ClientRateLimitReachedWebhookData -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitReachedWebhook: - r"""Webhook request body for a client that has reached their rate limit.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - data: Optional[ClientRateLimitReachedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human-readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitreachedwebhookdata.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitreachedwebhookdata.py deleted file mode 100644 index 48ce6840d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitreachedwebhookdata.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitReachedWebhookData: - daily_quota: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DailyQuota'), 'exclude': lambda f: f is None }}) - r"""The number of available requests per day.""" - expires_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ExpiresUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitresetwebhook.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitresetwebhook.py deleted file mode 100644 index 28acbe5ff..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitresetwebhook.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .clientratelimitresetwebhookdata import ClientRateLimitResetWebhookData -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitResetWebhook: - r"""Webhook request body for a client that has had their rate limit reset.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - data: Optional[ClientRateLimitResetWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human-readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitresetwebhookdata.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitresetwebhookdata.py deleted file mode 100644 index 735f8dc1b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/clientratelimitresetwebhookdata.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitResetWebhookData: - UNSET='__SPEAKEASY_UNSET__' - daily_quota: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DailyQuota'), 'exclude': lambda f: f is None }}) - r"""The number of available requests per day.""" - expires_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ExpiresUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - quota_remaining: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('QuotaRemaining'), 'exclude': lambda f: f is ClientRateLimitResetWebhookData.UNSET }}) - r"""Total number of requests remaining for your client.""" - reset_reason: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ResetReason'), 'exclude': lambda f: f is None }}) - r"""The reason for your rate limit quota being reset.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/codatfile.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/codatfile.py deleted file mode 100644 index 3a08327c7..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/codatfile.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses - - -@dataclasses.dataclass -class CodatFile: - content: bytes = dataclasses.field(metadata={'multipart_form': { 'content': True }}) - file_name: str = dataclasses.field(metadata={'multipart_form': { 'field_name': 'fileName' }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/companies.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/companies.py deleted file mode 100644 index ba2a40289..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/companies.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .company import Company -from .links import Links -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Companies: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Company]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/company.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/company.py deleted file mode 100644 index 649479870..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/company.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connection import Connection -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class GroupReference: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the group.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Company: - r"""In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - - Typically each company is one of your customers. - - When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. - """ - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier for your SMB in Codat.""" - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""The name of the company""" - redirect: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('redirect') }}) - r"""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.""" - created: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - created_by_user_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdByUserName'), 'exclude': lambda f: f is None }}) - r"""Name of user that created the company in Codat.""" - data_connections: Optional[List[Connection]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnections'), 'exclude': lambda f: f is None }}) - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" - groups: Optional[List[GroupReference]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groups'), 'exclude': lambda f: f is None }}) - r"""An array of groups the company has been assigned to.""" - last_sync: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSync'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - platform: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platform'), 'exclude': lambda f: f is None }}) - r"""`platformKeys` name used when creating the company. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/companyconfiguration.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/companyconfiguration.py deleted file mode 100644 index c989bb2a0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/companyconfiguration.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .bankaccount import BankAccount -from .customerdetails import CustomerDetails -from .supplierdetails import SupplierDetails -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CompanyConfiguration: - bank_account: BankAccount = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bankAccount') }}) - customer: CustomerDetails = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customer') }}) - supplier: SupplierDetails = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplier') }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/companyrequestbody.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/companyrequestbody.py deleted file mode 100644 index 10c0e3874..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/companyrequestbody.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .group_items import GroupItems -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CompanyRequestBody: - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""Name of company being connected.""" - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" - groups: Optional[List[GroupItems]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groups'), 'exclude': lambda f: f is None }}) - r"""Reference to the groups that the company is assigned to.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/companysyncstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/companysyncstatus.py deleted file mode 100644 index 57013a448..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/companysyncstatus.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CompanySyncStatus: - UNSET='__SPEAKEASY_UNSET__' - company_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is CompanySyncStatus.UNSET }}) - r"""Unique identifier for your SMB in Codat.""" - data_pushed: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataPushed'), 'exclude': lambda f: f is None }}) - r"""Boolean of whether the sync resulted in data being pushed.""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is CompanySyncStatus.UNSET }}) - r"""Error message of the sync.""" - sync_exception_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncExceptionMessage'), 'exclude': lambda f: f is CompanySyncStatus.UNSET }}) - r"""Exception message of the sync.""" - sync_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is CompanySyncStatus.UNSET }}) - r"""Unique identifier of the sync.""" - sync_status: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncStatus'), 'exclude': lambda f: f is CompanySyncStatus.UNSET }}) - r"""Text status of the sync.""" - sync_status_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncStatusCode'), 'exclude': lambda f: f is None }}) - r"""Status code of the sync.""" - sync_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/connection.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/connection.py deleted file mode 100644 index e13a5c02e..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/connection.py +++ /dev/null @@ -1,99 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .dataconnectionerror import DataConnectionError -from .dataconnectionstatus import DataConnectionStatus -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Any, Dict, List, Optional - -class SourceType(str, Enum): - r"""The type of platform of the connection.""" - ACCOUNTING = 'Accounting' - BANKING = 'Banking' - BANK_FEED = 'BankFeed' - COMMERCE = 'Commerce' - EXPENSE = 'Expense' - OTHER = 'Other' - UNKNOWN = 'Unknown' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Connection: - r"""A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - - A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - - - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. - - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. - - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. - Any combination of accounting, banking, and commerce data connections is allowed. - - Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). - """ - created: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created') }}) - 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. - """ - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier for a company's data connection.""" - integration_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationId') }}) - r"""A Codat ID representing the integration.""" - integration_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationKey') }}) - r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" - link_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('linkUrl') }}) - r"""The link URL your customers can use to authorize access to their business application.""" - platform_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformName') }}) - r"""Name of integration connected to company.""" - source_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceId') }}) - r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" - source_type: SourceType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceType') }}) - r"""The type of platform of the connection.""" - status: DataConnectionStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current authorization status of the data connection.""" - additional_properties: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('additionalProperties'), 'exclude': lambda f: f is None }}) - connection_info: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionInfo'), 'exclude': lambda f: f is None }}) - data_connection_errors: Optional[List[DataConnectionError]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionErrors'), 'exclude': lambda f: f is None }}) - last_sync: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSync'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/connections.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/connections.py deleted file mode 100644 index 78b9ac150..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/connections.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connection import Connection -from .links import Links -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Connections: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Connection]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/contact.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/contact.py deleted file mode 100644 index 9b95c5519..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/contact.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .customerstatus import CustomerStatus -from .items import Items -from .phonenumbertype import PhoneNumberType -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Phone: - UNSET='__SPEAKEASY_UNSET__' - type: PhoneNumberType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The type of phone number""" - number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('number'), 'exclude': lambda f: f is Phone.UNSET }}) - r"""A phone number.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Contact: - UNSET='__SPEAKEASY_UNSET__' - status: CustomerStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of customer.""" - address: Optional[Items] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('address'), 'exclude': lambda f: f is None }}) - email: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('email'), 'exclude': lambda f: f is Contact.UNSET }}) - r"""Email of a contact for a customer.""" - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is Contact.UNSET }}) - r"""Name of a contact for a customer.""" - phone: Optional[List[Phone]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is Contact.UNSET }}) - r"""An array of Phone numbers.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/contactref.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/contactref.py deleted file mode 100644 index 44da65e7a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/contactref.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Optional - -class Type(str, Enum): - r"""The type of contact.""" - SUPPLIER = 'Supplier' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ContactRef: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier of supplier or customer.""" - type: Optional[Type] = dataclasses.field(default=Type.SUPPLIER, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""The type of contact.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createaccountresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createaccountresponse.py deleted file mode 100644 index 3a22ba516..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createaccountresponse.py +++ /dev/null @@ -1,239 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountstatus import AccountStatus -from .accounttype import AccountType -from .datatype import DataType -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .supplementaldata import SupplementalData -from .validation import Validation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateAccountResponseMetadata: - UNSET='__SPEAKEASY_UNSET__' - is_deleted: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isDeleted'), 'exclude': lambda f: f is CreateAccountResponseMetadata.UNSET }}) - r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateAccountResponseValidDataTypeLinks: - r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. - - For example, `validDatatypeLinks` might indicate the following references: - - - Which tax rates are valid to use on the line item of a bill. - - Which items can be used when creating an invoice. - - You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. - - ## `validDatatypeLinks` example - - The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. - - ```json validDatatypeLinks for an account - { - \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", - \"nominalCode\": \"090\", - \"name\": \"Business Bank Account\", - #... - \"validDatatypeLinks\": [ - { - \"property\": \"Id\", - \"links\": [ - \"Payment.AccountRef.Id\", - \"BillPayment.AccountRef.Id\", - \"DirectIncome.LineItems.AccountRef.Id\", - \"DirectCost.LineItems.AccountRef.Id\" - ] - } - ] - } - ``` - - - - ## Support for `validDatatypeLinks` - - Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. - - If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. - """ - UNSET='__SPEAKEASY_UNSET__' - links: Optional[List[str]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('links'), 'exclude': lambda f: f is CreateAccountResponseValidDataTypeLinks.UNSET }}) - r"""Supported `dataTypes` that the record can be linked to.""" - property: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('property'), 'exclude': lambda f: f is CreateAccountResponseValidDataTypeLinks.UNSET }}) - r"""The property from the account that can be linked.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountingAccount: - r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. - - View the coverage for accounts in the Data coverage explorer. - - ## Overview - - Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. - - The categories for an account include: - * Asset - * Expense - * Income - * Liability - * Equity. - - The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. - - At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. - - To determine the list of allowed categories for a specific integration, you can: - - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). - - Refer to the integration's own documentation. - - > **Accounts with no category** - > - > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. - > - > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. - - Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. - """ - UNSET='__SPEAKEASY_UNSET__' - currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) - r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - - ## Unknown currencies - - In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - - There are only a very small number of edge cases where this currency code is returned by the Codat system. - """ - current_balance: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentBalance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""Current balance in the account.""" - description: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""Description for the account.""" - fully_qualified_category: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fullyQualifiedCategory'), 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""Full category of the account. - - For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. - """ - fully_qualified_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fullyQualifiedName'), 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""Full name of the account, for example: - - `Cash On Hand` - - `Rents Held In Trust` - - `Fixed Asset` - """ - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the account, unique for the company.""" - is_bank_account: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isBankAccount'), 'exclude': lambda f: f is None }}) - r"""Confirms whether the account is a bank account or not.""" - metadata: Optional[CreateAccountResponseMetadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""Name of the account.""" - nominal_code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('nominalCode'), 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""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.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - status: Optional[AccountStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""Status of the account""" - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - type: Optional[AccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Type of account""" - valid_datatype_links: Optional[List[CreateAccountResponseValidDataTypeLinks]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validDatatypeLinks'), 'exclude': lambda f: f is AccountingAccount.UNSET }}) - r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks).""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateAccountResponse: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is CreateAccountResponse.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data: Optional[AccountingAccount] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is CreateAccountResponse.UNSET }}) - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is CreateAccountResponse.UNSET }}) - r"""A message about the error.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is CreateAccountResponse.UNSET }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is CreateAccountResponse.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createcustomerresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createcustomerresponse.py deleted file mode 100644 index 7499ea1ad..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createcustomerresponse.py +++ /dev/null @@ -1,169 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountingaddresstype import AccountingAddressType -from .contact import Contact -from .customerstatus import CustomerStatus -from .datatype import DataType -from .metadata import Metadata -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .supplementaldata import SupplementalData -from .validation import Validation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateCustomerResponseAccountingAddress: - UNSET='__SPEAKEASY_UNSET__' - type: AccountingAddressType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The type of the address""" - city: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is CreateCustomerResponseAccountingAddress.UNSET }}) - r"""City of the customer address.""" - country: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('country'), 'exclude': lambda f: f is CreateCustomerResponseAccountingAddress.UNSET }}) - r"""Country of the customer address.""" - line1: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line1'), 'exclude': lambda f: f is CreateCustomerResponseAccountingAddress.UNSET }}) - r"""Line 1 of the customer address.""" - line2: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line2'), 'exclude': lambda f: f is CreateCustomerResponseAccountingAddress.UNSET }}) - r"""Line 2 of the customer address.""" - postal_code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postalCode'), 'exclude': lambda f: f is CreateCustomerResponseAccountingAddress.UNSET }}) - r"""Postal code or zip code.""" - region: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('region'), 'exclude': lambda f: f is CreateCustomerResponseAccountingAddress.UNSET }}) - r"""Region of the customer address.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountingCustomer: - r"""> View the coverage for customers in the Data coverage explorer. - - ## Overview - - A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - - Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - - Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. - """ - UNSET='__SPEAKEASY_UNSET__' - status: CustomerStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of customer.""" - addresses: Optional[List[CreateCustomerResponseAccountingAddress]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""An array of Addresses.""" - contact_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""Name of the main contact for the identified customer.""" - contacts: Optional[List[Contact]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contacts'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""An array of Contacts.""" - customer_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customerName'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""Name of the customer as recorded in the accounting system, typically the company name.""" - default_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is None }}) - r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - - ## Unknown currencies - - In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - - There are only a very small number of edge cases where this currency code is returned by the Codat system. - """ - email_address: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""Email address the customer can be contacted by.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the customer, unique to the company in the accounting platform.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""Phone number the customer can be contacted by.""" - registration_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""Company number. In the UK, this is typically the Companies House company registration number.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - tax_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is AccountingCustomer.UNSET }}) - r"""Company tax number.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateCustomerResponse: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is CreateCustomerResponse.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data: Optional[AccountingCustomer] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is CreateCustomerResponse.UNSET }}) - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is CreateCustomerResponse.UNSET }}) - r"""A message about the error.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is CreateCustomerResponse.UNSET }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is CreateCustomerResponse.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createexpenserequest.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createexpenserequest.py deleted file mode 100644 index b3d74debe..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createexpenserequest.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .expensetransaction import ExpenseTransaction -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateExpenseRequest: - items: Optional[List[ExpenseTransaction]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('items'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createexpenseresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createexpenseresponse.py deleted file mode 100644 index fda894c3c..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createexpenseresponse.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateExpenseResponse: - dataset_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datasetId'), 'exclude': lambda f: f is None }}) - r"""Unique id of dataset created""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createreimbursableexpenserequest.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createreimbursableexpenserequest.py deleted file mode 100644 index 5ef327a62..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createreimbursableexpenserequest.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .reimbursableexpensetransaction import ReimbursableExpenseTransaction -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateReimbursableExpenseRequest: - items: Optional[List[List[ReimbursableExpenseTransaction]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('items'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createreimbursableexpenseresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createreimbursableexpenseresponse.py deleted file mode 100644 index 9074d58be..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createreimbursableexpenseresponse.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateReimbursableExpenseResponse: - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique id of sync created""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createsupplierresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createsupplierresponse.py deleted file mode 100644 index bc3ed6c88..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createsupplierresponse.py +++ /dev/null @@ -1,135 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from .items import Items -from .metadata import Metadata -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .supplementaldata import SupplementalData -from .supplierstatus import SupplierStatus -from .validation import Validation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountingSupplier: - r"""> View the coverage for suppliers in the Data coverage explorer. - - ## Overview - - From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - - Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. - """ - UNSET='__SPEAKEASY_UNSET__' - status: SupplierStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of the supplier.""" - addresses: Optional[List[Items]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""An array of Addresses.""" - contact_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Name of the main contact for the supplier.""" - default_currency: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Default currency the supplier's transactional data is recorded in.""" - email_address: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Email address that the supplier may be contacted on.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the supplier, unique to the company in the accounting platform.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Phone number that the supplier may be contacted on.""" - registration_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - supplier_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierName'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Name of the supplier as recorded in the accounting system, typically the company name.""" - tax_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is AccountingSupplier.UNSET }}) - r"""Supplier's company tax number.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateSupplierResponse: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is CreateSupplierResponse.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data: Optional[AccountingSupplier] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is CreateSupplierResponse.UNSET }}) - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is CreateSupplierResponse.UNSET }}) - r"""A message about the error.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is CreateSupplierResponse.UNSET }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is CreateSupplierResponse.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createtransferrequest.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createtransferrequest.py deleted file mode 100644 index babbfdd55..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createtransferrequest.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .transferdetails import TransferDetails -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateTransferRequest: - date_: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('date'), 'exclude': lambda f: f is None }}) - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Any private, company notes about the transaction.""" - from_: Optional[TransferDetails] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from'), 'exclude': lambda f: f is None }}) - to: Optional[TransferDetails] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/createtransferresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/createtransferresponse.py deleted file mode 100644 index 362054d1b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/createtransferresponse.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateTransferResponse: - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique id of sync created""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/customer.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/customer.py deleted file mode 100644 index 36abe351d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/customer.py +++ /dev/null @@ -1,87 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountingaddresstype import AccountingAddressType -from .contact import Contact -from .customerstatus import CustomerStatus -from .metadata import Metadata -from .supplementaldata import SupplementalData -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountingAddress: - UNSET='__SPEAKEASY_UNSET__' - type: AccountingAddressType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The type of the address""" - city: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is AccountingAddress.UNSET }}) - r"""City of the customer address.""" - country: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('country'), 'exclude': lambda f: f is AccountingAddress.UNSET }}) - r"""Country of the customer address.""" - line1: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line1'), 'exclude': lambda f: f is AccountingAddress.UNSET }}) - r"""Line 1 of the customer address.""" - line2: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line2'), 'exclude': lambda f: f is AccountingAddress.UNSET }}) - r"""Line 2 of the customer address.""" - postal_code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postalCode'), 'exclude': lambda f: f is AccountingAddress.UNSET }}) - r"""Postal code or zip code.""" - region: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('region'), 'exclude': lambda f: f is AccountingAddress.UNSET }}) - r"""Region of the customer address.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Customer: - r"""> View the coverage for customers in the Data coverage explorer. - - ## Overview - - A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - - Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - """ - UNSET='__SPEAKEASY_UNSET__' - status: CustomerStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of customer.""" - addresses: Optional[List[AccountingAddress]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""An array of Addresses.""" - contact_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""Name of the main contact for the identified customer.""" - contacts: Optional[List[Contact]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contacts'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""An array of Contacts.""" - customer_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customerName'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""Name of the customer as recorded in the accounting system, typically the company name.""" - default_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is None }}) - r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - - ## Unknown currencies - - In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - - There are only a very small number of edge cases where this currency code is returned by the Codat system. - """ - email_address: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""Email address the customer can be contacted by.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the customer, unique to the company in the accounting platform.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""Phone number the customer can be contacted by.""" - registration_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""Company number. In the UK, this is typically the Companies House company registration number.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - tax_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is Customer.UNSET }}) - r"""Company tax number.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/customerdetails.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/customerdetails.py deleted file mode 100644 index 9f13bda73..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/customerdetails.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CustomerDetails: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the customer, unique to the company in the accounting platform.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/customers.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/customers.py deleted file mode 100644 index d9d04313b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/customers.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .customer import Customer -from .links import Links -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Customers: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Customer]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/customerstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/customerstatus.py deleted file mode 100644 index 345218f3e..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/customerstatus.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class CustomerStatus(str, Enum): - r"""Status of customer.""" - UNKNOWN = 'Unknown' - ACTIVE = 'Active' - ARCHIVED = 'Archived' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/dataconnectionerror.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/dataconnectionerror.py deleted file mode 100644 index 5d276561e..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/dataconnectionerror.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataConnectionError: - error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) - r"""A brief message about the error.""" - errored_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('erroredOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) - r"""The HTTP status code returned by the error.""" - status_text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusText'), 'exclude': lambda f: f is None }}) - r"""A non-numeric status code/text.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/dataconnectionstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/dataconnectionstatus.py deleted file mode 100644 index 377013d42..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/dataconnectionstatus.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class DataConnectionStatus(str, Enum): - r"""The current authorization status of the data connection.""" - PENDING_AUTH = 'PendingAuth' - LINKED = 'Linked' - UNLINKED = 'Unlinked' - DEAUTHORIZED = 'Deauthorized' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/datastatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/datastatus.py deleted file mode 100644 index 136aa029f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/datastatus.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Optional - -class DataTypes(str, Enum): - r"""Available data types""" - ACCOUNT_TRANSACTIONS = 'accountTransactions' - BALANCE_SHEET = 'balanceSheet' - BANK_ACCOUNTS = 'bankAccounts' - BANK_TRANSACTIONS = 'bankTransactions' - BILL_CREDIT_NOTES = 'billCreditNotes' - BILL_PAYMENTS = 'billPayments' - BILLS = 'bills' - CASH_FLOW_STATEMENT = 'cashFlowStatement' - CHART_OF_ACCOUNTS = 'chartOfAccounts' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - DIRECT_COSTS = 'directCosts' - DIRECT_INCOMES = 'directIncomes' - INVOICES = 'invoices' - ITEM_RECEIPTS = 'itemReceipts' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - JOURNALS = 'journals' - PAYMENT_METHODS = 'paymentMethods' - PAYMENTS = 'payments' - PROFIT_AND_LOSS = 'profitAndLoss' - PURCHASE_ORDERS = 'purchaseOrders' - SALES_ORDERS = 'salesOrders' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - TRACKING_CATEGORIES = 'trackingCategories' - TRANSFERS = 'transfers' - BANKING_ACCOUNT_BALANCES = 'banking-accountBalances' - BANKING_ACCOUNTS = 'banking-accounts' - BANKING_TRANSACTION_CATEGORIES = 'banking-transactionCategories' - BANKING_TRANSACTIONS = 'banking-transactions' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataStatus: - r"""Describes the state of data in the Codat cache for a company and data type""" - current_status: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentStatus') }}) - r"""The current status of the dataset in Codat's cache.""" - data_type: DataTypes = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) - r"""Available data types""" - last_successful_sync: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSuccessfulSync') }}) - 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. - """ - latest_successful_sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestSuccessfulSyncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the most recent successful sync of data type.""" - latest_sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestSyncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for most recent sync of data type.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/datatype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/datatype.py deleted file mode 100644 index 76eee21a3..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/datatype.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class DataType(str, Enum): - r"""Available data types""" - ACCOUNT_TRANSACTIONS = 'accountTransactions' - BALANCE_SHEET = 'balanceSheet' - BANK_ACCOUNTS = 'bankAccounts' - BANK_TRANSACTIONS = 'bankTransactions' - BILL_CREDIT_NOTES = 'billCreditNotes' - BILL_PAYMENTS = 'billPayments' - BILLS = 'bills' - CASH_FLOW_STATEMENT = 'cashFlowStatement' - CHART_OF_ACCOUNTS = 'chartOfAccounts' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - DIRECT_COSTS = 'directCosts' - DIRECT_INCOMES = 'directIncomes' - INVOICES = 'invoices' - ITEM_RECEIPTS = 'itemReceipts' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - JOURNALS = 'journals' - PAYMENT_METHODS = 'paymentMethods' - PAYMENTS = 'payments' - PROFIT_AND_LOSS = 'profitAndLoss' - PURCHASE_ORDERS = 'purchaseOrders' - SALES_ORDERS = 'salesOrders' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - TRACKING_CATEGORIES = 'trackingCategories' - TRANSFERS = 'transfers' - BANKING_ACCOUNT_BALANCES = 'banking-accountBalances' - BANKING_ACCOUNTS = 'banking-accounts' - BANKING_TRANSACTION_CATEGORIES = 'banking-transactionCategories' - BANKING_TRANSACTIONS = 'banking-transactions' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/errorvalidation.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/errorvalidation.py deleted file mode 100644 index 26a78b0a8..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/errorvalidation.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .errorvalidationitem import ErrorValidationItem -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ErrorValidation: - 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.""" - UNSET='__SPEAKEASY_UNSET__' - errors: Optional[List[ErrorValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errors'), 'exclude': lambda f: f is ErrorValidation.UNSET }}) - warnings: Optional[List[ErrorValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is ErrorValidation.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/errorvalidationitem.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/errorvalidationitem.py deleted file mode 100644 index 271d0fb5d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/errorvalidationitem.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ErrorValidationItem: - UNSET='__SPEAKEASY_UNSET__' - item_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemId'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""Unique identifier for a validation item.""" - message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""A message outlining validation item's issue.""" - validator_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validatorName'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""Name of validator.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/expensetransaction.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/expensetransaction.py deleted file mode 100644 index 6ab46aff7..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/expensetransaction.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .contactref import ContactRef -from .expensetransactionline import ExpenseTransactionLine -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from enum import Enum -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ExpenseTransactionBankAccountReference: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier of the bank account.""" - - - -class ExpenseTransactionType(str, Enum): - r"""The type of transaction.""" - PAYMENT = 'Payment' - REFUND = 'Refund' - REWARD = 'Reward' - CHARGEBACK = 'Chargeback' - TRANSFER_IN = 'TransferIn' - TRANSFER_OUT = 'TransferOut' - ADJUSTMENT_IN = 'AdjustmentIn' - ADJUSTMENT_OUT = 'AdjustmentOut' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ExpenseTransaction: - UNSET='__SPEAKEASY_UNSET__' - currency: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency') }}) - r"""Currency the transaction was recorded in.""" - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Your unique identifier for the transaction.""" - issue_date: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('issueDate') }}) - 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. - """ - type: ExpenseTransactionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The type of transaction.""" - bank_account_ref: Optional[ExpenseTransactionBankAccountReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bankAccountRef'), 'exclude': lambda f: f is None }}) - contact_ref: Optional[ContactRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactRef'), 'exclude': lambda f: f is None }}) - currency_rate: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is ExpenseTransaction.UNSET }}) - r"""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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). - - For accounting platforms 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, include the required currency rate in the expense transaction. | - """ - lines: Optional[List[ExpenseTransactionLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lines'), 'exclude': lambda f: f is None }}) - r"""Array of transaction lines.""" - merchant_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('merchantName'), 'exclude': lambda f: f is None }}) - r"""Name of the merchant where the purchase took place""" - notes: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('notes'), 'exclude': lambda f: f is None }}) - r"""Any private, company notes about the transaction.""" - post_as_draft: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postAsDraft'), 'exclude': lambda f: f is ExpenseTransaction.UNSET }}) - r"""For supported accouting platforms, setting this optional property to true will post the transaction to a drafted state.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/expensetransactionline.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/expensetransactionline.py deleted file mode 100644 index 1ceafc082..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/expensetransactionline.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .invoiceto import InvoiceTo -from .recordref import RecordRef -from .trackingref import TrackingRef -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ExpenseTransactionLine: - UNSET='__SPEAKEASY_UNSET__' - account_ref: RecordRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef') }}) - net_amount: Decimal = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('netAmount'), 'encoder': utils.decimalencoder(False, False), 'decoder': utils.decimaldecoder }}) - r"""Amount of the line, exclusive of tax.""" - invoice_to: Optional[InvoiceTo] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('invoiceTo'), 'exclude': lambda f: f is ExpenseTransactionLine.UNSET }}) - r"""Unique identifier of the customer the expense is billable to. The invoiceTo object is currently only supported for QBO.""" - tax_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Amount of tax for the line.""" - tax_rate_ref: Optional[RecordRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRateRef'), 'exclude': lambda f: f is None }}) - tracking_refs: Optional[List[TrackingRef]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('trackingRefs'), 'exclude': lambda f: f is ExpenseTransactionLine.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/group_items.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/group_items.py deleted file mode 100644 index 91c5145e4..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/group_items.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class GroupItems: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the group.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/halref.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/halref.py deleted file mode 100644 index 62ccb3637..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/halref.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class HalRef: - href: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('href'), 'exclude': lambda f: f is None }}) - r"""Uri hypertext reference.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/initiatesync.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/initiatesync.py deleted file mode 100644 index 2d2737cd6..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/initiatesync.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class InitiateSync: - UNSET='__SPEAKEASY_UNSET__' - dataset_ids: Optional[List[str]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datasetIds'), 'exclude': lambda f: f is InitiateSync.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/invoiceto.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/invoiceto.py deleted file mode 100644 index 15a7a8f14..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/invoiceto.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Optional - -class InvoiceToDataType(str, Enum): - r"""The type of contact.""" - CUSTOMERS = 'customers' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class InvoiceTo: - r"""Unique identifier of the customer the expense is billable to. The invoiceTo object is currently only supported for QBO.""" - data_type: Optional[InvoiceToDataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""The type of contact.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""identifier of customer.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/items.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/items.py deleted file mode 100644 index b17929958..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/items.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountingaddresstype import AccountingAddressType -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Items: - UNSET='__SPEAKEASY_UNSET__' - type: AccountingAddressType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The type of the address""" - city: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is Items.UNSET }}) - r"""City of the customer address.""" - country: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('country'), 'exclude': lambda f: f is Items.UNSET }}) - r"""Country of the customer address.""" - line1: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line1'), 'exclude': lambda f: f is Items.UNSET }}) - r"""Line 1 of the customer address.""" - line2: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line2'), 'exclude': lambda f: f is Items.UNSET }}) - r"""Line 2 of the customer address.""" - postal_code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postalCode'), 'exclude': lambda f: f is Items.UNSET }}) - r"""Postal code or zip code.""" - region: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('region'), 'exclude': lambda f: f is Items.UNSET }}) - r"""Region of the customer address.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/links.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/links.py deleted file mode 100644 index 4c6f117bd..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/links.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .halref import HalRef -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Links: - current: HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('current') }}) - self_: HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('self') }}) - next: Optional[HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('next'), 'exclude': lambda f: f is None }}) - previous: Optional[HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('previous'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/mappingoptions.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/mappingoptions.py deleted file mode 100644 index 4b4e3571b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/mappingoptions.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountmappinginfo import AccountMappingInfo -from .taxratemappinginfo import TaxRateMappingInfo -from .trackingcategorymappinginfo import TrackingCategoryMappingInfo -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class MappingOptions: - UNSET='__SPEAKEASY_UNSET__' - accounts: Optional[List[AccountMappingInfo]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accounts'), 'exclude': lambda f: f is MappingOptions.UNSET }}) - r"""Array of available accounts for mapping.""" - expense_provider: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('expenseProvider'), 'exclude': lambda f: f is MappingOptions.UNSET }}) - r"""Name of the expense integration.""" - tax_rates: Optional[List[TaxRateMappingInfo]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRates'), 'exclude': lambda f: f is MappingOptions.UNSET }}) - r"""Array of available tax rates for mapping.""" - tracking_categories: Optional[List[TrackingCategoryMappingInfo]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('trackingCategories'), 'exclude': lambda f: f is MappingOptions.UNSET }}) - r"""Array of available tracking categories for mapping.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/metadata.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/metadata.py deleted file mode 100644 index 35a249214..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/metadata.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Metadata: - UNSET='__SPEAKEASY_UNSET__' - is_deleted: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isDeleted'), 'exclude': lambda f: f is Metadata.UNSET }}) - r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/phonenumbertype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/phonenumbertype.py deleted file mode 100644 index 5da847077..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/phonenumbertype.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PhoneNumberType(str, Enum): - r"""The type of phone number""" - PRIMARY = 'Primary' - LANDLINE = 'Landline' - MOBILE = 'Mobile' - FAX = 'Fax' - UNKNOWN = 'Unknown' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pulloperation.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pulloperation.py deleted file mode 100644 index 978f9049f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pulloperation.py +++ /dev/null @@ -1,107 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Optional - -class Status(str, Enum): - r"""The current status of the pull operation.""" - INITIAL = 'Initial' - QUEUED = 'Queued' - FETCHING = 'Fetching' - MAP_QUEUED = 'MapQueued' - MAPPING = 'Mapping' - COMPLETE = 'Complete' - FETCH_ERROR = 'FetchError' - MAP_ERROR = 'MapError' - INTERNAL_ERROR = 'InternalError' - PROCESSING_QUEUED = 'ProcessingQueued' - PROCESSING = 'Processing' - PROCESSING_ERROR = 'ProcessingError' - VALIDATION_QUEUED = 'ValidationQueued' - VALIDATING = 'Validating' - VALIDATION_ERROR = 'ValidationError' - AUTH_ERROR = 'AuthError' - CANCELLED = 'Cancelled' - ROUTING = 'Routing' - ROUTING_ERROR = 'RoutingError' - NOT_SUPPORTED = 'NotSupported' - RATE_LIMIT_ERROR = 'RateLimitError' - PERMISSIONS_ERROR = 'PermissionsError' - PREREQUISITE_NOT_MET = 'PrerequisiteNotMet' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PullOperation: - r"""Information about a queued, in progress or completed pull operation. - *Formally called `dataset`* - """ - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier of the company associated to this pull operation.""" - connection_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionId') }}) - r"""Unique identifier of the connection associated to this pull operation.""" - data_type: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) - r"""The data type you are requesting in a pull operation.""" - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier of the pull operation.""" - is_completed: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isCompleted') }}) - r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" - is_errored: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isErrored') }}) - r"""`True` if the pull operation entered an error state.""" - progress: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('progress') }}) - r"""An integer signifying the progress of the pull operation.""" - requested: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requested') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: Status = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the pull operation.""" - completed: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completed'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is PullOperation.UNSET }}) - r"""A message about a transient or persistent error.""" - status_description: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusDescription'), 'exclude': lambda f: f is PullOperation.UNSET }}) - r"""Additional information about the dataset status.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pulloperations.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pulloperations.py deleted file mode 100644 index 861c5a489..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pulloperations.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .pulloperation import PullOperation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PullOperations: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[PullOperation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushchangetype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushchangetype.py deleted file mode 100644 index 55cd1990f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushchangetype.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PushChangeType(str, Enum): - r"""Type of change being applied to record in third party platform.""" - UNKNOWN = 'Unknown' - CREATED = 'Created' - MODIFIED = 'Modified' - DELETED = 'Deleted' - ATTACHMENT_UPLOADED = 'AttachmentUploaded' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushfieldvalidation.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushfieldvalidation.py deleted file mode 100644 index 157cc0ded..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushfieldvalidation.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushFieldValidation: - UNSET='__SPEAKEASY_UNSET__' - details: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('details') }}) - r"""Details on the validation issue.""" - field: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('field'), 'exclude': lambda f: f is None }}) - r"""Field name that resulted in the validation issue.""" - ref: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ref'), 'exclude': lambda f: f is PushFieldValidation.UNSET }}) - r"""Unique reference identifier for the validation issue.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperation.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperation.py deleted file mode 100644 index b76c6b38d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperation.py +++ /dev/null @@ -1,86 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .validation import Validation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperation: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is PushOperation.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is PushOperation.UNSET }}) - r"""A message about the error.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is PushOperation.UNSET }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is PushOperation.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationchange.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationchange.py deleted file mode 100644 index 91e163544..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationchange.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushchangetype import PushChangeType -from .pushoperationref import PushOperationRef -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperationChange: - UNSET='__SPEAKEASY_UNSET__' - attachment_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('attachmentId'), 'exclude': lambda f: f is PushOperationChange.UNSET }}) - r"""Unique identifier for the attachment created otherwise null.""" - record_ref: Optional[PushOperationRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recordRef'), 'exclude': lambda f: f is None }}) - type: Optional[PushChangeType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Type of change being applied to record in third party platform.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationref.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationref.py deleted file mode 100644 index 7f00006bf..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationref.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperationRef: - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for a push operation.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperations.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperations.py deleted file mode 100644 index 330d7ab9a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperations.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .pushoperation import PushOperation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperations: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[PushOperation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationstatus.py deleted file mode 100644 index 5b3fabf24..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoperationstatus.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PushOperationStatus(str, Enum): - r"""The current status of the push operation.""" - PENDING = 'Pending' - FAILED = 'Failed' - SUCCESS = 'Success' - TIMED_OUT = 'TimedOut' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoption.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoption.py deleted file mode 100644 index 2eaede5be..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoption.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoptionchoice import PushOptionChoice -from .pushoptionproperty import PushOptionProperty -from .pushoptiontype import PushOptionType -from .pushvalidationinfo import PushValidationInfo -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Dict, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOption: - UNSET='__SPEAKEASY_UNSET__' - display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) - r"""The property's display name.""" - required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) - r"""The property is required if `True`.""" - type: PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The option type.""" - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""A description of the property.""" - options: Optional[List[PushOptionChoice]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options'), 'exclude': lambda f: f is PushOption.UNSET }}) - properties: Optional[Dict[str, PushOptionProperty]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties'), 'exclude': lambda f: f is PushOption.UNSET }}) - validation: Optional[PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptionchoice.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptionchoice.py deleted file mode 100644 index 2c9ba053f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptionchoice.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoptiontype import PushOptionType -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOptionChoice: - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""A description of the property.""" - display_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName'), 'exclude': lambda f: f is None }}) - r"""The property's display name.""" - required: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required'), 'exclude': lambda f: f is None }}) - r"""The property is required if `True`.""" - type: Optional[PushOptionType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""The option type.""" - value: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('value'), 'exclude': lambda f: f is None }}) - r"""Allowed value for field.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptionproperty.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptionproperty.py deleted file mode 100644 index 282c9fe4d..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptionproperty.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoptionchoice import PushOptionChoice -from .pushoptiontype import PushOptionType -from .pushvalidationinfo import PushValidationInfo -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Dict, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOptionProperty: - UNSET='__SPEAKEASY_UNSET__' - description: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }}) - r"""A description of the property.""" - display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) - r"""The property's display name.""" - required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) - r"""The property is required if `True`.""" - type: PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The option type.""" - options: Optional[List[PushOptionChoice]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options'), 'exclude': lambda f: f is PushOptionProperty.UNSET }}) - properties: Optional[Dict[str, PushOptionProperty]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties'), 'exclude': lambda f: f is PushOptionProperty.UNSET }}) - validation: Optional[PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptiontype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptiontype.py deleted file mode 100644 index f069e2d84..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushoptiontype.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PushOptionType(str, Enum): - r"""The option type.""" - ARRAY = 'Array' - OBJECT = 'Object' - STRING = 'String' - NUMBER = 'Number' - BOOLEAN = 'Boolean' - DATE_TIME = 'DateTime' - FILE = 'File' - MULTI_PART = 'MultiPart' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushvalidationinfo.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/pushvalidationinfo.py deleted file mode 100644 index d1b3a7e1e..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/pushvalidationinfo.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushfieldvalidation import PushFieldValidation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushValidationInfo: - UNSET='__SPEAKEASY_UNSET__' - information: Optional[List[PushFieldValidation]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('information'), 'exclude': lambda f: f is PushValidationInfo.UNSET }}) - warnings: Optional[List[PushFieldValidation]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is PushValidationInfo.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/recordref.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/recordref.py deleted file mode 100644 index e29d66bd9..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/recordref.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class RecordRef: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier of linked reference from mapping options.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/reimbursableexpensetransaction.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/reimbursableexpensetransaction.py deleted file mode 100644 index a06a72ca9..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/reimbursableexpensetransaction.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .contactref import ContactRef -from .reimbursableexpensetransactionline import ReimbursableExpenseTransactionLine -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import Any, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BankAccountReference: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier of the bank account.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ReimbursableExpenseTransaction: - UNSET='__SPEAKEASY_UNSET__' - currency: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency') }}) - r"""Currency the transaction was recorded in.""" - due_date: Any = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dueDate') }}) - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Your unique identifier for the transaction.""" - issue_date: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('issueDate') }}) - 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. - """ - all_of: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allOf'), 'exclude': lambda f: f is None }}) - bank_account_ref: Optional[BankAccountReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bankAccountRef'), 'exclude': lambda f: f is None }}) - currency_rate: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is ReimbursableExpenseTransaction.UNSET }}) - r"""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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). - - For accounting platforms 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, include the required currency rate in the expense transaction. | - """ - lines: Optional[List[ReimbursableExpenseTransactionLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lines'), 'exclude': lambda f: f is None }}) - r"""Array of transaction lines.""" - notes: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('notes'), 'exclude': lambda f: f is None }}) - r"""Any private, company notes about the transaction.""" - record_ref: Optional[ContactRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recordRef'), 'exclude': lambda f: f is None }}) - reference: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reference'), 'exclude': lambda f: f is ReimbursableExpenseTransaction.UNSET }}) - r"""User-friendly reference for the reimbursable expense.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/reimbursableexpensetransactionline.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/reimbursableexpensetransactionline.py deleted file mode 100644 index 33f4140ee..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/reimbursableexpensetransactionline.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .invoiceto import InvoiceTo -from .recordref import RecordRef -from .trackingref import TrackingRef -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ReimbursableExpenseTransactionLine: - UNSET='__SPEAKEASY_UNSET__' - account_ref: RecordRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef') }}) - net_amount: Decimal = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('netAmount'), 'encoder': utils.decimalencoder(False, False), 'decoder': utils.decimaldecoder }}) - r"""Amount of the line, exclusive of tax.""" - invoice_to: Optional[InvoiceTo] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('invoiceTo'), 'exclude': lambda f: f is ReimbursableExpenseTransactionLine.UNSET }}) - r"""Unique identifier of the customer the expense is billable to. The invoiceTo object is currently only supported for QBO.""" - tax_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Amount of tax for the line.""" - tax_rate_ref: Optional[RecordRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRateRef'), 'exclude': lambda f: f is None }}) - tracking_refs: Optional[List[TrackingRef]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('trackingRefs'), 'exclude': lambda f: f is ReimbursableExpenseTransactionLine.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/schema_datatype.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/schema_datatype.py deleted file mode 100644 index 38faff212..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/schema_datatype.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class SchemaDataType(str, Enum): - r"""Available data types""" - ACCOUNT_TRANSACTIONS = 'accountTransactions' - BALANCE_SHEET = 'balanceSheet' - BANK_ACCOUNTS = 'bankAccounts' - BANK_TRANSACTIONS = 'bankTransactions' - BILL_CREDIT_NOTES = 'billCreditNotes' - BILL_PAYMENTS = 'billPayments' - BILLS = 'bills' - CASH_FLOW_STATEMENT = 'cashFlowStatement' - CHART_OF_ACCOUNTS = 'chartOfAccounts' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - DIRECT_COSTS = 'directCosts' - DIRECT_INCOMES = 'directIncomes' - INVOICES = 'invoices' - ITEM_RECEIPTS = 'itemReceipts' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - JOURNALS = 'journals' - PAYMENT_METHODS = 'paymentMethods' - PAYMENTS = 'payments' - PROFIT_AND_LOSS = 'profitAndLoss' - PURCHASE_ORDERS = 'purchaseOrders' - SALES_ORDERS = 'salesOrders' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - TRACKING_CATEGORIES = 'trackingCategories' - TRANSFERS = 'transfers' - BANKING_ACCOUNT_BALANCES = 'banking-accountBalances' - BANKING_ACCOUNTS = 'banking-accounts' - BANKING_TRANSACTION_CATEGORIES = 'banking-transactionCategories' - BANKING_TRANSACTIONS = 'banking-transactions' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/security.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/security.py deleted file mode 100644 index 1d57f5faa..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/security.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses - - -@dataclasses.dataclass -class Security: - auth_header: str = dataclasses.field(metadata={'security': { 'scheme': True, 'type': 'apiKey', 'sub_type': 'header', 'field_name': 'Authorization' }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplementaldata.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/supplementaldata.py deleted file mode 100644 index 4c2244927..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplementaldata.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Any, Dict, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SupplementalData: - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - UNSET='__SPEAKEASY_UNSET__' - content: Optional[Dict[str, Dict[str, Any]]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content'), 'exclude': lambda f: f is SupplementalData.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplier.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/supplier.py deleted file mode 100644 index be912db28..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplier.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .items import Items -from .metadata import Metadata -from .supplementaldata import SupplementalData -from .supplierstatus import SupplierStatus -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Supplier: - r"""> View the coverage for suppliers in the Data coverage explorer. - - ## Overview - - From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - """ - UNSET='__SPEAKEASY_UNSET__' - status: SupplierStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of the supplier.""" - addresses: Optional[List[Items]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""An array of Addresses.""" - contact_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Name of the main contact for the supplier.""" - default_currency: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Default currency the supplier's transactional data is recorded in.""" - email_address: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Email address that the supplier may be contacted on.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the supplier, unique to the company in the accounting platform.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Phone number that the supplier may be contacted on.""" - registration_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - supplier_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierName'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Name of the supplier as recorded in the accounting system, typically the company name.""" - tax_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is Supplier.UNSET }}) - r"""Supplier's company tax number.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplierdetails.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/supplierdetails.py deleted file mode 100644 index 5b1688721..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplierdetails.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SupplierDetails: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the supplier, unique to the company in the accounting platform.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/suppliers.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/suppliers.py deleted file mode 100644 index 48c1d7647..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/suppliers.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .supplier import Supplier -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Suppliers: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Supplier]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplierstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/supplierstatus.py deleted file mode 100644 index b30be6a46..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/supplierstatus.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class SupplierStatus(str, Enum): - r"""Status of the supplier.""" - UNKNOWN = 'Unknown' - ACTIVE = 'Active' - ARCHIVED = 'Archived' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/synccompletewebhook.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/synccompletewebhook.py deleted file mode 100644 index 9957235eb..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/synccompletewebhook.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .synccompletewebhookdata import SyncCompleteWebhookData -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncCompleteWebhook: - r"""Webhook request body used to notify that a sync has completed.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[SyncCompleteWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human-readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/synccompletewebhookdata.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/synccompletewebhookdata.py deleted file mode 100644 index eaa5b0d6a..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/synccompletewebhookdata.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncCompleteWebhookData: - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the failed sync.""" - sync_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncType'), 'exclude': lambda f: f is None }}) - r"""The type of sync being performed.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncfailedwebhook.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/syncfailedwebhook.py deleted file mode 100644 index 61e5a090c..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncfailedwebhook.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .syncfailedwebhookdata import SyncFailedWebhookData -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncFailedWebhook: - r"""Webhook request body used to notify that a sync has failed.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[SyncFailedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human-readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncfailedwebhookdata.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/syncfailedwebhookdata.py deleted file mode 100644 index 1228299c8..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncfailedwebhookdata.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncFailedWebhookData: - failure_stage: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('FailureStage'), 'exclude': lambda f: f is None }}) - r"""The stage of the job the sync failed.""" - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the failed sync.""" - sync_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncType'), 'exclude': lambda f: f is None }}) - r"""The type of sync being performed.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncinitiated.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/syncinitiated.py deleted file mode 100644 index 246b01a51..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncinitiated.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncInitiated: - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the sync initiated.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncstartedwebhook.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/syncstartedwebhook.py deleted file mode 100644 index 1a0aa5d59..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/syncstartedwebhook.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Data: - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the failed sync.""" - sync_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncType'), 'exclude': lambda f: f is None }}) - r"""The type of sync being performed.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncStartedWebhook: - r"""Webhook request body used to notify that a sync has started.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[Data] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human-readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/taxratemappinginfo.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/taxratemappinginfo.py deleted file mode 100644 index 9a424100e..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/taxratemappinginfo.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from enum import Enum -from typing import List, Optional - -class TaxRateMappingInfoValidTransactionTypes(str, Enum): - PAYMENT = 'Payment' - REFUND = 'Refund' - REWARD = 'Reward' - CHARGEBACK = 'Chargeback' - TRANSFER_IN = 'TransferIn' - TRANSFER_OUT = 'TransferOut' - ADJUSTMENT_IN = 'AdjustmentIn' - ADJUSTMENT_OUT = 'AdjustmentOut' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class TaxRateMappingInfo: - UNSET='__SPEAKEASY_UNSET__' - code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('code'), 'exclude': lambda f: f is TaxRateMappingInfo.UNSET }}) - r"""Code for the tax rate from the accounting platform.""" - effective_tax_rate: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('effectiveTaxRate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Effective tax rate.""" - id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is TaxRateMappingInfo.UNSET }}) - r"""Unique identifier of tax rate.""" - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is TaxRateMappingInfo.UNSET }}) - r"""Name of the tax rate in the accounting platform.""" - total_tax_rate: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxRate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Total (not compounded) sum of the components of a tax rate.""" - valid_transaction_types: Optional[List[TaxRateMappingInfoValidTransactionTypes]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validTransactionTypes'), 'exclude': lambda f: f is TaxRateMappingInfo.UNSET }}) - r"""Supported transaction types for the account.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/trackingcategorymappinginfo.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/trackingcategorymappinginfo.py deleted file mode 100644 index 566cafff0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/trackingcategorymappinginfo.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class TrackingCategoryMappingInfo: - UNSET='__SPEAKEASY_UNSET__' - has_children: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hasChildren'), 'exclude': lambda f: f is None }}) - r"""Boolean of whether the tracking category has child categories.""" - id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is TrackingCategoryMappingInfo.UNSET }}) - r"""Unique identifier of the tracking category.""" - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is TrackingCategoryMappingInfo.UNSET }}) - r"""Name of the tracking category as it appears in the accounting software.""" - parent_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parentId'), 'exclude': lambda f: f is TrackingCategoryMappingInfo.UNSET }}) - r"""ID of the parent tracking category""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/trackingref.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/trackingref.py deleted file mode 100644 index 05111b2bd..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/trackingref.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Optional - -class TrackingRefDataType(str, Enum): - r"""The type of the linked reference""" - TRACKING_CATEGORIES = 'trackingCategories' - CUSTOMERS = 'customers' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class TrackingRef: - data_type: Optional[TrackingRefDataType] = dataclasses.field(default=TrackingRefDataType.TRACKING_CATEGORIES, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""The type of the linked reference""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/transaction.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/transaction.py deleted file mode 100644 index 5c08c8fb1..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/transaction.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .integrationtype import IntegrationType -from .transactionstatus import TransactionStatus -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Transaction: - UNSET='__SPEAKEASY_UNSET__' - integration_type: Optional[IntegrationType] = dataclasses.field(default=IntegrationType.EXPENSES, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationType'), 'exclude': lambda f: f is Transaction.UNSET }}) - r"""Type of transaction that has been processed e.g. Expense or Bank Feed.""" - message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is Transaction.UNSET }}) - r"""Metadata such as validation errors or the resulting record created in the accounting software.""" - status: Optional[TransactionStatus] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is Transaction.UNSET }}) - r"""Status of the transaction.""" - transaction_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('transactionId'), 'exclude': lambda f: f is Transaction.UNSET }}) - r"""Your unique idenfier of the transaction.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/transactions.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/transactions.py deleted file mode 100644 index 45d7bd18b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/transactions.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .transaction import Transaction -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Transactions: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Transaction]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/transactionstatus.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/transactionstatus.py deleted file mode 100644 index 97f4a2f26..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/transactionstatus.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class TransactionStatus(str, Enum): - r"""Status of the transaction.""" - UNKNOWN = 'Unknown' - PENDING = 'Pending' - VALIDATION_ERROR = 'ValidationError' - COMPLETED = 'Completed' - PUSH_ERROR = 'PushError' diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/transferdetails.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/transferdetails.py deleted file mode 100644 index e2f558ff7..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/transferdetails.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountref import AccountRef -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class TransferDetails: - account_ref: Optional[AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is None }}) - r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" - amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Amount of the transfer.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/updatecustomerresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/updatecustomerresponse.py deleted file mode 100644 index e39b20a32..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/updatecustomerresponse.py +++ /dev/null @@ -1,169 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .accountingaddresstype import AccountingAddressType -from .contact import Contact -from .customerstatus import CustomerStatus -from .datatype import DataType -from .metadata import Metadata -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .supplementaldata import SupplementalData -from .validation import Validation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateCustomerResponseAccountingAddress: - UNSET='__SPEAKEASY_UNSET__' - type: AccountingAddressType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The type of the address""" - city: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingAddress.UNSET }}) - r"""City of the customer address.""" - country: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('country'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingAddress.UNSET }}) - r"""Country of the customer address.""" - line1: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line1'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingAddress.UNSET }}) - r"""Line 1 of the customer address.""" - line2: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line2'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingAddress.UNSET }}) - r"""Line 2 of the customer address.""" - postal_code: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postalCode'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingAddress.UNSET }}) - r"""Postal code or zip code.""" - region: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('region'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingAddress.UNSET }}) - r"""Region of the customer address.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateCustomerResponseAccountingCustomer: - r"""> View the coverage for customers in the Data coverage explorer. - - ## Overview - - A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - - Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - - Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. - """ - UNSET='__SPEAKEASY_UNSET__' - status: CustomerStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of customer.""" - addresses: Optional[List[UpdateCustomerResponseAccountingAddress]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""An array of Addresses.""" - contact_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""Name of the main contact for the identified customer.""" - contacts: Optional[List[Contact]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contacts'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""An array of Contacts.""" - customer_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customerName'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""Name of the customer as recorded in the accounting system, typically the company name.""" - default_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is None }}) - r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - - ## Unknown currencies - - In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - - There are only a very small number of edge cases where this currency code is returned by the Codat system. - """ - email_address: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""Email address the customer can be contacted by.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the customer, unique to the company in the accounting platform.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""Phone number the customer can be contacted by.""" - registration_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""Company number. In the UK, this is typically the Companies House company registration number.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - tax_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is UpdateCustomerResponseAccountingCustomer.UNSET }}) - r"""Company tax number.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateCustomerResponse: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is UpdateCustomerResponse.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data: Optional[UpdateCustomerResponseAccountingCustomer] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is UpdateCustomerResponse.UNSET }}) - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is UpdateCustomerResponse.UNSET }}) - r"""A message about the error.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is UpdateCustomerResponse.UNSET }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is UpdateCustomerResponse.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/updateexpenserequest.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/updateexpenserequest.py deleted file mode 100644 index 2988c9d0b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/updateexpenserequest.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .contactref import ContactRef -from .expensetransactionline import ExpenseTransactionLine -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import Any, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateExpenseRequestBankAccountReference: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier of the bank account.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateExpenseRequest: - UNSET='__SPEAKEASY_UNSET__' - issue_date: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('issueDate') }}) - r"""Date the transaction was recorded.""" - type: Any = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - bank_account_ref: Optional[UpdateExpenseRequestBankAccountReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bankAccountRef'), 'exclude': lambda f: f is None }}) - contact_ref: Optional[ContactRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactRef'), 'exclude': lambda f: f is None }}) - currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) - r"""Currency the transaction was recorded in.""" - currency_rate: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is UpdateExpenseRequest.UNSET }}) - r"""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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). - - For accounting platforms 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, include the required currency rate in the expense transaction. | - """ - lines: Optional[List[ExpenseTransactionLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lines'), 'exclude': lambda f: f is None }}) - r"""Array of transaction lines.""" - merchant_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('merchantName'), 'exclude': lambda f: f is None }}) - r"""Name of the merchant where the purchase took place""" - notes: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('notes'), 'exclude': lambda f: f is None }}) - r"""Any private, company notes about the transaction.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/updateexpenseresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/updateexpenseresponse.py deleted file mode 100644 index d5edf71c0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/updateexpenseresponse.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateExpenseResponse: - sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the update expense sync.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/updatesupplierresponse.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/updatesupplierresponse.py deleted file mode 100644 index 25fdf892f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/updatesupplierresponse.py +++ /dev/null @@ -1,135 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from .items import Items -from .metadata import Metadata -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .supplementaldata import SupplementalData -from .supplierstatus import SupplierStatus -from .validation import Validation -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateSupplierResponseAccountingSupplier: - r"""> View the coverage for suppliers in the Data coverage explorer. - - ## Overview - - From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - - Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. - """ - UNSET='__SPEAKEASY_UNSET__' - status: SupplierStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""Status of the supplier.""" - addresses: Optional[List[Items]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""An array of Addresses.""" - contact_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Name of the main contact for the supplier.""" - default_currency: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Default currency the supplier's transactional data is recorded in.""" - email_address: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Email address that the supplier may be contacted on.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the supplier, unique to the company in the accounting platform.""" - metadata: Optional[Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Phone number that the supplier may be contacted on.""" - registration_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - """ - supplier_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierName'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Name of the supplier as recorded in the accounting system, typically the company name.""" - tax_number: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is UpdateSupplierResponseAccountingSupplier.UNSET }}) - r"""Supplier's company tax number.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateSupplierResponse: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is UpdateSupplierResponse.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data: Optional[UpdateSupplierResponseAccountingSupplier] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is UpdateSupplierResponse.UNSET }}) - data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available data types""" - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is UpdateSupplierResponse.UNSET }}) - r"""A message about the error.""" - timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is UpdateSupplierResponse.UNSET }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is UpdateSupplierResponse.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/validation.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/validation.py deleted file mode 100644 index 954c724bf..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/validation.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .validationitem import ValidationItem -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Validation: - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - UNSET='__SPEAKEASY_UNSET__' - errors: Optional[List[ValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errors'), 'exclude': lambda f: f is Validation.UNSET }}) - warnings: Optional[List[ValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is Validation.UNSET }}) - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/shared/validationitem.py b/sync-for-expenses/src/codatsyncexpenses/models/shared/validationitem.py deleted file mode 100644 index 654766e6c..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/shared/validationitem.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncexpenses import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ValidationItem: - UNSET='__SPEAKEASY_UNSET__' - item_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemId'), 'exclude': lambda f: f is ValidationItem.UNSET }}) - r"""Unique identifier for a validation item.""" - message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is ValidationItem.UNSET }}) - r"""A message outlining validation item's issue.""" - validator_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validatorName'), 'exclude': lambda f: f is ValidationItem.UNSET }}) - r"""Name of validator.""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/__init__.py b/sync-for-expenses/src/codatsyncexpenses/models/webhooks/__init__.py deleted file mode 100644 index 531a06774..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .client_rate_limit_reached import * -from .client_rate_limit_reset import * -from .sync_complete import * -from .sync_failed import * -from .sync_started import * - -__all__ = ["ClientRateLimitReachedResponse","ClientRateLimitResetResponse","SyncCompleteResponse","SyncFailedResponse","SyncStartedResponse"] diff --git a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/client_rate_limit_reached.py b/sync-for-expenses/src/codatsyncexpenses/models/webhooks/client_rate_limit_reached.py deleted file mode 100644 index 6f8ec4867..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/client_rate_limit_reached.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class ClientRateLimitReachedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/client_rate_limit_reset.py b/sync-for-expenses/src/codatsyncexpenses/models/webhooks/client_rate_limit_reset.py deleted file mode 100644 index ecc722470..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/client_rate_limit_reset.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class ClientRateLimitResetResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_complete.py b/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_complete.py deleted file mode 100644 index 0ece45907..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_complete.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class SyncCompleteResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_failed.py b/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_failed.py deleted file mode 100644 index b5288346f..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_failed.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class SyncFailedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_started.py b/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_started.py deleted file mode 100644 index aa669a237..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/models/webhooks/sync_started.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class SyncStartedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/sync-for-expenses/src/codatsyncexpenses/push_operations.py b/sync-for-expenses/src/codatsyncexpenses/push_operations.py deleted file mode 100644 index 57263068b..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/push_operations.py +++ /dev/null @@ -1,181 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class PushOperations: - r"""Access create, update and delete operations made to an SMB's data connection.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, request: operations.GetPushOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPushOperationResponse: - r"""Get push operation - Retrieve push operation. - """ - hook_ctx = HookContext(operation_id='get-push-operation', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/push/{pushOperationKey}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetPushOperationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) - res.push_operation = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListPushOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPushOperationsResponse: - r"""List push operations - List push operation records. - """ - hook_ctx = HookContext(operation_id='list-push-operations', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/push', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListPushOperationsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) - res.push_operations = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/reimbursements.py b/sync-for-expenses/src/codatsyncexpenses/reimbursements.py deleted file mode 100644 index 459820244..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/reimbursements.py +++ /dev/null @@ -1,190 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Reimbursements: - r"""Create reimbursable expense transactions.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateReimbursableExpenseTransactionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateReimbursableExpenseTransactionResponse: - r"""Create reimbursable expense transaction - Use the *Create reimbursable expense* endpoint to create a [reimbursement request](https://docs.codat.io/sync-for-expenses-api#/schemas/Reimburseable-Expense-Transactions) in the accounting platform for a given company's connection. - - Employee reimbursement requests are reflected in the accounting system in the form of Bills against an employee, who is a supplier. - """ - hook_ctx = HookContext(operation_id='create-reimbursable-expense-transaction', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/reimbursable-expense-transactions', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateReimbursableExpenseTransactionRequest, "create_reimbursable_expense_request", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateReimbursableExpenseTransactionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateReimbursableExpenseResponse]) - res.create_reimbursable_expense_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateReimbursableExpenseTransactionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateReimbursableExpenseTransactionResponse: - r"""Update reimbursable expense transaction - The *Update reimbursable expense* endpoint updates an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/operations/create-reimbursable-expense-transaction) in the accounting platform for a given company's connection. - - Employee reimbursement requests are reflected in the accounting system in the form of Bills against an employee, who is a supplier. - """ - hook_ctx = HookContext(operation_id='update-reimbursable-expense-transaction', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/reimbursable-expense-transactions/{transactionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateReimbursableExpenseTransactionRequest, "create_reimbursable_expense_request", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateReimbursableExpenseTransactionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateReimbursableExpenseResponse]) - res.create_reimbursable_expense_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/sdk.py b/sync-for-expenses/src/codatsyncexpenses/sdk.py deleted file mode 100644 index 47f784383..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/sdk.py +++ /dev/null @@ -1,135 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .accounts import Accounts -from .attachments import Attachments -from .companies import Companies -from .configuration import Configuration -from .connections import Connections -from .customers import Customers -from .expenses import Expenses -from .manage_data import ManageData -from .push_operations import PushOperations -from .reimbursements import Reimbursements -from .sdkconfiguration import SDKConfiguration -from .suppliers import Suppliers -from .sync import Sync -from .transaction_status import TransactionStatus -from .transfers import Transfers -from .utils.retries import RetryConfig -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import SDKHooks -from codatsyncexpenses.models import shared -from typing import Callable, Dict, Optional, Union - -class CodatSyncExpenses: - r"""Sync for Expenses: The API for Sync for Expenses. - - Sync for Expenses is an API and a set of supporting tools. It has been built to - enable corporate card and expense management platforms to provide high-quality - integrations with multiple accounting platforms through a standardized API. - - [Read more...](https://docs.codat.io/sync-for-expenses/overview) - - [See our OpenAPI spec](https://github.com/codatio/oas) - - Not seeing the endpoints you're expecting? We've [reorganized our products](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Sync for Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). - """ - companies: Companies - r"""Create and manage your Codat companies.""" - connections: Connections - r"""Create and manage partner expense connection.""" - accounts: Accounts - r"""Accounts""" - customers: Customers - r"""Customers""" - suppliers: Suppliers - r"""Suppliers""" - manage_data: ManageData - r"""Asynchronously retrieve data from an integration to refresh data in Codat.""" - push_operations: PushOperations - r"""Access create, update and delete operations made to an SMB's data connection.""" - configuration: Configuration - r"""Manage mapping options and sync configuration.""" - expenses: Expenses - r"""Create expense transactions.""" - reimbursements: Reimbursements - r"""Create reimbursable expense transactions.""" - sync: Sync - r"""Trigger and monitor expense syncs to accounting software.""" - transaction_status: TransactionStatus - r"""Retrieve the status of transactions within a sync.""" - attachments: Attachments - r"""Upload attachmens to expenses, transfers and reimbursable expense transactions.""" - transfers: Transfers - r"""Create transfer transactions.""" - - sdk_configuration: SDKConfiguration - - def __init__(self, - security: Union[shared.Security,Callable[[], shared.Security]] = None, - server_idx: Optional[int] = None, - server_url: Optional[str] = None, - url_params: Optional[Dict[str, str]] = None, - client: Optional[requests_http.Session] = None, - retry_config: Optional[RetryConfig] = None - ) -> None: - """Instantiates the SDK configuring it with the provided parameters. - - :param security: The security details required for authentication - :type security: Union[shared.Security,Callable[[], shared.Security]] - :param server_idx: The index of the server to use for all operations - :type server_idx: int - :param server_url: The server URL to use for all operations - :type server_url: str - :param url_params: Parameters to optionally template the server URL with - :type url_params: Dict[str, str] - :param client: The requests.Session HTTP client to use for all operations - :type client: requests_http.Session - :param retry_config: The utils.RetryConfig to use globally - :type retry_config: RetryConfig - """ - if client is None: - client = requests_http.Session() - - if server_url is not None: - if url_params is not None: - server_url = utils.template_url(server_url, url_params) - - - self.sdk_configuration = SDKConfiguration( - client, - security, - server_url, - server_idx, - retry_config=retry_config - ) - - hooks = SDKHooks() - - 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) - if current_server_url != server_url: - self.sdk_configuration.server_url = server_url - - # pylint: disable=protected-access - self.sdk_configuration.__dict__['_hooks'] = hooks - - self._init_sdks() - - - def _init_sdks(self): - self.companies = Companies(self.sdk_configuration) - self.connections = Connections(self.sdk_configuration) - self.accounts = Accounts(self.sdk_configuration) - self.customers = Customers(self.sdk_configuration) - self.suppliers = Suppliers(self.sdk_configuration) - self.manage_data = ManageData(self.sdk_configuration) - self.push_operations = PushOperations(self.sdk_configuration) - self.configuration = Configuration(self.sdk_configuration) - self.expenses = Expenses(self.sdk_configuration) - self.reimbursements = Reimbursements(self.sdk_configuration) - self.sync = Sync(self.sdk_configuration) - self.transaction_status = TransactionStatus(self.sdk_configuration) - self.attachments = Attachments(self.sdk_configuration) - self.transfers = Transfers(self.sdk_configuration) diff --git a/sync-for-expenses/src/codatsyncexpenses/sdkconfiguration.py b/sync-for-expenses/src/codatsyncexpenses/sdkconfiguration.py deleted file mode 100644 index 429253649..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/sdkconfiguration.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - - -import requests as requests_http -from ._hooks import SDKHooks -from .utils import utils -from .utils.retries import RetryConfig -from codatsyncexpenses.models import shared -from dataclasses import dataclass -from typing import Callable, Dict, Optional, Tuple, Union - - -SERVERS = [ - 'https://api.codat.io', -] -"""Contains the list of servers available to the SDK""" - -@dataclass -class SDKConfiguration: - client: requests_http.Session - security: Union[shared.Security,Callable[[], shared.Security]] = None - server_url: Optional[str] = '' - server_idx: Optional[int] = 0 - language: str = 'python' - openapi_doc_version: str = 'prealpha' - sdk_version: str = '6.2.0' - gen_version: str = '2.301.3' - user_agent: str = 'speakeasy-sdk/python 6.2.0 2.301.3 prealpha codat-sync-for-expenses' - retry_config: Optional[RetryConfig] = 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 utils.remove_suffix(self.server_url, '/'), {} - if self.server_idx is None: - self.server_idx = 0 - - return SERVERS[self.server_idx], {} - - - def get_hooks(self) -> SDKHooks: - return self._hooks diff --git a/sync-for-expenses/src/codatsyncexpenses/suppliers.py b/sync-for-expenses/src/codatsyncexpenses/suppliers.py deleted file mode 100644 index 8afac2ea0..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/suppliers.py +++ /dev/null @@ -1,377 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Suppliers: - r"""Suppliers""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateSupplierRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateSupplierResponse: - r"""Create supplier - The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - - [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - - **Integration-specific behaviour** - - Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. - """ - hook_ctx = HookContext(operation_id='create-supplier', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}/push/suppliers', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateSupplierRequest, "supplier", True, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateSupplierResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateSupplierResponse]) - res.create_supplier_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetSupplierRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetSupplierResponse: - r"""Get supplier - The *Get supplier* endpoint returns a single supplier for a given supplierId. - - [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. - - Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - """ - hook_ctx = HookContext(operation_id='get-supplier', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/suppliers/{supplierId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','409','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetSupplierResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Supplier]) - res.supplier = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 409, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListSuppliersRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListSuppliersResponse: - r"""List suppliers - The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - - [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - - Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - """ - hook_ctx = HookContext(operation_id='list-suppliers', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/data/suppliers', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','409','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListSuppliersResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Suppliers]) - res.suppliers = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 409, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateSupplierRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateSupplierResponse: - r"""Update supplier - The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - - [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - - **Integration-specific behaviour** - - Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - - Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. - """ - hook_ctx = HookContext(operation_id='update-supplier', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateSupplierRequest, "supplier", True, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateSupplierResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.UpdateSupplierResponse]) - res.update_supplier_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/sync.py b/sync-for-expenses/src/codatsyncexpenses/sync.py deleted file mode 100644 index 7b93da402..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/sync.py +++ /dev/null @@ -1,426 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import List, Optional - -class Sync: - r"""Trigger and monitor expense syncs to accounting software.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, request: operations.GetSyncByIDRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetSyncByIDResponse: - r"""Get sync status - Get the sync status for a specified sync - """ - hook_ctx = HookContext(operation_id='get-sync-by-id', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/{syncId}/status', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetSyncByIDResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CompanySyncStatus]) - res.company_sync_status = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_last_successful_sync(self, request: operations.GetLastSuccessfulSyncRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetLastSuccessfulSyncResponse: - r"""Last successful sync - Gets the status of the last successful sync - """ - hook_ctx = HookContext(operation_id='get-last-successful-sync', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/lastSuccessful/status', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetLastSuccessfulSyncResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CompanySyncStatus]) - res.company_sync_status = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_latest_sync(self, request: operations.GetLatestSyncRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetLatestSyncResponse: - r"""Latest sync status - Gets the latest sync status - """ - hook_ctx = HookContext(operation_id='get-latest-sync', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/latest/status', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetLatestSyncResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CompanySyncStatus]) - res.company_sync_status = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def initiate_sync(self, request: operations.InitiateSyncRequest, retries: Optional[utils.RetryConfig] = None) -> operations.InitiateSyncResponse: - r"""Initiate sync - Initiate sync of pending transactions. - """ - hook_ctx = HookContext(operation_id='initiate-sync', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.InitiateSyncRequest, "initiate_sync", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','422','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.InitiateSyncResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 202: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.SyncInitiated]) - res.sync_initiated = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 422, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListSyncsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListSyncsResponse: - r"""List sync statuses - Gets a list of sync statuses - """ - hook_ctx = HookContext(operation_id='list-syncs', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/list/status', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListSyncsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[List[shared.CompanySyncStatus]]) - res.classes = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/transaction_status.py b/sync-for-expenses/src/codatsyncexpenses/transaction_status.py deleted file mode 100644 index e26c42830..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/transaction_status.py +++ /dev/null @@ -1,181 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import List, Optional - -class TransactionStatus: - r"""Retrieve the status of transactions within a sync.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, request: operations.GetSyncTransactionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetSyncTransactionResponse: - r"""Get sync transaction - Gets the status of a transaction for a sync - """ - hook_ctx = HookContext(operation_id='get-sync-transaction', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetSyncTransactionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[List[shared.Transaction]]) - res.transaction_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListSyncTransactionsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListSyncTransactionsResponse: - r"""List sync transactions - Gets the transactions and status for a sync - """ - hook_ctx = HookContext(operation_id='list-sync-transactions', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListSyncTransactionsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Transactions]) - res.transactions = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/transfers.py b/sync-for-expenses/src/codatsyncexpenses/transfers.py deleted file mode 100644 index 0230f7ab5..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/transfers.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .sdkconfiguration import SDKConfiguration -from codatsyncexpenses import utils -from codatsyncexpenses._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatsyncexpenses.models import errors, operations, shared -from typing import Optional - -class Transfers: - r"""Create transfer transactions.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateTransferTransactionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateTransferTransactionResponse: - r"""Create transfer transaction - Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransaction) in the accounting platform for a given company's connection. - - Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. - - The `from.amount` and `to.amount` fields are in the native currency of the account. - """ - hook_ctx = HookContext(operation_id='create-transfer-transaction', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/sync/expenses/transfer-transactions/{transactionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateTransferTransactionRequest, "create_transfer_request", False, True, 'json') - if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateTransferTransactionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CreateTransferResponse]) - res.create_transfer_response = out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/sync-for-expenses/src/codatsyncexpenses/utils/__init__.py b/sync-for-expenses/src/codatsyncexpenses/utils/__init__.py deleted file mode 100644 index 94b739857..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/utils/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .retries import * -from .utils import * diff --git a/sync-for-expenses/src/codatsyncexpenses/utils/retries.py b/sync-for-expenses/src/codatsyncexpenses/utils/retries.py deleted file mode 100644 index c40fc413c..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/utils/retries.py +++ /dev/null @@ -1,119 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import random -import time -from typing import List - -import requests - - -class BackoffStrategy: - initial_interval: int - max_interval: int - exponent: float - max_elapsed_time: int - - def __init__(self, initial_interval: int, max_interval: int, exponent: float, max_elapsed_time: int): - self.initial_interval = initial_interval - self.max_interval = max_interval - self.exponent = exponent - self.max_elapsed_time = max_elapsed_time - - -class RetryConfig: - strategy: str - backoff: BackoffStrategy - retry_connection_errors: bool - - def __init__(self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool): - self.strategy = strategy - self.backoff = backoff - self.retry_connection_errors = retry_connection_errors - - -class Retries: - config: RetryConfig - status_codes: List[str] - - def __init__(self, config: RetryConfig, status_codes: List[str]): - self.config = config - self.status_codes = status_codes - - -class TemporaryError(Exception): - response: requests.Response - - def __init__(self, response: requests.Response): - self.response = response - - -class PermanentError(Exception): - inner: Exception - - def __init__(self, inner: Exception): - self.inner = inner - - -def retry(func, retries: Retries): - if retries.config.strategy == 'backoff': - def do_request(): - res: requests.Response - try: - res = func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if status_major >= code_range and status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except requests.exceptions.ConnectionError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except requests.exceptions.Timeout as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return retry_with_backoff(do_request, retries.config.backoff.initial_interval, retries.config.backoff.max_interval, retries.config.backoff.exponent, retries.config.backoff.max_elapsed_time) - - return func() - - -def retry_with_backoff(func, initial_interval=500, max_interval=60000, exponent=1.5, max_elapsed_time=3600000): - start = round(time.time()*1000) - retries = 0 - - while True: - try: - return func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time()*1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = ((initial_interval/1000) * - exponent**retries + random.uniform(0, 1)) - sleep = min(sleep, max_interval / 1000) - time.sleep(sleep) - retries += 1 diff --git a/sync-for-expenses/src/codatsyncexpenses/utils/utils.py b/sync-for-expenses/src/codatsyncexpenses/utils/utils.py deleted file mode 100644 index 47e2c3042..000000000 --- a/sync-for-expenses/src/codatsyncexpenses/utils/utils.py +++ /dev/null @@ -1,1060 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import base64 -import json -import re -import sys -from dataclasses import Field, fields, is_dataclass, make_dataclass -from datetime import date, datetime -from decimal import Decimal -from email.message import Message -from enum import Enum -from typing import ( - Any, - Callable, - Dict, - List, - Optional, - Tuple, - Union, - get_args, - get_origin, -) -from xmlrpc.client import boolean -from typing_inspect import is_optional_type -import dateutil.parser -from dataclasses_json import DataClassJsonMixin - - -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, str]]: - headers: Dict[str, str] = {} - query_params: Dict[str, str] = {} - - if security is None: - return headers, query_params - - sec_fields: Tuple[Field, ...] = fields(security) - for sec_field in sec_fields: - value = getattr(security, sec_field.name) - if value is None: - continue - - metadata = sec_field.metadata.get("security") - if metadata is None: - continue - if metadata.get("option"): - _parse_security_option(headers, query_params, value) - return headers, query_params - if metadata.get("scheme"): - # Special case for basic auth which could be a flattened struct - if metadata.get("sub_type") == "basic" and not is_dataclass(value): - _parse_security_scheme(headers, query_params, metadata, security) - else: - _parse_security_scheme(headers, query_params, metadata, value) - - return headers, query_params - - -def _parse_security_option( - headers: Dict[str, str], query_params: Dict[str, str], option: Any -): - opt_fields: Tuple[Field, ...] = fields(option) - for opt_field in opt_fields: - metadata = opt_field.metadata.get("security") - if metadata is None or metadata.get("scheme") is None: - continue - _parse_security_scheme( - headers, query_params, metadata, getattr(option, opt_field.name) - ) - - -def _parse_security_scheme( - headers: Dict[str, str], - query_params: Dict[str, str], - scheme_metadata: Dict, - scheme: Any, -): - scheme_type = scheme_metadata.get("type") - sub_type = scheme_metadata.get("sub_type") - - if is_dataclass(scheme): - if scheme_type == "http" and sub_type == "basic": - _parse_basic_auth_scheme(headers, scheme) - return - - scheme_fields: Tuple[Field, ...] = fields(scheme) - for scheme_field in scheme_fields: - metadata = scheme_field.metadata.get("security") - if metadata is None or metadata.get("field_name") is None: - continue - - value = getattr(scheme, scheme_field.name) - - _parse_security_scheme_value( - headers, query_params, scheme_metadata, metadata, value - ) - else: - _parse_security_scheme_value( - headers, query_params, scheme_metadata, scheme_metadata, scheme - ) - - -def _parse_security_scheme_value( - headers: Dict[str, str], - query_params: Dict[str, str], - scheme_metadata: Dict, - security_metadata: Dict, - value: Any, -): - scheme_type = scheme_metadata.get("type") - sub_type = scheme_metadata.get("sub_type") - - header_name = str(security_metadata.get("field_name")) - - if scheme_type == "apiKey": - if sub_type == "header": - headers[header_name] = value - elif sub_type == "query": - query_params[header_name] = value - else: - raise Exception("not supported") - elif scheme_type == "openIdConnect": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "oauth2": - if sub_type != "client_credentials": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "http": - if sub_type == "bearer": - headers[header_name] = _apply_bearer(value) - else: - raise Exception("not supported") - else: - raise Exception("not supported") - - -def _apply_bearer(token: str) -> str: - return token.lower().startswith("bearer ") and token or f"Bearer {token}" - - -def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): - username = "" - password = "" - - scheme_fields: Tuple[Field, ...] = fields(scheme) - for scheme_field in scheme_fields: - metadata = scheme_field.metadata.get("security") - if metadata is None or metadata.get("field_name") is None: - continue - - field_name = metadata.get("field_name") - value = getattr(scheme, scheme_field.name) - - if field_name == "username": - username = value - if field_name == "password": - password = value - - data = f"{username}:{password}".encode() - headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" - - -def generate_url( - server_url: str, - path: str, - path_params: Any, - gbls: Optional[Any] = None, -) -> str: - path_param_values: Dict[str, str] = {} - - globals_already_populated = _populate_path_params( - path_params, gbls, path_param_values, [] - ) - if gbls is not None: - _populate_path_params(gbls, None, path_param_values, globals_already_populated) - - for key, value in path_param_values.items(): - path = path.replace("{" + key + "}", value, 1) - - return remove_suffix(server_url, "/") + path - - -def _populate_path_params( - path_params: Any, - gbls: Any, - path_param_values: Dict[str, str], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - path_param_fields: Tuple[Field, ...] = fields(path_params) - for field in path_param_fields: - if field.name in skip_fields: - continue - - param_metadata = field.metadata.get("path_param") - if param_metadata is None: - continue - - param = getattr(path_params, field.name) if path_params is not None else None - param, global_found = _populate_from_globals( - field.name, param, "path_param", gbls - ) - if global_found: - globals_already_populated.append(field.name) - - if param is None: - continue - - f_name = param_metadata.get("field_name", field.name) - serialization = param_metadata.get("serialization", "") - if serialization != "": - serialized_params = _get_serialized_params( - param_metadata, field.type, f_name, param - ) - for key, value in serialized_params.items(): - path_param_values[key] = value - else: - if param_metadata.get("style", "simple") == "simple": - if isinstance(param, List): - pp_vals: List[str] = [] - for pp_val in param: - if pp_val is None: - continue - pp_vals.append(_val_to_string(pp_val)) - path_param_values[param_metadata.get("field_name", field.name)] = ( - ",".join(pp_vals) - ) - elif isinstance(param, Dict): - pp_vals: List[str] = [] - for pp_key in param: - if param[pp_key] is None: - continue - if param_metadata.get("explode"): - pp_vals.append(f"{pp_key}={_val_to_string(param[pp_key])}") - else: - pp_vals.append(f"{pp_key},{_val_to_string(param[pp_key])}") - path_param_values[param_metadata.get("field_name", field.name)] = ( - ",".join(pp_vals) - ) - elif not isinstance(param, (str, int, float, complex, bool, Decimal)): - pp_vals: List[str] = [] - param_fields: Tuple[Field, ...] = fields(param) - for param_field in param_fields: - param_value_metadata = param_field.metadata.get("path_param") - if not param_value_metadata: - continue - - param_name = param_value_metadata.get("field_name", field.name) - - param_field_val = getattr(param, param_field.name) - if param_field_val is None: - continue - if param_metadata.get("explode"): - pp_vals.append( - f"{param_name}={_val_to_string(param_field_val)}" - ) - else: - pp_vals.append( - f"{param_name},{_val_to_string(param_field_val)}" - ) - path_param_values[param_metadata.get("field_name", field.name)] = ( - ",".join(pp_vals) - ) - else: - path_param_values[param_metadata.get("field_name", field.name)] = ( - _val_to_string(param) - ) - - return globals_already_populated - - -def is_optional(field): - return get_origin(field) is Union and type(None) in get_args(field) - - -def template_url(url_with_params: str, params: Dict[str, str]) -> str: - for key, value in params.items(): - url_with_params = url_with_params.replace("{" + key + "}", value) - - return url_with_params - - -def get_query_params( - query_params: Any, - gbls: Optional[Any] = None, -) -> Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - globals_already_populated = _populate_query_params(query_params, gbls, params, []) - if gbls is not None: - _populate_query_params(gbls, None, params, globals_already_populated) - - return params - - -def _populate_query_params( - query_params: Any, - gbls: Any, - query_param_values: Dict[str, List[str]], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - param_fields: Tuple[Field, ...] = fields(query_params) - for field in param_fields: - if field.name in skip_fields: - continue - - metadata = field.metadata.get("query_param") - if not metadata: - continue - - param_name = field.name - value = getattr(query_params, param_name) if query_params is not None else None - - value, global_found = _populate_from_globals( - param_name, value, "query_param", gbls - ) - if global_found: - globals_already_populated.append(param_name) - - f_name = metadata.get("field_name") - serialization = metadata.get("serialization", "") - if serialization != "": - serialized_parms = _get_serialized_params( - metadata, field.type, f_name, value - ) - for key, value in serialized_parms.items(): - if key in query_param_values: - query_param_values[key].extend(value) - else: - query_param_values[key] = [value] - else: - style = metadata.get("style", "form") - if style == "deepObject": - _populate_deep_object_query_params( - metadata, f_name, value, query_param_values - ) - elif style == "form": - _populate_delimited_query_params( - metadata, f_name, value, ",", query_param_values - ) - elif style == "pipeDelimited": - _populate_delimited_query_params( - metadata, f_name, value, "|", query_param_values - ) - else: - raise Exception("not yet implemented") - - return globals_already_populated - - -def get_headers(headers_params: Any, gbls: Optional[Any] = None) -> Dict[str, str]: - headers: Dict[str, str] = {} - - globals_already_populated = [] - if headers_params is not None: - globals_already_populated = _populate_headers(headers_params, gbls, headers, []) - if gbls is not None: - _populate_headers(gbls, None, headers, globals_already_populated) - - return headers - - -def _populate_headers( - headers_params: Any, - gbls: Any, - header_values: Dict[str, str], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - param_fields: Tuple[Field, ...] = fields(headers_params) - for field in param_fields: - if field.name in skip_fields: - continue - - metadata = field.metadata.get("header") - if not metadata: - continue - - value, global_found = _populate_from_globals( - field.name, getattr(headers_params, field.name), "header", gbls - ) - if global_found: - globals_already_populated.append(field.name) - value = _serialize_header(metadata.get("explode", False), value) - - if value != "": - header_values[metadata.get("field_name", field.name)] = value - - return globals_already_populated - - -def _get_serialized_params( - metadata: Dict, field_type: type, field_name: str, obj: Any -) -> Dict[str, str]: - params: Dict[str, str] = {} - - serialization = metadata.get("serialization", "") - if serialization == "json": - params[metadata.get("field_name", field_name)] = marshal_json(obj, field_type) - - return params - - -def _populate_deep_object_query_params( - metadata: Dict, field_name: str, obj: Any, params: Dict[str, List[str]] -): - if obj is None: - return - - if is_dataclass(obj): - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_param_metadata = obj_field.metadata.get("query_param") - if not obj_param_metadata: - continue - - obj_val = getattr(obj, obj_field.name) - if obj_val is None: - continue - - if isinstance(obj_val, List): - for val in obj_val: - if val is None: - continue - - if ( - params.get( - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ) - is None - ): - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ] = [] - - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ].append(_val_to_string(val)) - else: - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ] = [_val_to_string(obj_val)] - elif isinstance(obj, Dict): - for key, value in obj.items(): - if value is None: - continue - - if isinstance(value, List): - for val in value: - if val is None: - continue - - if ( - params.get(f'{metadata.get("field_name", field_name)}[{key}]') - is None - ): - params[f'{metadata.get("field_name", field_name)}[{key}]'] = [] - - params[f'{metadata.get("field_name", field_name)}[{key}]'].append( - _val_to_string(val) - ) - else: - params[f'{metadata.get("field_name", field_name)}[{key}]'] = [ - _val_to_string(value) - ] - - -def _get_query_param_field_name(obj_field: Field) -> str: - obj_param_metadata = obj_field.metadata.get("query_param") - - if not obj_param_metadata: - return "" - - return obj_param_metadata.get("field_name", obj_field.name) - - -def _populate_delimited_query_params( - metadata: Dict, - field_name: str, - obj: Any, - delimiter: str, - query_param_values: Dict[str, List[str]], -): - _populate_form( - field_name, - metadata.get("explode", True), - obj, - _get_query_param_field_name, - delimiter, - query_param_values, - ) - - -SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - "json": "application/json", - "form": "application/x-www-form-urlencoded", - "multipart": "multipart/form-data", - "raw": "application/octet-stream", - "string": "text/plain", -} - - -def serialize_request_body( - request: Any, - request_type: type, - request_field_name: str, - nullable: bool, - optional: bool, - serialization_method: str, - encoder=None, -) -> Tuple[Optional[str], Optional[Any], Optional[Any]]: - if request is None: - if not nullable and optional: - return None, None, None - - if not is_dataclass(request) or not hasattr(request, request_field_name): - return serialize_content_type( - request_field_name, - request_type, - SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], - request, - encoder, - ) - - request_val = getattr(request, request_field_name) - - if request_val is None: - if not nullable and optional: - return None, None, None - - request_fields: Tuple[Field, ...] = fields(request) - request_metadata = None - - for field in request_fields: - if field.name == request_field_name: - request_metadata = field.metadata.get("request") - break - - if request_metadata is None: - raise Exception("invalid request type") - - return serialize_content_type( - request_field_name, - request_type, - request_metadata.get("media_type", "application/octet-stream"), - request_val, - ) - - -def serialize_content_type( - field_name: str, request_type: Any, media_type: str, request: Any, encoder=None -) -> Tuple[Optional[str], Optional[Any], Optional[List[List[Any]]]]: - if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: - return media_type, marshal_json(request, request_type, encoder), None - if re.match(r"multipart\/.*", media_type) is not None: - return serialize_multipart_form(media_type, request) - if re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: - return media_type, serialize_form_data(field_name, request), None - if isinstance(request, (bytes, bytearray)): - return media_type, request, None - if isinstance(request, str): - return media_type, request, None - - raise Exception( - f"invalid request body type {type(request)} for mediaType {media_type}" - ) - - -def serialize_multipart_form( - media_type: str, request: Any -) -> Tuple[str, Any, List[List[Any]]]: - form: List[List[Any]] = [] - request_fields = fields(request) - - for field in request_fields: - val = getattr(request, field.name) - if val is None: - continue - - field_metadata = field.metadata.get("multipart_form") - if not field_metadata: - continue - - if field_metadata.get("file") is True: - file_fields = fields(val) - - file_name = "" - field_name = "" - content = bytes() - - for file_field in file_fields: - file_metadata = file_field.metadata.get("multipart_form") - if file_metadata is None: - continue - - if file_metadata.get("content") is True: - content = getattr(val, file_field.name) - else: - field_name = file_metadata.get("field_name", file_field.name) - file_name = getattr(val, file_field.name) - if field_name == "" or file_name == "" or content == bytes(): - raise Exception("invalid multipart/form-data file") - - form.append([field_name, [file_name, content]]) - elif field_metadata.get("json") is True: - to_append = [ - field_metadata.get("field_name", field.name), - [None, marshal_json(val, field.type), "application/json"], - ] - form.append(to_append) - else: - field_name = field_metadata.get("field_name", field.name) - if isinstance(val, List): - for value in val: - if value is None: - continue - form.append([field_name + "[]", [None, _val_to_string(value)]]) - else: - form.append([field_name, [None, _val_to_string(val)]]) - return media_type, None, form - - -def serialize_dict( - original: Dict, explode: bool, field_name, existing: Optional[Dict[str, List[str]]] -) -> Dict[str, List[str]]: - if existing is None: - existing = {} - - if explode is True: - for key, val in original.items(): - if key not in existing: - existing[key] = [] - existing[key].append(val) - else: - temp = [] - for key, val in original.items(): - temp.append(str(key)) - temp.append(str(val)) - if field_name not in existing: - existing[field_name] = [] - existing[field_name].append(",".join(temp)) - return existing - - -def serialize_form_data(field_name: str, data: Any) -> Dict[str, Any]: - form: Dict[str, List[str]] = {} - - if is_dataclass(data): - for field in fields(data): - val = getattr(data, field.name) - if val is None: - continue - - metadata = field.metadata.get("form") - if metadata is None: - continue - - field_name = metadata.get("field_name", field.name) - - if metadata.get("json"): - form[field_name] = [marshal_json(val, field.type)] - else: - if metadata.get("style", "form") == "form": - _populate_form( - field_name, - metadata.get("explode", True), - val, - _get_form_field_name, - ",", - form, - ) - else: - raise Exception(f"Invalid form style for field {field.name}") - elif isinstance(data, Dict): - for key, value in data.items(): - form[key] = [_val_to_string(value)] - else: - raise Exception(f"Invalid request body type for field {field_name}") - - return form - - -def _get_form_field_name(obj_field: Field) -> str: - obj_param_metadata = obj_field.metadata.get("form") - - if not obj_param_metadata: - return "" - - return obj_param_metadata.get("field_name", obj_field.name) - - -def _populate_form( - field_name: str, - explode: boolean, - obj: Any, - get_field_name_func: Callable, - delimiter: str, - form: Dict[str, List[str]], -): - if obj is None: - return form - - if is_dataclass(obj): - items = [] - - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_field_name = get_field_name_func(obj_field) - if obj_field_name == "": - continue - - val = getattr(obj, obj_field.name) - if val is None: - continue - - if explode: - form[obj_field_name] = [_val_to_string(val)] - else: - items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, Dict): - items = [] - for key, value in obj.items(): - if value is None: - continue - - if explode: - form[key] = [_val_to_string(value)] - else: - items.append(f"{key}{delimiter}{_val_to_string(value)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, List): - items = [] - - for value in obj: - if value is None: - continue - - if explode: - if not field_name in form: - form[field_name] = [] - form[field_name].append(_val_to_string(value)) - else: - items.append(_val_to_string(value)) - - if len(items) > 0: - form[field_name] = [delimiter.join([str(item) for item in items])] - else: - form[field_name] = [_val_to_string(obj)] - - return form - - -def _serialize_header(explode: bool, obj: Any) -> str: - if obj is None: - return "" - - if is_dataclass(obj): - items = [] - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_param_metadata = obj_field.metadata.get("header") - - if not obj_param_metadata: - continue - - obj_field_name = obj_param_metadata.get("field_name", obj_field.name) - if obj_field_name == "": - continue - - val = getattr(obj, obj_field.name) - if val is None: - continue - - if explode: - items.append(f"{obj_field_name}={_val_to_string(val)}") - else: - items.append(obj_field_name) - items.append(_val_to_string(val)) - - if len(items) > 0: - return ",".join(items) - elif isinstance(obj, Dict): - items = [] - - for key, value in obj.items(): - if value is None: - continue - - if explode: - items.append(f"{key}={_val_to_string(value)}") - else: - items.append(key) - items.append(_val_to_string(value)) - - if len(items) > 0: - return ",".join([str(item) for item in items]) - elif isinstance(obj, List): - items = [] - - for value in obj: - if value is None: - continue - - items.append(_val_to_string(value)) - - if len(items) > 0: - return ",".join(items) - else: - return f"{_val_to_string(obj)}" - - return "" - - -def unmarshal_json(data, typ, decoder=None): - unmarshal = make_dataclass("Unmarshal", [("res", typ)], bases=(DataClassJsonMixin,)) - json_dict = json.loads(data) - try: - out = unmarshal.from_dict({"res": json_dict}) - except AttributeError as attr_err: - raise AttributeError( - f"unable to unmarshal {data} as {typ} - {attr_err}" - ) from attr_err - - return out.res if decoder is None else decoder(out.res) - - -def marshal_json(val, typ, encoder=None): - if not is_optional_type(typ) and val is None: - raise ValueError(f"Could not marshal None into non-optional type: {typ}") - - marshal = make_dataclass("Marshal", [("res", typ)], bases=(DataClassJsonMixin,)) - marshaller = marshal(res=val) - json_dict = marshaller.to_dict() - val = json_dict["res"] if encoder is None else encoder(json_dict["res"]) - - return json.dumps(val, separators=(",", ":"), sort_keys=True) - - -def match_content_type(content_type: str, pattern: str) -> boolean: - if pattern in (content_type, "*", "*/*"): - return True - - msg = Message() - msg["content-type"] = content_type - media_type = msg.get_content_type() - - if media_type == pattern: - return True - - parts = media_type.split("/") - if len(parts) == 2: - if pattern in (f"{parts[0]}/*", f"*/{parts[1]}"): - return True - - return False - - -def match_status_codes(status_codes: List[str], status_code: int) -> bool: - for code in status_codes: - if code == str(status_code): - return True - - if code.endswith("XX") and code.startswith(str(status_code)[:1]): - return True - return False - - -def datetimeisoformat(optional: bool): - def isoformatoptional(val): - if optional and val is None: - return None - return _val_to_string(val) - - return isoformatoptional - - -def dateisoformat(optional: bool): - def isoformatoptional(val): - if optional and val is None: - return None - return date.isoformat(val) - - return isoformatoptional - - -def datefromisoformat(date_str: str): - return dateutil.parser.parse(date_str).date() - - -def bigintencoder(optional: bool): - def bigintencode(val: int): - if optional and val is None: - return None - return str(val) - - return bigintencode - - -def bigintdecoder(val): - if isinstance(val, float): - raise ValueError(f"{val} is a float") - return int(val) - - -def decimalencoder(optional: bool, as_str: bool): - def decimalencode(val: Decimal): - if optional and val is None: - return None - - if as_str: - return str(val) - - return float(val) - - return decimalencode - - -def decimaldecoder(val): - return Decimal(str(val)) - - -def map_encoder(optional: bool, value_encoder: Callable): - def map_encode(val: Dict): - if optional and val is None: - return None - - encoded = {} - for key, value in val.items(): - encoded[key] = value_encoder(value) - - return encoded - - return map_encode - - -def map_decoder(value_decoder: Callable): - def map_decode(val: Dict): - decoded = {} - for key, value in val.items(): - decoded[key] = value_decoder(value) - - return decoded - - return map_decode - - -def list_encoder(optional: bool, value_encoder: Callable): - def list_encode(val: List): - if optional and val is None: - return None - - encoded = [] - for value in val: - encoded.append(value_encoder(value)) - - return encoded - - return list_encode - - -def list_decoder(value_decoder: Callable): - def list_decode(val: List): - decoded = [] - for value in val: - decoded.append(value_decoder(value)) - - return decoded - - return list_decode - - -def union_encoder(all_encoders: Dict[str, Callable]): - def selective_encoder(val: Any): - if type(val) in all_encoders: - return all_encoders[type(val)](val) - return val - - return selective_encoder - - -def union_decoder(all_decoders: List[Callable]): - def selective_decoder(val: Any): - decoded = val - for decoder in all_decoders: - try: - decoded = decoder(val) - break - except (TypeError, ValueError): - continue - return decoded - - return selective_decoder - - -def get_field_name(name): - def override(_, _field_name=name): - return _field_name - - return override - - -def _val_to_string(val) -> str: - if isinstance(val, bool): - return str(val).lower() - if isinstance(val, datetime): - return str(val.isoformat().replace("+00:00", "Z")) - if isinstance(val, Enum): - return str(val.value) - - return str(val) - - -def _populate_from_globals( - param_name: str, value: Any, param_type: str, gbls: Any -) -> Tuple[Any, bool]: - if gbls is None: - return value, False - - global_fields = fields(gbls) - - found = False - for field in global_fields: - if field.name is not param_name: - continue - - found = True - - if value is not None: - return value, True - - global_value = getattr(gbls, field.name) - - param_metadata = field.metadata.get(param_type) - if param_metadata is None: - return value, True - - return global_value, True - - return value, found - - -def decoder_with_discriminator(field_name): - def decode_fx(obj): - kls = getattr(sys.modules["sdk.models.shared"], obj[field_name]) - return unmarshal_json(json.dumps(obj), kls) - - return decode_fx - - -def remove_suffix(input_string, suffix): - if suffix and input_string.endswith(suffix): - return input_string[: -len(suffix)] - return input_string diff --git a/sync-for-expenses/tests/helpers.py b/sync-for-expenses/tests/helpers.py deleted file mode 100644 index b3d095040..000000000 --- a/sync-for-expenses/tests/helpers.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import re - - -def sort_query_parameters(url): - parts = url.split("?") - - if len(parts) == 1: - return url - - query = parts[1] - params = query.split("&") - - params.sort(key=lambda x: x.split('=')[0]) - - return parts[0] + "?" + "&".join(params) - - -def sort_serialized_maps(inp: any, regex: str, delim: str): - - def sort_map(m): - entire_match = m.group(0) - - groups = m.groups() - - for group in groups: - pairs = [] - if '=' in group: - pairs = group.split(delim) - - pairs.sort(key=lambda x: x.split('=')[0]) - else: - values = group.split(delim) - - if len(values) == 1: - pairs = values - else: - pairs = [''] * int(len(values)/2) - # loop though every 2nd item - for i in range(0, len(values), 2): - pairs[int(i/2)] = values[i] + delim + values[i+1] - - pairs.sort(key=lambda x: x.split(delim)[0]) - - entire_match = entire_match.replace(group, delim.join(pairs)) - - return entire_match - - if isinstance(inp, str): - return re.sub(regex, sort_map, inp) - elif isinstance(inp, list): - for i, v in enumerate(inp): - inp[i] = sort_serialized_maps(v, regex, delim) - return inp - elif isinstance(inp, dict): - for k, v in inp.items(): - inp[k] = sort_serialized_maps(v, regex, delim) - return inp - else: - raise Exception("Unsupported type")