From 3d31b2b008e1cad80767b798bc58c3d7965997fd Mon Sep 17 00:00:00 2001 From: codat-sdk-codegen Date: Wed, 5 Aug 2026 19:29:39 +0000 Subject: [PATCH] sync-for-payables: regenerate with the in-house pipeline @ 1b5626f, version 9.3.2 -> 9.3.3 --- sync-for-payables/.speakeasy/gen.lock | 2323 ------------ sync-for-payables/.speakeasy/gen.yaml | 91 - sync-for-payables/RELEASES.md | 12 +- sync-for-payables/USAGE.md | 48 +- .../docs/lib/utils/retryconfig.md | 46 +- .../docs/sdk/models/errors/errormessage.md | 42 +- .../operations/createbankaccountrequest.md | 40 +- .../operations/createbillpaymentrequest.md | 44 +- .../models/operations/createbillrequest.md | 42 +- .../operations/createconnectionrequest.md | 34 +- .../operations/createconnectionrequestbody.md | 32 +- .../operations/createsupplierrequest.md | 40 +- .../models/operations/deletecompanyrequest.md | 32 +- .../operations/deleteconnectionrequest.md | 36 +- .../downloadbillattachmentrequest.md | 44 +- .../getcompanyinformationrequest.md | 36 +- .../models/operations/getcompanyrequest.md | 32 +- .../models/operations/getconnectionrequest.md | 36 +- .../getmappingoptionsbillsrequest.md | 45 +- .../getmappingoptionspaymentsrequest.md | 45 +- .../operations/listbillattachmentsrequest.md | 40 +- .../sdk/models/operations/listbillsrequest.md | 43 +- .../models/operations/listcompaniesrequest.md | 44 +- .../operations/listconnectionsrequest.md | 44 +- .../models/operations/listsuppliersrequest.md | 43 +- .../operations/replacecompanyrequest.md | 34 +- .../operations/unlinkconnectionrequest.md | 38 +- .../unlinkconnectionupdateconnection.md | 30 +- .../models/operations/updatebillrequest.md | 44 +- .../models/operations/updatecompanyrequest.md | 34 +- .../operations/updatesupplierrequest.md | 42 +- .../operations/uploadbillattachmentrequest.md | 38 +- .../sdk/models/shared/accountmappingoption.md | 50 +- .../docs/sdk/models/shared/accountstatus.md | 32 +- .../docs/sdk/models/shared/address.md | 40 +- .../docs/sdk/models/shared/addresstype.md | 32 +- .../docs/sdk/models/shared/attachment.md | 80 +- .../sdk/models/shared/attachmentupload.md | 32 +- .../docs/sdk/models/shared/bankaccount.md | 53 +- .../models/shared/bankaccountmappingoption.md | 51 +- .../sdk/models/shared/bankaccountprototype.md | 48 +- .../sdk/models/shared/bankaccountstatus.md | 32 +- .../docs/sdk/models/shared/bankaccounttype.md | 36 +- .../docs/sdk/models/shared/bill.md | 74 +- .../docs/sdk/models/shared/billaccountref.md | 32 +- .../docs/sdk/models/shared/billlineitem.md | 49 +- .../sdk/models/shared/billmappingoptions.md | 53 +- .../docs/sdk/models/shared/billpayment.md | 57 +- .../models/shared/billpaymentaccountref.md | 34 +- .../sdk/models/shared/billpaymentprototype.md | 53 +- .../docs/sdk/models/shared/billprototype.md | 60 +- .../docs/sdk/models/shared/bills.md | 53 +- .../docs/sdk/models/shared/billstatus.md | 32 +- .../docs/sdk/models/shared/billtaxrateref.md | 32 +- .../models/shared/clientratelimitwebhook.md | 45 +- .../shared/clientratelimitwebhookpayload.md | 36 +- .../docs/sdk/models/shared/codatfile.md | 32 +- .../docs/sdk/models/shared/companies.md | 54 +- .../docs/sdk/models/shared/company.md | 122 +- .../sdk/models/shared/companyinformation.md | 34 +- .../sdk/models/shared/companyreference.md | 44 +- .../models/shared/companyreferencelinks.md | 32 +- .../sdk/models/shared/companyrequestbody.md | 38 +- .../sdk/models/shared/companyupdaterequest.md | 38 +- .../docs/sdk/models/shared/connection.md | 95 +- .../docs/sdk/models/shared/connections.md | 54 +- .../sdk/models/shared/dataconnectionerror.md | 44 +- .../sdk/models/shared/dataconnectionstatus.md | 32 +- .../docs/sdk/models/shared/datatype.md | 32 +- .../docs/sdk/models/shared/errorstatus.md | 32 +- .../docs/sdk/models/shared/errorvalidation.md | 34 +- .../sdk/models/shared/errorvalidationitem.md | 32 +- .../docs/sdk/models/shared/halref.md | 28 +- .../docs/sdk/models/shared/links.md | 41 +- .../docs/sdk/models/shared/pagination.md | 28 +- .../models/shared/paymentmappingoptions.md | 43 +- .../docs/sdk/models/shared/security.md | 32 +- .../docs/sdk/models/shared/sourcetype.md | 32 +- .../docs/sdk/models/shared/supplier.md | 99 +- .../sdk/models/shared/supplierprototype.md | 50 +- .../docs/sdk/models/shared/supplierref.md | 36 +- .../docs/sdk/models/shared/suppliers.md | 56 +- .../docs/sdk/models/shared/supplierstatus.md | 32 +- .../sdk/models/shared/taxratemappingoption.md | 42 +- .../docs/sdk/models/shared/taxratestatus.md | 36 +- .../docs/sdk/models/shared/trackingref.md | 37 +- .../docs/sdks/bankaccounts/README.md | 446 ++- .../docs/sdks/billpayments/README.md | 656 ++-- sync-for-payables/docs/sdks/bills/README.md | 2752 +++++++------- .../docs/sdks/companies/README.md | 2098 +++++------ .../docs/sdks/companyinformation/README.md | 174 +- .../docs/sdks/connections/README.md | 934 ++--- .../docs/sdks/suppliers/README.md | 1658 +++++---- sync-for-payables/jsr.json | 27 - sync-for-payables/package.json | 60 +- sync-for-payables/src/apis/BankAccounts.ts | 98 + sync-for-payables/src/apis/BillPayments.ts | 172 + sync-for-payables/src/apis/Bills.ts | 543 +++ sync-for-payables/src/apis/Companies.ts | 338 ++ .../src/apis/CompanyInformation.ts | 86 + sync-for-payables/src/apis/Connections.ts | 324 ++ sync-for-payables/src/apis/Suppliers.ts | 229 ++ sync-for-payables/src/apis/index.ts | 9 + sync-for-payables/src/core.ts | 15 +- sync-for-payables/src/funcs/_adapter.ts | 13 + .../src/funcs/bankAccountsCreate.ts | 225 +- .../src/funcs/billPaymentsCreate.ts | 230 +- .../funcs/billPaymentsGetPaymentOptions.ts | 226 +- sync-for-payables/src/funcs/billsCreate.ts | 224 +- .../src/funcs/billsDownloadAttachment.ts | 214 +- .../src/funcs/billsGetBillOptions.ts | 226 +- sync-for-payables/src/funcs/billsList.ts | 226 +- .../src/funcs/billsListAttachments.ts | 223 +- sync-for-payables/src/funcs/billsUpdate.ts | 239 +- .../src/funcs/billsUploadAttachment.ts | 260 +- .../src/funcs/companiesCreate.ts | 196 +- .../src/funcs/companiesDelete.ts | 198 +- sync-for-payables/src/funcs/companiesGet.ts | 198 +- sync-for-payables/src/funcs/companiesList.ts | 229 +- .../src/funcs/companiesReplace.ts | 201 +- .../src/funcs/companiesUpdate.ts | 202 +- .../src/funcs/companyInformationGet.ts | 216 +- .../src/funcs/connectionsCreate.ts | 198 +- .../src/funcs/connectionsDelete.ts | 202 +- sync-for-payables/src/funcs/connectionsGet.ts | 201 +- .../src/funcs/connectionsList.ts | 217 +- .../src/funcs/connectionsUnlink.ts | 202 +- .../src/funcs/suppliersCreate.ts | 234 +- sync-for-payables/src/funcs/suppliersList.ts | 239 +- .../src/funcs/suppliersUpdate.ts | 240 +- .../src/funcs/validateWebhook.ts | 120 +- sync-for-payables/src/hooks/hooks.ts | 175 +- sync-for-payables/src/hooks/index.ts | 9 +- sync-for-payables/src/hooks/types.ts | 111 +- sync-for-payables/src/index.ts | 16 +- sync-for-payables/src/lib/base64.ts | 37 - sync-for-payables/src/lib/config.ts | 71 +- sync-for-payables/src/lib/dlv.ts | 53 - sync-for-payables/src/lib/encodings.ts | 525 --- sync-for-payables/src/lib/files.ts | 109 +- sync-for-payables/src/lib/http.ts | 323 -- sync-for-payables/src/lib/is-plain-object.ts | 43 - sync-for-payables/src/lib/logger.ts | 9 - sync-for-payables/src/lib/matchers.ts | 346 -- sync-for-payables/src/lib/primitives.ts | 150 - sync-for-payables/src/lib/retries.ts | 218 -- sync-for-payables/src/lib/schemas.ts | 91 - sync-for-payables/src/lib/sdkconfig.ts | 473 +++ sync-for-payables/src/lib/sdks.ts | 405 -- sync-for-payables/src/lib/security.ts | 274 -- sync-for-payables/src/lib/url.ts | 35 - sync-for-payables/src/runtime.ts | 518 +++ sync-for-payables/src/sdk.ts | 89 + sync-for-payables/src/sdk/bankaccounts.ts | 31 +- sync-for-payables/src/sdk/billpayments.ts | 53 +- sync-for-payables/src/sdk/bills.ts | 168 +- sync-for-payables/src/sdk/companies.ts | 153 +- .../src/sdk/companyinformation.ts | 29 +- sync-for-payables/src/sdk/connections.ts | 104 +- sync-for-payables/src/sdk/index.ts | 6 +- .../src/sdk/models/BillEventPayload.ts | 124 + .../src/sdk/models/BillEventWebhook.ts | 97 + .../src/sdk/models/CompanyDetails.ts | 1452 ++++++++ .../src/sdk/models/CreateCompanyRequest.ts | 12 + .../src/sdk/models/DataStatus.ts | 201 + .../src/sdk/models/ErrorMessage.ts | 166 + .../src/sdk/models/PagingInfo.ts | 587 +++ .../src/sdk/models/PullOperation.ts | 341 ++ .../src/sdk/models/PullOperations.ts | 116 + .../src/sdk/models/PushChangeType.ts | 56 + .../src/sdk/models/PushOperation.ts | 399 ++ .../src/sdk/models/PushOperationChange.ts | 119 + .../src/sdk/models/PushOperationRef.ts | 147 + .../src/sdk/models/PushOperationStatus.ts | 55 + .../src/sdk/models/PushOperations.ts | 116 + .../src/sdk/models/SourceModifiedDate.ts | 277 ++ sync-for-payables/src/sdk/models/Status.ts | 72 + .../src/sdk/models/UpdateConnection.ts | 108 + .../src/sdk/models/Validation.ts | 111 + .../src/sdk/models/ValidationItem.ts | 106 + .../src/sdk/models/_speakeasy_enums.ts | 3285 +++++++++++++++++ .../src/sdk/models/_speakeasy_hoisted.ts | 9 + .../models/errors/codatsyncpayableserror.ts | 47 +- .../src/sdk/models/errors/errormessage.ts | 142 +- .../src/sdk/models/errors/httpclienterrors.ts | 69 +- .../src/sdk/models/errors/index.ts | 17 +- .../models/errors/responsevalidationerror.ts | 61 +- .../src/sdk/models/errors/sdkerror.ts | 41 +- .../sdk/models/errors/sdkvalidationerror.ts | 121 +- sync-for-payables/src/sdk/models/index.ts | 102 + .../models/operations/createbankaccount.ts | 60 +- .../src/sdk/models/operations/createbill.ts | 60 +- .../models/operations/createbillpayment.ts | 67 +- .../sdk/models/operations/createconnection.ts | 77 +- .../operations/createconnectionrequestbody.ts | 83 + .../sdk/models/operations/createsupplier.ts | 60 +- .../sdk/models/operations/deletecompany.ts | 36 +- .../sdk/models/operations/deleteconnection.ts | 43 +- .../operations/downloadbillattachment.ts | 61 +- .../src/sdk/models/operations/getcompany.ts | 36 +- .../operations/getcompanyinformation.ts | 45 +- .../sdk/models/operations/getconnection.ts | 43 +- .../operations/getmappingoptionsbills.ts | 61 +- .../operations/getmappingoptionspayments.ts | 61 +- .../src/sdk/models/operations/index.ts | 55 +- .../models/operations/listbillattachments.ts | 50 +- .../src/sdk/models/operations/listbills.ts | 59 +- .../sdk/models/operations/listcompanies.ts | 66 +- .../sdk/models/operations/listconnections.ts | 66 +- .../sdk/models/operations/listsuppliers.ts | 59 +- .../sdk/models/operations/replacecompany.ts | 46 +- .../sdk/models/operations/unlinkconnection.ts | 85 +- .../src/sdk/models/operations/updatebill.ts | 67 +- .../sdk/models/operations/updatecompany.ts | 49 +- .../sdk/models/operations/updatesupplier.ts | 55 +- .../models/operations/uploadbillattachment.ts | 72 +- .../sdk/models/shared/accountmappingoption.ts | 431 ++- .../src/sdk/models/shared/accountstatus.ts | 58 +- .../src/sdk/models/shared/address.ts | 432 ++- .../src/sdk/models/shared/addresstype.ts | 64 +- .../src/sdk/models/shared/attachment.ts | 957 ++++- .../src/sdk/models/shared/attachmentupload.ts | 42 +- .../src/sdk/models/shared/bankaccount.ts | 719 +++- .../models/shared/bankaccountmappingoption.ts | 521 ++- .../sdk/models/shared/bankaccountprototype.ts | 358 +- .../sdk/models/shared/bankaccountstatus.ts | 58 +- .../src/sdk/models/shared/bankaccounttype.ts | 76 +- .../src/sdk/models/shared/bill.ts | 1182 +++++- .../src/sdk/models/shared/billaccountref.ts | 113 +- .../src/sdk/models/shared/billlineitem.ts | 503 ++- .../sdk/models/shared/billmappingoptions.ts | 252 +- .../src/sdk/models/shared/billpayment.ts | 365 +- .../models/shared/billpaymentaccountref.ts | 138 +- .../sdk/models/shared/billpaymentprototype.ts | 415 ++- .../src/sdk/models/shared/billprototype.ts | 828 ++++- .../src/sdk/models/shared/bills.ts | 144 +- .../src/sdk/models/shared/billstatus.ts | 70 +- .../src/sdk/models/shared/billtaxrateref.ts | 113 +- .../models/shared/clientratelimitwebhook.ts | 193 +- .../shared/clientratelimitwebhookpayload.ts | 210 +- .../src/sdk/models/shared/codatfile.ts | 38 +- .../src/sdk/models/shared/companies.ts | 231 +- .../src/sdk/models/shared/company.ts | 1545 +++++++- .../sdk/models/shared/companyinformation.ts | 133 +- .../src/sdk/models/shared/companyreference.ts | 506 ++- .../models/shared/companyreferencelinks.ts | 146 + .../sdk/models/shared/companyrequestbody.ts | 248 +- .../sdk/models/shared/companyupdaterequest.ts | 184 +- .../src/sdk/models/shared/connection.ts | 2393 +++++++++++- .../src/sdk/models/shared/connections.ts | 231 +- .../sdk/models/shared/dataconnectionerror.ts | 772 +++- .../sdk/models/shared/dataconnectionstatus.ts | 68 +- .../src/sdk/models/shared/errorvalidation.ts | 120 +- .../sdk/models/shared/errorvalidationitem.ts | 140 +- .../src/sdk/models/shared/halref.ts | 180 +- .../src/sdk/models/shared/index.ts | 108 +- .../src/sdk/models/shared/links.ts | 398 +- .../src/sdk/models/shared/pagination.ts | 327 +- .../models/shared/paymentmappingoptions.ts | 204 +- .../src/sdk/models/shared/security.ts | 32 - .../src/sdk/models/shared/supplier.ts | 665 +++- .../sdk/models/shared/supplierprototype.ts | 527 ++- .../src/sdk/models/shared/supplierref.ts | 212 +- .../src/sdk/models/shared/suppliers.ts | 147 +- .../src/sdk/models/shared/supplierstatus.ts | 66 +- .../sdk/models/shared/taxratemappingoption.ts | 350 +- .../src/sdk/models/shared/trackingref.ts | 149 +- sync-for-payables/src/sdk/sdk.ts | 69 +- sync-for-payables/src/sdk/suppliers.ts | 115 +- sync-for-payables/src/sdk/types/async.ts | 99 +- sync-for-payables/src/sdk/types/blobs.ts | 32 - .../src/sdk/types/constdatetime.ts | 15 - sync-for-payables/src/sdk/types/decimal.ts | 6 +- sync-for-payables/src/sdk/types/enums.ts | 45 - sync-for-payables/src/sdk/types/fp.ts | 51 +- sync-for-payables/src/sdk/types/index.ts | 19 +- sync-for-payables/src/sdk/types/operations.ts | 7 +- sync-for-payables/src/sdk/types/rfcdate.ts | 56 +- sync-for-payables/src/sdk/types/streams.ts | 21 - .../src/sdk/types/unrecognized.ts | 35 - sync-for-payables/src/sdk/types/webhooks.ts | 7 - sync-for-payables/tsconfig.esm.json | 8 + sync-for-payables/tsconfig.json | 48 +- 283 files changed, 33462 insertions(+), 22464 deletions(-) delete mode 100644 sync-for-payables/.speakeasy/gen.lock delete mode 100644 sync-for-payables/.speakeasy/gen.yaml delete mode 100644 sync-for-payables/jsr.json create mode 100644 sync-for-payables/src/apis/BankAccounts.ts create mode 100644 sync-for-payables/src/apis/BillPayments.ts create mode 100644 sync-for-payables/src/apis/Bills.ts create mode 100644 sync-for-payables/src/apis/Companies.ts create mode 100644 sync-for-payables/src/apis/CompanyInformation.ts create mode 100644 sync-for-payables/src/apis/Connections.ts create mode 100644 sync-for-payables/src/apis/Suppliers.ts create mode 100644 sync-for-payables/src/apis/index.ts create mode 100644 sync-for-payables/src/funcs/_adapter.ts delete mode 100644 sync-for-payables/src/lib/base64.ts delete mode 100644 sync-for-payables/src/lib/dlv.ts delete mode 100644 sync-for-payables/src/lib/encodings.ts delete mode 100644 sync-for-payables/src/lib/http.ts delete mode 100644 sync-for-payables/src/lib/is-plain-object.ts delete mode 100644 sync-for-payables/src/lib/logger.ts delete mode 100644 sync-for-payables/src/lib/matchers.ts delete mode 100644 sync-for-payables/src/lib/primitives.ts delete mode 100644 sync-for-payables/src/lib/retries.ts delete mode 100644 sync-for-payables/src/lib/schemas.ts create mode 100644 sync-for-payables/src/lib/sdkconfig.ts delete mode 100644 sync-for-payables/src/lib/sdks.ts delete mode 100644 sync-for-payables/src/lib/security.ts delete mode 100644 sync-for-payables/src/lib/url.ts create mode 100644 sync-for-payables/src/runtime.ts create mode 100644 sync-for-payables/src/sdk.ts create mode 100644 sync-for-payables/src/sdk/models/BillEventPayload.ts create mode 100644 sync-for-payables/src/sdk/models/BillEventWebhook.ts create mode 100644 sync-for-payables/src/sdk/models/CompanyDetails.ts create mode 100644 sync-for-payables/src/sdk/models/CreateCompanyRequest.ts create mode 100644 sync-for-payables/src/sdk/models/DataStatus.ts create mode 100644 sync-for-payables/src/sdk/models/ErrorMessage.ts create mode 100644 sync-for-payables/src/sdk/models/PagingInfo.ts create mode 100644 sync-for-payables/src/sdk/models/PullOperation.ts create mode 100644 sync-for-payables/src/sdk/models/PullOperations.ts create mode 100644 sync-for-payables/src/sdk/models/PushChangeType.ts create mode 100644 sync-for-payables/src/sdk/models/PushOperation.ts create mode 100644 sync-for-payables/src/sdk/models/PushOperationChange.ts create mode 100644 sync-for-payables/src/sdk/models/PushOperationRef.ts create mode 100644 sync-for-payables/src/sdk/models/PushOperationStatus.ts create mode 100644 sync-for-payables/src/sdk/models/PushOperations.ts create mode 100644 sync-for-payables/src/sdk/models/SourceModifiedDate.ts create mode 100644 sync-for-payables/src/sdk/models/Status.ts create mode 100644 sync-for-payables/src/sdk/models/UpdateConnection.ts create mode 100644 sync-for-payables/src/sdk/models/Validation.ts create mode 100644 sync-for-payables/src/sdk/models/ValidationItem.ts create mode 100644 sync-for-payables/src/sdk/models/_speakeasy_enums.ts create mode 100644 sync-for-payables/src/sdk/models/_speakeasy_hoisted.ts create mode 100644 sync-for-payables/src/sdk/models/index.ts create mode 100644 sync-for-payables/src/sdk/models/operations/createconnectionrequestbody.ts create mode 100644 sync-for-payables/src/sdk/models/shared/companyreferencelinks.ts delete mode 100644 sync-for-payables/src/sdk/models/shared/security.ts delete mode 100644 sync-for-payables/src/sdk/types/blobs.ts delete mode 100644 sync-for-payables/src/sdk/types/constdatetime.ts delete mode 100644 sync-for-payables/src/sdk/types/enums.ts delete mode 100644 sync-for-payables/src/sdk/types/streams.ts delete mode 100644 sync-for-payables/src/sdk/types/unrecognized.ts delete mode 100644 sync-for-payables/src/sdk/types/webhooks.ts create mode 100644 sync-for-payables/tsconfig.esm.json diff --git a/sync-for-payables/.speakeasy/gen.lock b/sync-for-payables/.speakeasy/gen.lock deleted file mode 100644 index 060ed2351..000000000 --- a/sync-for-payables/.speakeasy/gen.lock +++ /dev/null @@ -1,2323 +0,0 @@ -lockVersion: 2.0.0 -id: fc401bb0-cd17-4863-8f85-003111be4b43 -management: - docChecksum: 384bfbce0790e3cb0ef8a6a311ab8782 - docVersion: 3.0.0 - speakeasyVersion: 1.761.5 - generationVersion: 2.879.13 - releaseVersion: 9.3.2 - configChecksum: faa290d3f5262eaf5bf706d194dce4ce - repoURL: https://github.com/codatio/client-sdk-typescript.git - repoSubDirectory: sync-for-payables - installationURL: https://github.com/codatio/client-sdk-typescript - published: true -persistentEdits: - generation_id: 4509736e-1686-498a-a67e-b42300ae1fe5 - pristine_commit_hash: 1aa4f2f2cd3f13641de63bb2e7943424a577b350 - pristine_tree_hash: 5032ae07dc046e746a791e0df54456fe5a48fda5 -features: - typescript: - additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.14 - core: 3.26.48 - decimal: 0.1.2 - defaultEnabledRetries: 0.1.0 - downloadStreams: 0.1.1 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.1.2 - examples: 2.82.5 - globalSecurity: 2.82.16 - globalSecurityCallbacks: 0.1.0 - globalSecurityFlattening: 0.1.1 - globalServerURLs: 2.83.1 - methodArguments: 0.1.2 - nameOverrides: 2.81.4 - nullables: 0.1.1 - responseFormat: 0.3.0 - retries: 2.83.0 - sdkHooks: 0.4.0 - serverEventsSentinels: 0.1.0 - uploadStreams: 0.1.1 - webhooks: 1.5.1 -trackedFiles: - .gitattributes: - id: 24139dae6567 - last_write_checksum: sha1:26d16d8297b104945139da8c25bd38feeaad3e25 - pristine_git_object: 113eead5093c17d43a46159132885318f281a68a - .npmignore: - id: aa70c1f807c3 - last_write_checksum: sha1:6572da81f2e7a978ec29c22c2210bf461c5897b2 - pristine_git_object: 670ac0a62d7e568c9d44a14f5deafb8442a255d8 - FUNCTIONS.md: - id: 21b9df02aaeb - last_write_checksum: sha1:0a0d27bba669518df770ad78b4e2efe9989661a0 - pristine_git_object: e0bf2256f0d4c3d4fafff1bb5b0d349139e0ca79 - RUNTIMES.md: - id: 620c490847b6 - last_write_checksum: sha1:e45b854f02c357cbcfdb8c3663000e8339e16505 - pristine_git_object: 27731c3b5ace66bedc454ed5acbe15075aacd3dc - USAGE.md: - id: 3aed33ce6e6f - last_write_checksum: sha1:29799e5e6553e872c6c90e7bed28f2366d0eca10 - pristine_git_object: 63e81dc1bbfd676a9595c4b25249ff148af96905 - docs/lib/utils/retryconfig.md: - id: 0ce9707cb848 - last_write_checksum: sha1:bc4454e196fcd219f5a78da690375a884f5ed07b - pristine_git_object: 08f95f4552349360b2c0b01802aa71ec3a55d2c2 - docs/sdk/models/errors/errormessage.md: - id: 9affd825e395 - last_write_checksum: sha1:87c165da16f652778f872f4d82a3ecb0bd6f9f61 - pristine_git_object: 3b0d871c2df297977b81672143a906cd75be967d - docs/sdk/models/operations/createbankaccountrequest.md: - id: 37b65b9ee948 - last_write_checksum: sha1:483907d110a90d48076bce1a91f61beb9de69ccd - pristine_git_object: 69ced2b3597cc95b373739d28e0932d2536f90f4 - docs/sdk/models/operations/createbillpaymentrequest.md: - id: 9b17afa6f632 - last_write_checksum: sha1:087ad523d1e3902a530c0fcc6673b912515eef27 - pristine_git_object: d6a553341c3855b78159c98464d38d1e5445b3c3 - docs/sdk/models/operations/createbillrequest.md: - id: 5e4c2319d34a - last_write_checksum: sha1:b65d34426fedb83df7c23b76812aa8846832db45 - pristine_git_object: cf72c5ebae8ffc67d39ba925c8d97cc9bc8496a2 - docs/sdk/models/operations/createconnectionrequest.md: - id: 43b13768fa3c - last_write_checksum: sha1:eb119e6f55bef64e85ebb71cd41f6c1498ea9438 - pristine_git_object: fde0ad5aeb5e3e965cfab3e263956f496fb4de64 - docs/sdk/models/operations/createconnectionrequestbody.md: - id: cd2a86f8a996 - last_write_checksum: sha1:5ee0d70ea351b108cc1593afb8838cfdd06b601c - pristine_git_object: 1e30f32b73ac845f814914914457a976e48d7d76 - docs/sdk/models/operations/createsupplierrequest.md: - id: ae6f827978a1 - last_write_checksum: sha1:ddc28cd008335e46d3cacf5eb1a2d13d6f564c86 - pristine_git_object: 7bca76b8c558c090c250b4d829f14ee28e8ab461 - docs/sdk/models/operations/deletecompanyrequest.md: - id: 01348357e18f - last_write_checksum: sha1:15ac25c9f7146805b3801384de95f08bbbb7c13c - pristine_git_object: 119f62cbe77504cb1718d2100af39627f19597fe - docs/sdk/models/operations/deleteconnectionrequest.md: - id: 70fe5fee5d10 - last_write_checksum: sha1:b978a67ef30703b8ce2f2f91748a196b54a0cd07 - pristine_git_object: 9d33a8e82a535f2c0ff5afe0b0269a6aa89d849f - docs/sdk/models/operations/downloadbillattachmentrequest.md: - id: 61983c8df748 - last_write_checksum: sha1:4b9f5b550b89ac9cbfc2660672320bb66b4d9e55 - pristine_git_object: e770d323831e80b2bf7de4c1dc5ec3555523db10 - docs/sdk/models/operations/getcompanyinformationrequest.md: - id: e53b744ff888 - last_write_checksum: sha1:fdff5a03f97e1397473991f73f0338c802f2b406 - pristine_git_object: 63c2c7a9f8d59de5d987b66b3dc2525f44d26967 - docs/sdk/models/operations/getcompanyrequest.md: - id: cb14d531f942 - last_write_checksum: sha1:c06e38587cb5b7c717b38489e87c78ed45245fcc - pristine_git_object: 95935d443375deb3c52c92b945eeacf1a3d7cfe1 - docs/sdk/models/operations/getconnectionrequest.md: - id: 6545321b6497 - last_write_checksum: sha1:8b45285956af0de2c86cec0110465d8d2a45a316 - pristine_git_object: db3c292f6781514d4af5f017719a8b5010a26335 - docs/sdk/models/operations/getmappingoptionsbillsrequest.md: - id: cb1d767e189e - last_write_checksum: sha1:64f1b56629bdc0a821f989f9b0a3a23bc1449f9a - pristine_git_object: 5ad854a14ad2511efd991d932c76ec1d83271a09 - docs/sdk/models/operations/getmappingoptionspaymentsrequest.md: - id: 1d4455dfd7f0 - last_write_checksum: sha1:f68486fa7b1e437fca537537da820ce03473b28b - pristine_git_object: de36ca7895eaf3831383d8224ffa79f831365059 - docs/sdk/models/operations/listbillattachmentsrequest.md: - id: 9debe2c87e3c - last_write_checksum: sha1:514b37f3fd315e3fd9f3733ed4b8fe18f57a0cfe - pristine_git_object: 603c66a5b15ee85718956e8361f3499995a7e9ad - docs/sdk/models/operations/listbillsrequest.md: - id: 88f8e1095669 - last_write_checksum: sha1:2b2f6765b8ca5ad3243a1e9e976e7223a1e9c616 - pristine_git_object: dcb8ccac2d1fd1518be219a12f6c36d26a2973c7 - docs/sdk/models/operations/listcompaniesrequest.md: - id: 605dcf27a33d - last_write_checksum: sha1:e4dfe6b55921907e0defd0253da88a0fa078be84 - pristine_git_object: 892f70b57072d3370e6fc2298aaff5e7185a16c6 - docs/sdk/models/operations/listconnectionsrequest.md: - id: 6b2aa79356a9 - last_write_checksum: sha1:ab54b68bd607be4f70f3cd998e4da2206cfe572b - pristine_git_object: b66c01daa6e4a19a14ae01970b4502a31d7cf212 - docs/sdk/models/operations/listsuppliersrequest.md: - id: 32a966d4f6d7 - last_write_checksum: sha1:074b59a267ec5cbe5ddd0e21f146faed21730e33 - pristine_git_object: c77c6c8a7df87db541ac48ef06b3b1e2e625e79a - docs/sdk/models/operations/replacecompanyrequest.md: - id: 2f79da54c18c - last_write_checksum: sha1:4eb7a2d65a3d87c8dcee8a30adde9caf503d67bd - pristine_git_object: 9b4ba9a91d0c1f7b58057e07861cad808e770e01 - docs/sdk/models/operations/unlinkconnectionrequest.md: - id: 9f3addbe3925 - last_write_checksum: sha1:16a59106af275f5c3435acc46bc4961414bf2c28 - pristine_git_object: a4d0c3f0f6c52b58943486fb3e6c12aead283865 - docs/sdk/models/operations/unlinkconnectionupdateconnection.md: - id: 454c96f5ba2d - last_write_checksum: sha1:7ef87755b95f4b86d49855d58179ef61130021c9 - pristine_git_object: 8e09632f06b883a64bf56d8c1a3289aef39ddb1f - docs/sdk/models/operations/updatebillrequest.md: - id: dbad2065f696 - last_write_checksum: sha1:3d55b95c97ca2bd2eb139851f4749212b652ef3e - pristine_git_object: f00dbf031bd526e9815fb44913d3f6a046fa85d0 - docs/sdk/models/operations/updatecompanyrequest.md: - id: 6501e66b32d2 - last_write_checksum: sha1:dca465bcbdfdbbbcd5768b034d226b32430ef0a3 - pristine_git_object: 144ed6cd0ab3894091b385527fd93617248e9214 - docs/sdk/models/operations/updatesupplierrequest.md: - id: 1f70a198fbdf - last_write_checksum: sha1:ebf40a57c203a1488361a3b395bd469fd3f9a0cd - pristine_git_object: ae033594d29a20d0fdfa24e4fa8af02808bea0d1 - docs/sdk/models/operations/uploadbillattachmentrequest.md: - id: 4d0fc508b57c - last_write_checksum: sha1:1b6833d55c20ff5022b26e198c1d10a9a8d2da55 - pristine_git_object: eeccc260188092622afbe529f63c04a06f788f8c - docs/sdk/models/shared/accountmappingoption.md: - id: f8960c862e21 - last_write_checksum: sha1:70a0697c7b04c9a3f5e9f6a25c17d7077c317fce - pristine_git_object: 012cbca5f05656bbc455cc8756aaf3bf4b725aad - docs/sdk/models/shared/accountstatus.md: - id: a8da19baff08 - last_write_checksum: sha1:6ac56b8e5fd4b21dbdfc1fe83e34bc182ec69ab7 - pristine_git_object: 9d08accad524560be3829f26f40a2dcfbadd46d0 - docs/sdk/models/shared/address.md: - id: c7a5d3edfbbf - last_write_checksum: sha1:897e5d811efbfb839b6506779059ba7c607e01ea - pristine_git_object: 0484dced3fd37514b369a03814aa12e57924d147 - docs/sdk/models/shared/addresstype.md: - id: 05429d1d4896 - last_write_checksum: sha1:a6c9f0abb0125e232f5528b78326b9d6cff713eb - pristine_git_object: 4dad9f2df1c59734aed95c619b18e7c726f08adc - docs/sdk/models/shared/attachment.md: - id: 36725df2d249 - last_write_checksum: sha1:2ecd74f90044d62846c28e1131de099a3381d228 - pristine_git_object: 83e98b96e5b418cb596467a4c2ffd612284fad2c - docs/sdk/models/shared/attachmentupload.md: - id: d5b29912ce98 - last_write_checksum: sha1:c66dea74f005d8c2b3b0d83e3b3ce8914d7c8ba1 - pristine_git_object: f574e91eeea75b77876e8b57c600a82cca974542 - docs/sdk/models/shared/bankaccount.md: - id: a71ab3d0bf48 - last_write_checksum: sha1:334ee524bc71d1ca23899a90a1b967c1a4e7f305 - pristine_git_object: 75197d533be1c41a50f1cc95dd38c28daf696c56 - docs/sdk/models/shared/bankaccountmappingoption.md: - id: 29e658f6e450 - last_write_checksum: sha1:c5a3b134e8332c7f5ff4a21c5159ee1dd469d22e - pristine_git_object: af7f469d50770577171bc6a2fc1c84e4fc22ab4f - docs/sdk/models/shared/bankaccountprototype.md: - id: 18647b021627 - last_write_checksum: sha1:52f384565eddaf3b7f40580d0859c2031d73c12c - pristine_git_object: 16cff76dca8ae7c3038a1ecfa852e5a3bda0f23a - docs/sdk/models/shared/bankaccountstatus.md: - id: bb5d0730c110 - last_write_checksum: sha1:60d8edd47c360c1192f450de1e144ab941c68fad - pristine_git_object: c318b5897142a48bb8aee09ff046c3479f1a0af1 - docs/sdk/models/shared/bankaccounttype.md: - id: c1d73962c4ab - last_write_checksum: sha1:9032929abd445abb427ffc40d66d64f6b5aa7d25 - pristine_git_object: 4fac2543aa7e0c0dc1ea7f888aee2bcb5db942b2 - docs/sdk/models/shared/bill.md: - id: 00ca34a63909 - last_write_checksum: sha1:745e1ee50594b75055a6edbca7f88c16fbeef036 - pristine_git_object: 7f71a429412386989736fadc0176ecd1760c5c45 - docs/sdk/models/shared/billaccountref.md: - id: ab2a9fcc40b6 - last_write_checksum: sha1:35e9dbe72ee7f810f1dc222f01fe0854071ef252 - pristine_git_object: 70e4050070a5f8a69e5e4627dc7d9f2a3d951ec3 - docs/sdk/models/shared/billlineitem.md: - id: 94d76eb3ef39 - last_write_checksum: sha1:7075b08200049ef506166e42b6ac5396fbf38cef - pristine_git_object: 8d828a732ff65098fc46ceff5799c40d1c2207bd - docs/sdk/models/shared/billmappingoptions.md: - id: 1857da742ed9 - last_write_checksum: sha1:0cce57a6fa60a2b9117fdabe60b21d4fe3d10cdb - pristine_git_object: ce404e26f35c7acf4b525d18af3dd6664ed1073c - docs/sdk/models/shared/billpayment.md: - id: 3c14f1e2cb4b - last_write_checksum: sha1:e532046d8f6d8f9107947684f1dbcc880ca195d2 - pristine_git_object: 9a39e102b58035238366da60b8111f93f1cbbe1c - docs/sdk/models/shared/billpaymentaccountref.md: - id: ad79442633c0 - last_write_checksum: sha1:ebf131c8609c441f44a6666aaf8851f3c0b929f9 - pristine_git_object: 1ba880f63ed1824af8bfdf3149ee1533413a2bfd - docs/sdk/models/shared/billpaymentprototype.md: - id: 9370ce20d209 - last_write_checksum: sha1:88608bb57230c27385620731d0657e369a7b0ea4 - pristine_git_object: d9aadc8bb5650e39baebc785d70c5498f4adf0e9 - docs/sdk/models/shared/billprototype.md: - id: 7f39fff97328 - last_write_checksum: sha1:272887dc134f8b00f3b9b802a2d32acbc30df472 - pristine_git_object: d3be780207f7d8249451c6b7712c9488f3da5f27 - docs/sdk/models/shared/bills.md: - id: 9f0e932f8fb7 - last_write_checksum: sha1:aba6b2c049b0f164acec8dfd955905a06571bfb0 - pristine_git_object: 317958c74c4cb52ede39b86a17df862fb36679ed - docs/sdk/models/shared/billstatus.md: - id: b9f63ac7e29b - last_write_checksum: sha1:c3cd6e156074781d1ba99cc926d347a3e1fadfa1 - pristine_git_object: 24bd0930ddf9f82da01ee719eea672b7e7d8ad6b - docs/sdk/models/shared/billtaxrateref.md: - id: 46e797b367e5 - last_write_checksum: sha1:c2e5d08a837528a9dda0076543c0bab8af241da3 - pristine_git_object: 4233d84a846692644a61ea68d3bedd6236e06fe1 - docs/sdk/models/shared/clientratelimitwebhook.md: - id: 2ad187176bc8 - last_write_checksum: sha1:7aa2f52ccc8f0088a765c5ed78bf322b62f132ab - pristine_git_object: b1e7e5ffa2da695d73825ac70dc568b67112c445 - docs/sdk/models/shared/clientratelimitwebhookpayload.md: - id: 455bfe8fe625 - last_write_checksum: sha1:e44330624b87c24001524cab67c86c88fc412c7d - pristine_git_object: afe0d6bcff1c7ed490f70319f29514a0b8f3c0a7 - docs/sdk/models/shared/codatfile.md: - id: b32544e3a5a3 - last_write_checksum: sha1:18eb035edd767bb64b5bf7785735f526a7db0d4a - pristine_git_object: 3df5c34d8cfc41c8423c869eadab63c612f5a0b5 - docs/sdk/models/shared/companies.md: - id: d934c193ecb6 - last_write_checksum: sha1:5a995427d08c27704ff35dbbb66f2797b15cfff1 - pristine_git_object: 6d817ea79a353d68a783b50742c6d5f47018a586 - docs/sdk/models/shared/company.md: - id: fb5206b144df - last_write_checksum: sha1:3f099693b05ea9fd938bd657aa6148e8baec645a - pristine_git_object: b1717626e006e2ecb56b671886794c7901495a2a - docs/sdk/models/shared/companyinformation.md: - id: d78b0b4b325a - last_write_checksum: sha1:ba150ec2e88dc076ca4b33b29754c38070b941e1 - pristine_git_object: 6a466c52e15c4fa797959917b45028787b8069e9 - docs/sdk/models/shared/companyreference.md: - id: eb83cae3df56 - last_write_checksum: sha1:238525b35289d8c3d34b69e31306eb22615d861a - pristine_git_object: 5c0ddc8f6e8a13bd091cad2ac4cc4bf6d8345a11 - docs/sdk/models/shared/companyreferencelinks.md: - id: bdd0ee48a65d - last_write_checksum: sha1:2fa6d89ac19a6f0c0562fd2f9faf1359ef390c0c - pristine_git_object: 0849f2a89df2466f5234b127727fd11b25bd464d - docs/sdk/models/shared/companyrequestbody.md: - id: 3f3dfd0aa865 - last_write_checksum: sha1:58c240006df1dbfda9a268a65294dd38ac970b6a - pristine_git_object: a5961b8ca7a71a6e57dad6b1f999c998bf4bb7a7 - docs/sdk/models/shared/companyupdaterequest.md: - id: cef525a660f4 - last_write_checksum: sha1:f39c19cdd6e2eb88f087a2aa5953bf61d5ffeb7b - pristine_git_object: c2895414e053283bafcd9865baaa72a806a83444 - docs/sdk/models/shared/connection.md: - id: 1c171381dd82 - last_write_checksum: sha1:627d17f01c6752b941bcb239c1c885ff236a7c1d - pristine_git_object: 8f6a4b0d4143cea3750a5c2b825c7be752c68605 - docs/sdk/models/shared/connections.md: - id: c39072f6f8dc - last_write_checksum: sha1:e1a0cd88fda53543151de90e25b28c34ca6629f8 - pristine_git_object: 4605317ee995d364b8e6766bd4cbef276a3a2577 - docs/sdk/models/shared/dataconnectionerror.md: - id: 993cf6eb3364 - last_write_checksum: sha1:872055e84691229e26abbb0ae930fce260f298c0 - pristine_git_object: 9c60fb1dba39474f8ca0598c6206196f1ce30837 - docs/sdk/models/shared/dataconnectionstatus.md: - id: fd14e3dc6ca5 - last_write_checksum: sha1:57c75966eb6caafc78628cd9a82861a16d12af3b - pristine_git_object: 99bdbad248f892b194b0ea64b2f40729398b891c - docs/sdk/models/shared/datatype.md: - id: 0338d85c906d - last_write_checksum: sha1:30386b827c08fa3541f637a65828ff3307dc0652 - pristine_git_object: 158edb5e095eff85af9acfe7005e5c202017d00d - docs/sdk/models/shared/errorstatus.md: - id: d836c01e48c6 - last_write_checksum: sha1:1505021cfe7d64cc5bf77160e8512f74f1b572e4 - pristine_git_object: 97ce376efb07b5421e4957c4cef54f9a4b1e1db6 - docs/sdk/models/shared/errorvalidation.md: - id: a1197fba13d0 - last_write_checksum: sha1:da4e95c307d6a2e0c9dd1cec699d39f8b46a801d - pristine_git_object: d1ae457642f7fdd97ef23e095425fb2f9d65d717 - docs/sdk/models/shared/errorvalidationitem.md: - id: dbec2a990008 - last_write_checksum: sha1:49fd307df6a3f262c5d431135bee315aefb44c6e - pristine_git_object: c053707441b153dcb8316e0620fc730ec57b0c9d - docs/sdk/models/shared/halref.md: - id: 140248af964e - last_write_checksum: sha1:697fceac16f2e453ff1d831a21a74ce62038693f - pristine_git_object: aba309c2d8aa8651a78b82226e1a14f412aa34d7 - docs/sdk/models/shared/links.md: - id: fa66a5b5f260 - last_write_checksum: sha1:8d2a5b16ac474273cdde82984654492309dad412 - pristine_git_object: 17d8cd9be1d1fe1ad10afc7ce9d840d331323657 - docs/sdk/models/shared/pagination.md: - id: 2979e4010d1b - last_write_checksum: sha1:4a05733b4b4e5745151aa9c1b4ee12cf464fce24 - pristine_git_object: 3e1d39ddc6984e8956468c9d5891bb855b8192ad - docs/sdk/models/shared/paymentmappingoptions.md: - id: ac2ee80d2b4d - last_write_checksum: sha1:d32e658607d145e011b1794f880c01e6402fd5c8 - pristine_git_object: dcfa3080bf26598363f977c1eab7eb7d79dc80c7 - docs/sdk/models/shared/security.md: - id: 972729c50a07 - last_write_checksum: sha1:6997fc87475c94be588a1d6f4a48221b8caf21df - pristine_git_object: 5f89ebba077a4641bc192f412e79f7722d2a901a - docs/sdk/models/shared/sourcetype.md: - id: 3ec91bdaf5e7 - last_write_checksum: sha1:5e91b7ecee2ec5889400a323d7178ee5b6e04e09 - pristine_git_object: f0a72e771acb7f304ce0ddfcab254c0dff5c6e0a - docs/sdk/models/shared/supplier.md: - id: 18b82dd2f554 - last_write_checksum: sha1:55473cd8c50a0885ce35dd6aad9ae044a4397ddd - pristine_git_object: 4eac748f59ced787572fc32d62325b9aecbdde75 - docs/sdk/models/shared/supplierprototype.md: - id: a27221eee44d - last_write_checksum: sha1:ddba8dad1749525662b8584769a81031984966e4 - pristine_git_object: 2e69e091e6980133ec9f80ec2e84109268df345f - docs/sdk/models/shared/supplierref.md: - id: 8bf8e8bdeb32 - last_write_checksum: sha1:1cf012570e51569753ee90384a858bab01433686 - pristine_git_object: c08bc8af699c692baec90a5d13dc6a3135dabd5e - docs/sdk/models/shared/suppliers.md: - id: 09016bddb305 - last_write_checksum: sha1:3eff0a8f68d1570c89d96f1799062d1520c7ee8a - pristine_git_object: d2581385bb9f823ed5fde53583e801ea3c937937 - docs/sdk/models/shared/supplierstatus.md: - id: 51c838d3b574 - last_write_checksum: sha1:7544360314ae26a33bbf7b9208071dd2bbe3f774 - pristine_git_object: 575c3229ed9634d6472dd22390faed0ce9ac204b - docs/sdk/models/shared/taxratemappingoption.md: - id: 7a055b1b4339 - last_write_checksum: sha1:646898ac07bc942399253a0b28e5bf9dfac05378 - pristine_git_object: 7bf026e93661970b4e06154abd93379f6def3960 - docs/sdk/models/shared/taxratestatus.md: - id: e45c0a84a1bd - last_write_checksum: sha1:7570b1b425ccae1a9b2a087faa7cce2178a5760e - pristine_git_object: dd0ffc12beab997210e41af08cc2dab7041df971 - docs/sdk/models/shared/trackingref.md: - id: 3fc50d3208ff - last_write_checksum: sha1:e8afa0e90a08814a5ae448f94eb46ac868a7f3d8 - pristine_git_object: ca27b21833be5f0fdf1d881925f1ff78ad069828 - docs/sdks/bankaccounts/README.md: - id: 510ffee224ea - last_write_checksum: sha1:35cdd88fcbf66d90e885dee71068e338ab4637ad - pristine_git_object: 432e19e5a357e41b8ee7d934f089cbc61b8caab5 - docs/sdks/billpayments/README.md: - id: 9436cf9c44bd - last_write_checksum: sha1:ef4376c2d72147a0f042f0f53a56f99afc45f3b4 - pristine_git_object: c0ce8a6c8983312aaeeacf2cf9fd41a22506ebd2 - docs/sdks/bills/README.md: - id: 2a9c97966ab7 - last_write_checksum: sha1:f0c756b9ab954d18a3295b1f757e6e03b3051f18 - pristine_git_object: 545aa7c433b6d1c02e3987a62f6c6a233d7a8efe - docs/sdks/companies/README.md: - id: 67e8a49afa67 - last_write_checksum: sha1:25dc55545cecb7e370f0250422daad664b367ca3 - pristine_git_object: 86f656c14fd1a7136166117f6b2eb8ca20ef2fb4 - docs/sdks/companyinformation/README.md: - id: 319c7ed51023 - last_write_checksum: sha1:e58f7db62956aa5382f424725b4d849bff2622ae - pristine_git_object: 69ba5168f3474d9be176c37afceb9bcb1932c96e - docs/sdks/connections/README.md: - id: 3ef8931411ea - last_write_checksum: sha1:81809c76ff5a4f03544f9109fe581a8e226ef6ab - pristine_git_object: 452a258b593b694757e26817c56f6fe1a51fc3d9 - docs/sdks/suppliers/README.md: - id: 85867190cd79 - last_write_checksum: sha1:13aab7180271a534e9db0c6a7f0ba52b5f1dd529 - pristine_git_object: 059dfa32c662ed67966d472fa81f30d129399c4c - eslint.config.mjs: - id: 461c8d07f6da - last_write_checksum: sha1:9398f326377fe47f67af2df6eb6370750c0790b4 - pristine_git_object: 67bccfec985be20a00970d90155752832dd47135 - examples/.env.template: - id: 52cbe5afed92 - last_write_checksum: sha1:76d03bc5b9c49e1ab64eaa3f3f7286111383c380 - pristine_git_object: 5839bf7761e40eca37f79d52f2d1cd869fe71ce2 - examples/README.md: - id: 9d0f69d6e677 - last_write_checksum: sha1:56057020c8214561ddbc5e6fa5b17bf5d381c322 - pristine_git_object: 196a773af0f0a771b0f21c3776a60ecb480c0b40 - examples/companiesList.example.ts: - id: 21346a1a073c - last_write_checksum: sha1:a4c280e8781505eb22d8a040a456a471bec5d25d - pristine_git_object: 962e6d4368773bffea6741633507b88795bde3bf - examples/package.json: - id: c1d7b0ec8e7e - last_write_checksum: sha1:c17f5a70b0e14db12b412afcd91c9a066bef48d9 - pristine_git_object: 978c98ebda9a2b1f9ea0961b7a06643f604d1d24 - jsr.json: - id: 7f6ab7767282 - last_write_checksum: sha1:cec6d55ce881ec20a25e384e8f9a72644101300c - pristine_git_object: b2c9844eeec3006aa3a25847e3aa5cbbb249de43 - package.json: - id: 7030d0b2f71b - last_write_checksum: sha1:df2cb8185aafd2ddb38f85223cb9c0d1a39f434c - pristine_git_object: 2fd28d81f6576812dbeaf1c0a059f5e3e9af2444 - src/core.ts: - id: f431fdbcd144 - last_write_checksum: sha1:8ac194d8a86c95d66ff881034c874004f103d6e8 - pristine_git_object: 3ef31d3371427926066c0f46d57f38b6872442b6 - src/funcs/bankAccountsCreate.ts: - id: c61c77ddef33 - last_write_checksum: sha1:4aedeefdc7b65646737c872cf01f44cab047cc74 - pristine_git_object: c3ff3ed109d1a57047bd8d1acaae3615a083b2a3 - src/funcs/billPaymentsCreate.ts: - id: 4a7573a8ef1f - last_write_checksum: sha1:444a08cc613e0535033d9d12c3f3ce96be420acd - pristine_git_object: 882a67539ce45987211a8cf0d2cb64c1f92f7112 - src/funcs/billPaymentsGetPaymentOptions.ts: - id: 3dcdf22bd7f2 - last_write_checksum: sha1:74781e3bb9398c22cc93304b16e71597f3ad0684 - pristine_git_object: f042d24e98a600704d907399ab7b725eb36c528b - src/funcs/billsCreate.ts: - id: 75c376a468d4 - last_write_checksum: sha1:0eba28f6a888557b9f6f0d8c05a4ed638d538453 - pristine_git_object: c84752311dd168a460e19d7cec9d22542071fe9c - src/funcs/billsDownloadAttachment.ts: - id: 2e4c12e9ceeb - last_write_checksum: sha1:3bb0b9e40bdd46ad8d7824b2e9982d4d1d755276 - pristine_git_object: 475a3bbcd85c2bb1eafb54a50fedb76b55caecf3 - src/funcs/billsGetBillOptions.ts: - id: 5872e47fa14f - last_write_checksum: sha1:cfbf410d40fbf30aba5a69d7018a330c2463acf8 - pristine_git_object: cfe0b76555f8a6d5bfb665ebdf30986c53925e64 - src/funcs/billsList.ts: - id: 7cc1b84a3584 - last_write_checksum: sha1:1759fa2e093755e46fc824173544372bee599ac8 - pristine_git_object: e776abb6ac82ea1ab1c65e53d56929d3b3bb212d - src/funcs/billsListAttachments.ts: - id: 116a7b452f5c - last_write_checksum: sha1:b99359be56e4aad9b5e8342d28398bf1af2e5163 - pristine_git_object: 7d43c85a42461ec524986ab1ea8e76a4bc0e5377 - src/funcs/billsUpdate.ts: - id: a652cf860449 - last_write_checksum: sha1:7a0d43c9bdc5c9a4a8b503d1b321e2a77e715562 - pristine_git_object: ffdf57fed871c050db4b166e8535696e9c239bad - src/funcs/billsUploadAttachment.ts: - id: d7311d53bc2f - last_write_checksum: sha1:b74f388b7ec61a6aa4c8bf2655e3a8c4e45acb54 - pristine_git_object: 7472b6c4136e5bd577dab1c7db9357715d44b6fa - src/funcs/companiesCreate.ts: - id: becfb79b6222 - last_write_checksum: sha1:498233a67b41aac2f783e6a69cc9fbc4ffafa76b - pristine_git_object: 3088009cb98e3f7f31aeb9e9b8257301d2b30e15 - src/funcs/companiesDelete.ts: - id: d4b8d3c15935 - last_write_checksum: sha1:2ab2ecd1f5389be634b35c71f73613e921df8595 - pristine_git_object: 150318df2b0f9e83654f1091b776a48a78d66adf - src/funcs/companiesGet.ts: - id: 497c5e9320c2 - last_write_checksum: sha1:1e0ae2ab01b3d3c8893d93383460939a03c119a6 - pristine_git_object: a951fc7338a735009a8c7caab4268541f9c4afcb - src/funcs/companiesList.ts: - id: c57fb769a99c - last_write_checksum: sha1:765673601ed79ee2d140cf250fffb0300506a242 - pristine_git_object: 647b990e9de66a329ff27230177f6a79428833c3 - src/funcs/companiesReplace.ts: - id: c141cb91cc73 - last_write_checksum: sha1:e55f386706b4c18d77788d78962b75d2949d349a - pristine_git_object: 5e270df4085f5c2563aa0fd7ccb2dc492d2ec9a4 - src/funcs/companiesUpdate.ts: - id: e3d7bd676c21 - last_write_checksum: sha1:c5ce9a8ee2af326b660f9e82c5ff67c67123fd45 - pristine_git_object: 6d55577b2445e39679da050791d8a2788e2c61e8 - src/funcs/companyInformationGet.ts: - id: d77e867a25e9 - last_write_checksum: sha1:9bb712f11b3e43a6dd71ea05230c7a80ab57d892 - pristine_git_object: 7b50da07c79e05ebdf75a2bc32deb87d24e1923c - src/funcs/connectionsCreate.ts: - id: 0423cc2d060b - last_write_checksum: sha1:5244c61027af98a5484581d682d1e8b6e83d90e3 - pristine_git_object: f49a47f9c82d8caaaa19e342e3496c7b952c2e82 - src/funcs/connectionsDelete.ts: - id: f33b14b4a39d - last_write_checksum: sha1:f1162764c5d4f3048d6165edf75a4a823b8bee75 - pristine_git_object: 55d0f7f67e5218a0fab6bba8fa444afe54d5a142 - src/funcs/connectionsGet.ts: - id: 6a1b6227b285 - last_write_checksum: sha1:bf8d34ac015f5843555325c2c37d87c9864e55ec - pristine_git_object: 972e332896faaf8b8d1b138bf0cb946ecc5b9e7c - src/funcs/connectionsList.ts: - id: ca36cb8b50d3 - last_write_checksum: sha1:f475d8b0bfce9d2bb666aa8a3ccb1c4cc071090b - pristine_git_object: 1e7d60812118969ca583aaea55ac257bb5403042 - src/funcs/connectionsUnlink.ts: - id: 0ff9d29a8016 - last_write_checksum: sha1:98ced888e700c29268a0d866e8e31d1e4ac78e5c - pristine_git_object: 0dc33eb10046e9171d85f290f82d8458f2412dae - src/funcs/suppliersCreate.ts: - id: ff2ee5ff481f - last_write_checksum: sha1:8ccbfdf9e6e6e1f9cefe3754d2965d78f5fa067c - pristine_git_object: 0d8100cb62e95b2fa0f1072b8a7b23e082edf836 - src/funcs/suppliersList.ts: - id: ae0c2ccb6871 - last_write_checksum: sha1:e0636f0f82c31b7cf7065084b14456ab3433338d - pristine_git_object: df736ae4457f77779dd389046d05178d00615d5f - src/funcs/suppliersUpdate.ts: - id: c36b960e49de - last_write_checksum: sha1:50e5ac4b0db30f159e2cda4615a9af9a9510264a - pristine_git_object: 129cccdaeffc23f6d96ebb11f4d9b96b3678ecbc - src/funcs/validateWebhook.ts: - id: f3ebc1bebb84 - last_write_checksum: sha1:1e69504955d7b8a8b9f0f25f7760f18dcbe7f2f9 - pristine_git_object: 8c4d3a6bd6d87a5be839877765b214b47ea07898 - src/hooks/hooks.ts: - id: a2463fc6f69b - last_write_checksum: sha1:9a569ea8f3177ddcdfe6cd903feaf5c2d2c36a9a - pristine_git_object: d34c88497fb1cfb22a725e52b4c218f36d0b5c8e - src/hooks/index.ts: - id: 5f2dab62b520 - last_write_checksum: sha1:1a11c073a6cd792932218e1d4ed36b8567bad8ef - pristine_git_object: f60ec7acd76141a71d78008c5a362eb0236d8335 - src/hooks/types.ts: - id: 2a02d86ec24f - last_write_checksum: sha1:a2145ca7943102b61791b4b067fb593f221349b3 - pristine_git_object: 494395f66d0a6de6f6cd8b1dc918557843158c1d - src/index.ts: - id: c5fb850250c7 - last_write_checksum: sha1:35c9cde3ae14b18b3f893a1afe8b6c44f8760f24 - pristine_git_object: dbcba164a0082e3bb8c43cf21fa7f8ffb9d35dfc - src/lib/base64.ts: - id: "598522066688" - last_write_checksum: sha1:b0b12ddbd8625efb47c0e955a18641aeb10c6532 - pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 - src/lib/config.ts: - id: 320761608fb3 - last_write_checksum: sha1:835a7136502fd3ac54a8a6f1eb4057d6dbe6950f - pristine_git_object: 13702fa82ec50987761ba6ea80bf2419e004a47c - src/lib/dlv.ts: - id: b1988214835a - last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 - pristine_git_object: e81091f5e536f82739f71379b1fddc2d147c49e2 - src/lib/encodings.ts: - id: 3bd8ead98afd - last_write_checksum: sha1:d47614c415b37e092965c34cb668562195701004 - pristine_git_object: 2791d25bc4f7cf6eec17a65f899851e225fa3deb - src/lib/files.ts: - id: e5efa54fcb95 - last_write_checksum: sha1:795c14026405d547bfc47012f7ad9666e530fa7f - pristine_git_object: 6ca6b37d35a12448da176ee2517cc036db12c81c - src/lib/http.ts: - id: 63a80782d37e - last_write_checksum: sha1:797cbf16d3c7c4d62d3ba0eedb08617524938457 - pristine_git_object: 13cf1fd7894a89f727b8d2db2ad24313a94f68c7 - src/lib/is-plain-object.ts: - id: b9862591096a - last_write_checksum: sha1:df687f25a9590b6fd95d39df41a652ae3fd4e517 - pristine_git_object: 61070d3d7c7e5e95b1ed7e7ea21869eb0767db77 - src/lib/logger.ts: - id: 7ee7741a02bf - last_write_checksum: sha1:0ec9d3a2a34c362746b767e4f9a746c055d57a7b - pristine_git_object: d181f2937d4128afbe9b0327e0f81d1fa9c877b7 - src/lib/matchers.ts: - id: d54b2253b719 - last_write_checksum: sha1:4775ae173392e86f356bb1ffd0d16f3c2d7b0d54 - pristine_git_object: b096d6f201a8f1b24dea405dc0cb1c75efdf4c97 - src/lib/primitives.ts: - id: 74859f750b28 - last_write_checksum: sha1:987869fc54790b9c22e9182099103d6aa7c67016 - pristine_git_object: d21f1dc49affa4e6d324bdd60811b470fdfa7eb6 - src/lib/retries.ts: - id: b24a69d15639 - last_write_checksum: sha1:f3da74dffcbe2756c69393f8600205aa1dc06e68 - pristine_git_object: e3ce9aba72150fc3c18f3105d39b21aba809377b - src/lib/schemas.ts: - id: deb4b531fae1 - last_write_checksum: sha1:b8517a14d3043f488f44e3b10ddd6cabdd22242f - pristine_git_object: dc2510e330727b01894e4d3954ea92a62c962e5d - src/lib/sdks.ts: - id: 8a6d91f1218d - last_write_checksum: sha1:66d56bfdbd12a17c58ca2b03f6b10b1c34380dbe - pristine_git_object: 43fcf336ef4986ed91de77f38e0cc8b3d9c4ed76 - src/lib/security.ts: - id: 0502afa7922e - last_write_checksum: sha1:808e939964cd1393080c8b6428dabf33f746bae5 - pristine_git_object: 3da8e733b499dfb3c174dab84751a95ebc42324a - src/lib/url.ts: - id: b0057e24ed76 - last_write_checksum: sha1:3bceadd74bf0b31adf13eb06b7531077c3e07d65 - pristine_git_object: 79e7ce660b3732053e3adcbb5a4cdeb51496e8aa - src/sdk/bankaccounts.ts: - id: 0f1139473f13 - last_write_checksum: sha1:3295d6179393edad7b55a050008dddbf12e51420 - pristine_git_object: 1c99cfa1e1ff38847f4e8049e235072fc66a107f - src/sdk/billpayments.ts: - id: fbe6fff8f39d - last_write_checksum: sha1:b09aff24a62876f6e4bfe2d7ae098d2fe6ca10b9 - pristine_git_object: 63591a2053553e15dc188866e2ac283119813157 - src/sdk/bills.ts: - id: bfb7cb6dd91e - last_write_checksum: sha1:d97ffac8d7b1b62e8e02d5dcf7e2d0a024f53fa9 - pristine_git_object: 37c217d486e24c24c3145d7fdca0628c427e5706 - src/sdk/companies.ts: - id: 7d7df3fca5ca - last_write_checksum: sha1:adf6eda45c373f26cb05782b1056e6a5c2c13d52 - pristine_git_object: 26d34a940078cd984c57366fd575652e951bd568 - src/sdk/companyinformation.ts: - id: a31ed1f3ffb3 - last_write_checksum: sha1:b96a818ec0e16a58926b16011e28d61732dc5bd0 - pristine_git_object: 969ddf368b859e82f803dec69cc11b9e9e7d2193 - src/sdk/connections.ts: - id: 5992fff3b5cd - last_write_checksum: sha1:7fbe7d6d1f9aa1ad7059a7d602c7d7704bf4faa5 - pristine_git_object: 9253cd633f20b78f1b3044025146fdeb3409ae97 - src/sdk/index.ts: - id: a857902a703f - last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f - pristine_git_object: ecac2264817bb369ff2dbf0f0e9029807e67ff77 - src/sdk/models/errors/codatsyncpayableserror.ts: - id: a6c95131b59d - last_write_checksum: sha1:aba7822affc0515ac713e6ed783252d50659bc45 - pristine_git_object: 476e94ceb23bd6a4fbbd58e3710bc233feb91db7 - src/sdk/models/errors/errormessage.ts: - id: 2bc5b9b70870 - last_write_checksum: sha1:89b4c45920e5afe97f746c80c6fd5f7b10bf3662 - pristine_git_object: bba810b8615af07093380b31cae7adeb51a14d1e - src/sdk/models/errors/httpclienterrors.ts: - id: 7be0894f205a - last_write_checksum: sha1:994ced121c54fecd0af038ccfb7855fbfd3868ec - pristine_git_object: b34f612124c797c2a1106b9735708f679a90b74f - src/sdk/models/errors/index.ts: - id: 017ae2dc215b - last_write_checksum: sha1:605d488085deac192381c9fd99674821d462a3be - pristine_git_object: 907f0f2a97e332fcff70b9aadd7b7650501a8dee - src/sdk/models/errors/responsevalidationerror.ts: - id: 0b76670204e7 - last_write_checksum: sha1:b364187560bebd3ab42f7731e1eb0e31279d9274 - pristine_git_object: 45a94e33eb7f1736e32be35080507a379b9ade97 - src/sdk/models/errors/sdkerror.ts: - id: c231fdf3b914 - last_write_checksum: sha1:baa8757e30b1190e0d0bec42ed56922bc584bc8d - pristine_git_object: 2d987849b07c0e36282762c6a6f150eb9bae0817 - src/sdk/models/errors/sdkvalidationerror.ts: - id: 7c8a11e099b9 - last_write_checksum: sha1:a69da17627bcc32b820544608f3400423ea53f26 - pristine_git_object: 6826e1208a5d7b7d310535d18909646522bf0fbd - src/sdk/models/operations/createbankaccount.ts: - id: 384f1f4b636d - last_write_checksum: sha1:eb3a538d6f671236905dba8fa7edce1b40d73955 - pristine_git_object: 97592386068e8592534dc0da7d7968daa34c0420 - src/sdk/models/operations/createbill.ts: - id: cc771f1cb1cc - last_write_checksum: sha1:826ea53f4cc6b7f3fc98323a5e9f53021c6a4324 - pristine_git_object: f39957fec9d10824fde2114739eef392db84a79a - src/sdk/models/operations/createbillpayment.ts: - id: 0ee71ee0c364 - last_write_checksum: sha1:e04e19805517392a7bb36b43e2fcd954d72d2582 - pristine_git_object: faa4b6a35edbda1ec8dd6ecfed7e270cb4c347e6 - src/sdk/models/operations/createconnection.ts: - id: fd864cebfe91 - last_write_checksum: sha1:67abdd42c0f4b8669b59225b4cf97763bd0cca4c - pristine_git_object: dc5bcac12be709864c1f9a57ab0591899995abeb - src/sdk/models/operations/createsupplier.ts: - id: 3ac2b8655cd3 - last_write_checksum: sha1:96876fcdf552501f489b9d7de4de4ef387ded390 - pristine_git_object: 12d262ab13de6ba56ae1c9bf4d34f34ad7d99fa8 - src/sdk/models/operations/deletecompany.ts: - id: feff26e831a7 - last_write_checksum: sha1:3c6c30970b77ef97770f4a9fed7866b08bfd1ad0 - pristine_git_object: dbe555534894ed6e7f64cf4f034fff5fb58ddedb - src/sdk/models/operations/deleteconnection.ts: - id: 918aad3d3a4a - last_write_checksum: sha1:47fa476012d016921380a863c5457ef7babdd186 - pristine_git_object: 83f75997084050b7c35824dc9e065e81e3677b69 - src/sdk/models/operations/downloadbillattachment.ts: - id: bbb225a0d0f5 - last_write_checksum: sha1:4749f98fc7cdf39a901e01ce34d2456e09f87076 - pristine_git_object: 6adf19d90f4e12e88c73df7463261f752100377a - src/sdk/models/operations/getcompany.ts: - id: 4bef19281ada - last_write_checksum: sha1:3c30540e6bcdad8e8a51c616dc9e9b21934890ca - pristine_git_object: 77734decc381321230c2bfb8f340633b2064f315 - src/sdk/models/operations/getcompanyinformation.ts: - id: 8d727455797f - last_write_checksum: sha1:e3816c8b8f064c4d74ef49a3f5a5dd9e26ded9c1 - pristine_git_object: bcfcdff0ae86f247239cfc63eb26bb55d8f67d27 - src/sdk/models/operations/getconnection.ts: - id: e6be8d1eab2c - last_write_checksum: sha1:94309b857129d317a91f50bae1e58ab670779062 - pristine_git_object: 126d23b8515e33d0e3c796e642e68ee0f74a6e00 - src/sdk/models/operations/getmappingoptionsbills.ts: - id: 4b567b575627 - last_write_checksum: sha1:a2f9fa71f6fb737a27edfba842480c56caea564d - pristine_git_object: f088daae0e8e2ebe27d613399563b7bb5bf017e0 - src/sdk/models/operations/getmappingoptionspayments.ts: - id: 21c504ea43a2 - last_write_checksum: sha1:7ba3e7a2231cfc8d7bff9526159adf0dff318dbe - pristine_git_object: e3abe91dc20b75266936498daa6a04e90f407226 - src/sdk/models/operations/index.ts: - id: b2864d0519d7 - last_write_checksum: sha1:505fcd8ef9c4021c8f11e4f52ba6a26d89708c63 - pristine_git_object: 278d9d3bd729e5277ccc305c15ed1a51567a9567 - src/sdk/models/operations/listbillattachments.ts: - id: 4c9488a771ad - last_write_checksum: sha1:4ce52025b4b566e46e0a3a1795becd64d7c094c3 - pristine_git_object: 6262e27ea26748c4cfdb882fd9ebdcf6a1c3d828 - src/sdk/models/operations/listbills.ts: - id: 93bb62843719 - last_write_checksum: sha1:9a8cfe3b00fd09ab381b0d48535b05f79f1d5318 - pristine_git_object: 47d5bb0abf9feffe78d8645aebdd45262ef373de - src/sdk/models/operations/listcompanies.ts: - id: bd514f2d5c1c - last_write_checksum: sha1:1487d8f67d5a1c439e6581e854213aa1a386b9f3 - pristine_git_object: 837a6aae587e8a038402fbcedcd4fcc1873136ba - src/sdk/models/operations/listconnections.ts: - id: 5797f5b9be29 - last_write_checksum: sha1:0e709e410d2b500143f63d78e8eaa9ce4c810a6d - pristine_git_object: d1be0d9421b3b0d768650208abc91adcf7a9b721 - src/sdk/models/operations/listsuppliers.ts: - id: 5bd206cb074d - last_write_checksum: sha1:55e7339b9e752293639be0a7f87635d6dec05abe - pristine_git_object: 3fa159b5fdafa5a963448bbb6ec0ac11998df41d - src/sdk/models/operations/replacecompany.ts: - id: 15f9deaaf7eb - last_write_checksum: sha1:dd56621b0a190db2faed25c4f3f8ccc58c20210e - pristine_git_object: 5ee35551d47caea122b4f502f81b95691cc291ef - src/sdk/models/operations/unlinkconnection.ts: - id: 91e6d25ecd14 - last_write_checksum: sha1:5f4e32b0424df5658a94c777839f8a75adbe40ed - pristine_git_object: dbdba4a38ab397554e0d92300812dda648e941fd - src/sdk/models/operations/updatebill.ts: - id: 1c8f01a8941b - last_write_checksum: sha1:4f1ac22c3c7a78064cb2b0fb61a24a7848d15a67 - pristine_git_object: 2ccc0c5a87f77d28cd72451839b1dc0942d6f141 - src/sdk/models/operations/updatecompany.ts: - id: dbafb9e0f8d9 - last_write_checksum: sha1:937aaa5e965aae942c6550456dbe3c37b5d2b280 - pristine_git_object: 37ead4428659b0b2409ad7f6cf54515e544e23ec - src/sdk/models/operations/updatesupplier.ts: - id: 4c259e646cb1 - last_write_checksum: sha1:f7d37623859257edb9c452c9bf05304f4b624ef6 - pristine_git_object: 69cdde755d3f6e1f106524bb138115c4cdafa604 - src/sdk/models/operations/uploadbillattachment.ts: - id: db82a18c5aa9 - last_write_checksum: sha1:ed1546769f4039b3e5b351a6013e924a437a3f2e - pristine_git_object: bdfec6b1272094f3ebd88ce002a20046e320507b - src/sdk/models/shared/accountmappingoption.ts: - id: 21029bd2bde2 - last_write_checksum: sha1:1431d7f5b2d85f188b1410e88d7912ec47ac1fed - pristine_git_object: 7b003079c03356c3e2bb487c3ad0873f5ef9ad71 - src/sdk/models/shared/accountstatus.ts: - id: d3b6d9d9dc1b - last_write_checksum: sha1:cf2e822d702a668036c73990107bf83afdfb3b30 - pristine_git_object: 8f89f1c6fc0a40ed9a5440d98a70b49ce86b1e4c - src/sdk/models/shared/address.ts: - id: 123dc664e6b6 - last_write_checksum: sha1:6bc0bae915301145ca09163fd65e12ffca447061 - pristine_git_object: d40d6e69a20e6a68ca3550a3f31edfc159ec6765 - src/sdk/models/shared/addresstype.ts: - id: 8f46715578d6 - last_write_checksum: sha1:2a3313224e8bededfc7da6294878909847d1ba05 - pristine_git_object: 79122e862530948c41b67e42f51464afbdf2bc13 - src/sdk/models/shared/attachment.ts: - id: 22576f5ca1b9 - last_write_checksum: sha1:66d1f059ea904eaf8603f37a5357c61a1d184621 - pristine_git_object: 56c7e61fb1b37296e63e81c83e9fcb96ce9bdb91 - src/sdk/models/shared/attachmentupload.ts: - id: 6a392fdeca2f - last_write_checksum: sha1:641e54fc2352b948d32b49bd9024807e63554757 - pristine_git_object: 9d175ab2154386e54a967876024acc02dff71994 - src/sdk/models/shared/bankaccount.ts: - id: d58b53d62458 - last_write_checksum: sha1:14ab8fe5108b3737b26c9c9c73a9d780c72ada12 - pristine_git_object: 0f758d5955130ddf47dddd59a75d5f8afe62a44a - src/sdk/models/shared/bankaccountmappingoption.ts: - id: b3fef74a0c8c - last_write_checksum: sha1:f0367de303e9e38ad2526298e1937b0b4baccd96 - pristine_git_object: 71fb1473ebb873e115afe6c7b624fa80f7a742ce - src/sdk/models/shared/bankaccountprototype.ts: - id: 94ee5a709dfb - last_write_checksum: sha1:fca1c9101178ae77ca976745c74efd2d54b779af - pristine_git_object: f1a8f2f599d81b9340a74989c661219d5b814f95 - src/sdk/models/shared/bankaccountstatus.ts: - id: 01e2b1dd61c8 - last_write_checksum: sha1:b218b68559d2f170a5fc3ac5dced2a48b3a75164 - pristine_git_object: 5d54f42b78ae37223e06a210bf95c7dfc0f0f993 - src/sdk/models/shared/bankaccounttype.ts: - id: 5952c2e0e85b - last_write_checksum: sha1:fe5700f5c677e62a00833e7835d5ac70198aba9a - pristine_git_object: 4690447344052c8618d3a2c56f23c41e1f6351a3 - src/sdk/models/shared/bill.ts: - id: 32bb975f0251 - last_write_checksum: sha1:c70796e8ebf827aabc9579aacad7f507fbd65900 - pristine_git_object: 636ced5d6235d6ee0eacb68aa08487537098489c - src/sdk/models/shared/billaccountref.ts: - id: c08a3448c279 - last_write_checksum: sha1:c9c255a184b3102998194a06d8d1a53e729e091a - pristine_git_object: 592626318ad12e8897ebc23346353b75ee7b82ac - src/sdk/models/shared/billlineitem.ts: - id: b895a9163af6 - last_write_checksum: sha1:645377d23efb76df01693205b8cc43dfdea2b49b - pristine_git_object: 4a8c9d46fe4348940b99c5e0918820cd8b27443a - src/sdk/models/shared/billmappingoptions.ts: - id: 461ea9a57de9 - last_write_checksum: sha1:0699ad1573a0910f4e2cf60d4a244100a798cc9b - pristine_git_object: 24bcf35187ceecfb000ed3d644d92e20f44bfecb - src/sdk/models/shared/billpayment.ts: - id: 5f76ff527afe - last_write_checksum: sha1:d7719ba9c5a8ae8133d5231558aad7538902290e - pristine_git_object: 9bd47611602afe25ecab7c873a0f23bc1988e32b - src/sdk/models/shared/billpaymentaccountref.ts: - id: 8c638354df1d - last_write_checksum: sha1:83e5a9c1e71c048382118a7550c4c927ca6b3b31 - pristine_git_object: 6397a853d76f3578d10b75a494c0528e8b0b37c4 - src/sdk/models/shared/billpaymentprototype.ts: - id: 678fcb34437b - last_write_checksum: sha1:44d2e2526041e118cbc2f191053d78ff55c5328e - pristine_git_object: 147e6551f362622757ebfda4e25329cce20c9343 - src/sdk/models/shared/billprototype.ts: - id: 1b866ddc598c - last_write_checksum: sha1:5bfce4c0f3b319ecc41e7e5d8135f1addcb17f9e - pristine_git_object: 3cecca2203df9813da49577539c51561c47df751 - src/sdk/models/shared/bills.ts: - id: 8a8a2d27ebb7 - last_write_checksum: sha1:8d6227334a93fd8f72be644d8c3b8a76395c1d26 - pristine_git_object: 3c3aea425e377b649e77cd22daf9bec7277d1a07 - src/sdk/models/shared/billstatus.ts: - id: 3eb2db191719 - last_write_checksum: sha1:6cc683b2d6dcca224bce8b8ba8c6aa6102b421ed - pristine_git_object: 3db643f2574363fd80e481da0bd96487adc5a368 - src/sdk/models/shared/billtaxrateref.ts: - id: 8d1342c2b56d - last_write_checksum: sha1:adb5fdd9d7327d4b765ee0379707d6a6bdd0c475 - pristine_git_object: b28f0fd5162c0d032853cff967a0fb87ea0765b3 - src/sdk/models/shared/clientratelimitwebhook.ts: - id: c691f6d7f890 - last_write_checksum: sha1:873cdc12f8278470e382ae879c4bb2eb17f7f029 - pristine_git_object: cdc40c0b87eb15c3725596b713a38dec90aa9083 - src/sdk/models/shared/clientratelimitwebhookpayload.ts: - id: d068d62c8d39 - last_write_checksum: sha1:e9a21951c06c14ff5a39fd7379cd1c3bafc314d1 - pristine_git_object: 72605d6242434c3e2be999f0006634d5a193e129 - src/sdk/models/shared/codatfile.ts: - id: c7308ff582f1 - last_write_checksum: sha1:46a60236564ab061fff7b8496ad94922d8284ade - pristine_git_object: 0bc3490e3175f93bfcdf04ef1d88f4f56f9771c2 - src/sdk/models/shared/companies.ts: - id: a4b81f9ba7c8 - last_write_checksum: sha1:81432b885d166aad72ebfcdf5b25eb9c822545b4 - pristine_git_object: 0f308542ebb67c7b1d3262721bbe236d1176ef3c - src/sdk/models/shared/company.ts: - id: 8f41ac6a5b4f - last_write_checksum: sha1:1f36130119fc338a28f11002a683fdac137d7dc9 - pristine_git_object: 6c8aa2936e53da4f0fc5146bc49378cbc7abab70 - src/sdk/models/shared/companyinformation.ts: - id: 1ebdfe14e999 - last_write_checksum: sha1:d1fd26db230f9119898cc1e1eefd81808650a10a - pristine_git_object: 57919ecf8b45136a316cb0e90c59d1f1d2262f2a - src/sdk/models/shared/companyreference.ts: - id: f80ee466bdc7 - last_write_checksum: sha1:18f872a5210839d73dd540c541ef0b29609d6197 - pristine_git_object: 403e37ef74b8b1d3bff9075c509287ed96f84752 - src/sdk/models/shared/companyrequestbody.ts: - id: 9e2dd8b2247d - last_write_checksum: sha1:a3027f00426e9affb8b7f8d930db63b89c197607 - pristine_git_object: 5e438635a0842512ed8dd3a9ee464187ed7ff3fe - src/sdk/models/shared/companyupdaterequest.ts: - id: 9a4400207ec8 - last_write_checksum: sha1:371f7f83676f4130f9885c506c8184c53e202390 - pristine_git_object: 442b7a78cb3fde01477e7bb5cec5626c06a9a58b - src/sdk/models/shared/connection.ts: - id: 18ea99cdadfb - last_write_checksum: sha1:5b1dbfa5f03b30878a7c435749ecaec5956d17e8 - pristine_git_object: 7a8022769c2cadad8fd8071864d78e9e6e53bdb0 - src/sdk/models/shared/connections.ts: - id: 221acd1ae99a - last_write_checksum: sha1:ef2d949a3163430d3095303bf231c18b7dc93c9c - pristine_git_object: 1278d54c36183c06f6113dd14c25f115be7a6465 - src/sdk/models/shared/dataconnectionerror.ts: - id: c94cddffcec9 - last_write_checksum: sha1:e968b9983e395410ddd93aa9967671e46066eae2 - pristine_git_object: 1cb816d0f2b87e31e36ad1ece98b6f25bcdb148b - src/sdk/models/shared/dataconnectionstatus.ts: - id: 506ff77d012f - last_write_checksum: sha1:6ab2241aa8830aafaeb937d48e97918a68b9dac7 - pristine_git_object: 88889c800a39f393c9445929bbd2150fc6daf7ca - src/sdk/models/shared/errorvalidation.ts: - id: 7595eed057da - last_write_checksum: sha1:b7f44c1f99c9de84a9177a6fba2f76704a894a48 - pristine_git_object: dc97b86b1b0a47cc49cc6ce168bbf2dc7362a7d4 - src/sdk/models/shared/errorvalidationitem.ts: - id: 0fbe584c7194 - last_write_checksum: sha1:ea42d03e55f11719c38dc24ffdd5d982be3b1ce3 - pristine_git_object: cd21ec230bfad899a805264c87467c3a1762e9bc - src/sdk/models/shared/halref.ts: - id: 1c4609be4603 - last_write_checksum: sha1:b64b146493fe3613970c549edffd33e58402662a - pristine_git_object: 921d594fb96fe80f20787e9118d3def4a9e2d53c - src/sdk/models/shared/index.ts: - id: e97e906e3c14 - last_write_checksum: sha1:34ff68ac3f37e6e078d83101bcfeac78998f8c23 - pristine_git_object: 2d6c3711f20d73c3be4a70c86e459f9c00804462 - src/sdk/models/shared/links.ts: - id: 5c9b3efadf74 - last_write_checksum: sha1:453659d4b39a592c99b3b459eb9f44055f4c4195 - pristine_git_object: 751d7d00e4248ebfd0d28dadcc799607e058635b - src/sdk/models/shared/pagination.ts: - id: 4b84b39bc7e6 - last_write_checksum: sha1:63e1bfc1a2195fe42e883c9d64eddb9628573cde - pristine_git_object: 76c185a493690732462a0ab907745e71de47e2d5 - src/sdk/models/shared/paymentmappingoptions.ts: - id: 529c593bc4df - last_write_checksum: sha1:8ea9a4cde365e104cb2d007374f95f4350af8cf8 - pristine_git_object: a08a1d7f9539534a72541a7254d8a35153454610 - src/sdk/models/shared/security.ts: - id: 4a9790ed1c2f - last_write_checksum: sha1:1b51b365245ab2a0f5f5a06b90093bceb61fc084 - pristine_git_object: 675eaa5827f48cff71e28d1627f8d65a74e10623 - src/sdk/models/shared/supplier.ts: - id: 1bed69e4bad9 - last_write_checksum: sha1:77cffd0b1c233421f80420f922c8968446eb0793 - pristine_git_object: ec286a0bb2522409f8539ffa2e275a98046b1113 - src/sdk/models/shared/supplierprototype.ts: - id: 711b222b1a01 - last_write_checksum: sha1:bac82774d1ea65391a1f8536f022d374e3f7ec10 - pristine_git_object: 0354408f52762646cbe17d5461116a8c5ffed6d4 - src/sdk/models/shared/supplierref.ts: - id: 6c062678b570 - last_write_checksum: sha1:db11065947402121985e2a38957f0492d8c3d000 - pristine_git_object: 43af9728925e0aeaed2ab444e7a9fd6647d3720d - src/sdk/models/shared/suppliers.ts: - id: c62b9ef17289 - last_write_checksum: sha1:b651dad0af04c09ef23317fb50274794922a095a - pristine_git_object: 58e0651226863dbe68451fb0bdad17dc73328c01 - src/sdk/models/shared/supplierstatus.ts: - id: 507c6db656fa - last_write_checksum: sha1:9d4da55011629bd22151f5c1443c7004811a4d8c - pristine_git_object: 21b6220e1fcb3d01f5cbecc67b1213167b6b158d - src/sdk/models/shared/taxratemappingoption.ts: - id: 94ca8a0615f3 - last_write_checksum: sha1:35d3c8d368f4beec67ff10d5719df3fd98c068a1 - pristine_git_object: 0657c4a1b19cc3a28ceee5f9af9a2ca4445a630e - src/sdk/models/shared/trackingref.ts: - id: a863d4731f94 - last_write_checksum: sha1:f07d5d2e0ad446bdb53bed8d97c17f3360c0d2df - pristine_git_object: 4ee5f0010ee3fbf793d0daab0a1ea67ca20d8ee0 - src/sdk/sdk.ts: - id: 784571af2f69 - last_write_checksum: sha1:155dca2735dcfeaef023bd93998ab34a7c12c652 - pristine_git_object: 2da7d5fa26cf928d1e02acb3582f573f276d1fe4 - src/sdk/suppliers.ts: - id: 68b234e74022 - last_write_checksum: sha1:f3d5cb6caebe97f3e980c7292271713ee41aaf24 - pristine_git_object: 0ad27777da8c0a83c50f81d5a5061610dbf4be79 - src/sdk/types/async.ts: - id: 966026768b05 - last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 - pristine_git_object: 689dba5de50e8769e5f3bb913e3f42a146d15bc1 - src/sdk/types/blobs.ts: - id: 1def31341768 - last_write_checksum: sha1:cf45d78916671cb6345a11c97c633c64402bc27c - pristine_git_object: cce2892d4f573a120ef3907db90ab15f5979cfda - src/sdk/types/constdatetime.ts: - id: 7e64cb450e63 - last_write_checksum: sha1:dfaaf9adfaf49808bd4c9dea0039f21b7088d9c0 - pristine_git_object: fe62144eaf6a2054fc8ca9a98466e70f41b5434d - src/sdk/types/decimal.ts: - id: 4c47ee438ee8 - last_write_checksum: sha1:9e679d0ebb0a5b1efcbae4926d24893181f3fe8f - pristine_git_object: a7895d555b147e9bf9e3cd79f0b0e9f340d5ecd1 - src/sdk/types/enums.ts: - id: 2ac17fb928cd - last_write_checksum: sha1:ee590453d2c87e33e89c633d37ee46907eca0e58 - pristine_git_object: aba0ffd2a3308a31e516d83b52823d80aa65a8f9 - src/sdk/types/fp.ts: - id: d9ec77b9460c - last_write_checksum: sha1:d24994d58f37a1ca106847fcc6d2e976c6f1c093 - pristine_git_object: ccbe51eac69dfb0da5131f14fd753c4b47c1d527 - src/sdk/types/index.ts: - id: 8c869d66c5f3 - last_write_checksum: sha1:0e06df309f1646981212f4103ea27cbd65e1f50e - pristine_git_object: 19a7bd013477d20d80a670e6833a0f0c9b1c8aa7 - src/sdk/types/operations.ts: - id: c5e9c75d4266 - last_write_checksum: sha1:c49e724cfb1259296381cb57bc0fcdd2eae45865 - pristine_git_object: beb81e10f0b9eee2ed398a853fe6f737b743f818 - src/sdk/types/rfcdate.ts: - id: fc969c92a7c1 - last_write_checksum: sha1:8e5f382e02fe21c2f2e24deb1b7bbf8cddd3dd16 - pristine_git_object: c79b3f53a3dd922aa2ace5a4191c8652cf9a8e89 - src/sdk/types/streams.ts: - id: e556b428e8dc - last_write_checksum: sha1:cc9ced2dd34a76c3a1bd7784ccda1cc3b37ab9a9 - pristine_git_object: a0163e7a99cea88f21d0ad4ce3af1c720180ee20 - src/sdk/types/unrecognized.ts: - id: 690d294a1973 - last_write_checksum: sha1:d33ac686528492f4cdc0dbf81ed343b4afe020fe - pristine_git_object: b7a2a13f3dff50663429df24ae2f55b647ff1084 - src/sdk/types/webhooks.ts: - id: 0f676e5e22a7 - last_write_checksum: sha1:dbce0cb417bcdcfcae0827fa045ee93ccab1c2c8 - pristine_git_object: 9510d20c09d8dd689f6e37254030de22e997f3cc - tsconfig.json: - id: 61ebb9fd6e8c - last_write_checksum: sha1:79dc1550d921fefec69f8632ed3b24dad41ca2f6 - pristine_git_object: 76110f883cac40bb04fb2f376cd69ea8c8d6d215 -examples: - list-companies: - speakeasy-default-list-companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - One company: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - List of Companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "products": ["spend-insights", "lending", "payables-v2"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["lending", "spend-insights", "payables"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - Malformed query: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-company: - With no description: - requestBody: - application/json: {"name": "Technicalium"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a description: - requestBody: - application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a tag: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} - Malformed query: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - replace-company: - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "New Name"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Update description: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Same name", "description": "Additional documents required"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-replace-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - update-company: - Update tags: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"tags": {"refrence": "new reference"}} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "New Name"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - delete-company: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {} - "500": - application/json: {} - get-company: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - Parent multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} - Subsidiary multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-connections: - speakeasy-default-list-connections: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Connections: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "string"}, "current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}}} - 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: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-connection: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {} - "500": - application/json: {} - unlink-connection: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"status": "Unlinked"} - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-unlink-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - "401": - application/json: {} - "500": - application/json: {} - get-company-information: - Company information: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"companyName": "Bank of Dave", "baseCurrency": "GBP"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-mapping-options-bills: - speakeasy-default-get-mapping-options-bills: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - statusQuery: "status=Archived" - responses: - "200": - application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "610", "name": "Accounts Payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515"}]} - "400": - application/json: {} - "500": - application/json: {} - Mapping options: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - statusQuery: "status=Archived" - responses: - "200": - application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "879-i", "name": "Accounts payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00.000Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515", "name": "VAT @ 20%", "code": "VAT20", "effectiveTaxRate": 20, "totalTaxRate": 20, "status": "Active"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - statusQuery: "status=Archived" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-bills: - Status (open): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "status=Open" - responses: - "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"unitAmount": 724.94, "quantity": 8329.23, "accountRef": {}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (partially paid): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "status=PartiallyPaid" - responses: - "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"unitAmount": 724.94, "quantity": 8329.23, "accountRef": {}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Source modified date: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z" - responses: - "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"unitAmount": 724.94, "quantity": 8329.23, "accountRef": {}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (open) & source modified date: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open" - responses: - "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"unitAmount": 724.94, "quantity": 8329.23, "accountRef": {}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (partially paid) & source modified date: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid" - responses: - "200": - application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"unitAmount": 724.94, "quantity": 8329.23, "accountRef": {}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Bills: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - responses: - "200": - application/json: {"results": [{"id": "18", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Open", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "22", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Paid", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-bill: - Create bill: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} - responses: - "201": - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"unitAmount": 389.65, "quantity": 2803.72, "accountRef": {}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": - application/json: {} - "500": - application/json: {} - Created bill: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": null, "status": "Open"} - responses: - "201": - application/json: {"id": "bill-1029932", "reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7267.2, "amountDue": 7267.2} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": null, "status": "Open"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - upload-bill-attachment: - Attachment metadata: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "201": - application/json: {"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-bill-attachments: - Success: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: [{"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "20cfd269-2f0f-44ef-a28c-7b5f725cf1aa", "name": "another_receipt.png", "contentType": "image/png", "dateCreated": "2022-10-24T00:00:00.000Z", "fileSize": 98, "includeWhenSent": true, "sourceModifiedDate": "2022-05-27T12:38:10Z"}] - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - download-bill-attachment: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-download-bill-attachment: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/octet-stream: "x-file: example.file" - "401": - application/json: {} - "500": - application/json: {} - get-mapping-options-payments: - speakeasy-default-get-mapping-options-payments: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - statusQuery: "status=Archived" - responses: - "200": - application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Mapping options: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - statusQuery: "status=Archived" - responses: - "200": - application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "accountNumber": "12345678", "nominalCode": "1234567", "sortCode": "123456", "currency": "GBP", "status": "Active", "accountType": "Debit", "sourceModifiedDate": "2022-10-23T00:00:00.000Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - statusQuery: "status=Archived" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-bill-payment: - Bill payment example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"amount": 22, "date": "2022-10-23T00:00:00.000Z", "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": "7bda9f44sr56"}, "currencyRate": 1} - responses: - "201": - application/json: {"amount": 22, "date": "2022-10-23T00:00:00.000Z", "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": "9e32cbf8-e7d5-4d4d-a593-08d550682aab"}, "currencyRate": 1} - "400": - application/json: {} - "500": - application/json: {} - Bill payment: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"amount": 1329.54, "date": "2022-10-23T00:00:00Z", "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": ""}} - responses: - "201": - application/json: {"id": "billPayment-1029932", "amount": 22, "date": "2022-10-23T00:00:00.000Z", "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": "7bda9f44sr56"}, "currencyRate": 1} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"amount": 1329.54, "date": "2022-10-23T00:00:00Z", "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": ""}} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-suppliers: - Source modified date: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z" - responses: - "200": - application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (active): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "status=Active" - responses: - "200": - application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (archived): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "status=Archived" - responses: - "200": - application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (active) & source modified date: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active" - responses: - "200": - application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Status (archived) & source modified date: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived" - responses: - "200": - application/json: {"results": [{"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "supplierName": "Kelly's Industrial Supplies", "contactName": "Kelly Ipsum", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} - "400": - application/json: {} - "500": - application/json: {} - Suppliers: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - responses: - "200": - application/json: {"results": [{"id": "c523e12f-8b74-4d3a-bbd8-32d7a2f598b4", "supplierName": "City Limousines", "contactName": "Martin Dale", "emailAddress": "martyd@citylim.co", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "city": "Bakersfield", "region": "California", "country": "USA", "postalCode": "93308"}], "status": "Active", "balance": 100, "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"id": "41", "supplierName": "AI Support", "contactName": "AI Support", "addresses": [{"type": "Billing", "line1": "test", "region": "string", "country": "Djibouti"}], "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-12-07T10:48:18Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-supplier: - Suppliers: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"supplierName": "Northridge Office Supplies", "contactName": "Sarah Johnson", "emailAddress": "sarah.johnson@northridgesupplies.co.uk", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GB", "postalCode": "EC1N 7TE"}], "status": "Active", "defaultCurrency": "GBP"} - responses: - "201": - application/json: {"id": "sup-10933920", "supplierName": "Northridge Office Supplies", "contactName": "Sarah Johnson", "emailAddress": "sarah.johnson@northridgesupplies.co.uk", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GB", "postalCode": "EC1N 7TE"}], "status": "Active", "balance": 0, "defaultCurrency": "GBP", "sourceModifiedDate": "2026-03-18T10:30:00Z"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"supplierName": "", "phone": "+44 25691 154789", "status": "Unknown"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-bank-account: - Bank account example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"nominalCode": "22", "name": "Plutus - Payables - Bank Account 12", "accountType": "Debit", "accountNumber": "0120 0440", "sortCode": "50-50-50", "currency": "GBP"} - responses: - "201": - application/json: {"currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-bank-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} - responses: - "201": - application/json: {"currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": - application/json: {} - "500": - application/json: {} - Created bank account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} - responses: - "201": - application/json: {"id": "fb623ab2-f6ff-4b22-b7d3-b7cc2a4aa0ea", "nominalCode": "22", "name": "Plutus - Payables - Bank Account 12", "accountType": "Debit", "accountNumber": "0120 0440", "sortCode": "50-50-50", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2024-02-22T14:46:43.99Z"} - update-bill: - Update bill: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} - responses: - "200": - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": - application/json: {} - "500": - application/json: {} - Updated bill: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} - responses: - "200": - application/json: {"id": "bill-1029932", "reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7800, "amountDue": 7800} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-supplier: - Update supplier: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"supplierName": "Northridge Office Supplies", "contactName": "Sarah Johnson", "emailAddress": "sarah.johnson@northridgesupplies.co.uk", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GB", "postalCode": "EC1N 7TE"}], "status": "Active", "defaultCurrency": "GBP"} - responses: - "200": - application/json: {"id": "sup-10933920", "supplierName": "Northridge Office Supplies", "contactName": "Sarah Johnson", "emailAddress": "sarah.johnson@northridgesupplies.co.uk", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GB", "postalCode": "EC1N 7TE"}], "status": "Active", "balance": 0, "defaultCurrency": "GBP", "sourceModifiedDate": "2026-03-18T10:30:00Z"} - "400": - application/json: {} - "500": - application/json: {} - Updated supplier: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"supplierName": "", "phone": "+44 25691 154789", "status": "Active"} - responses: - "200": - application/json: {"id": "sup-10933920", "supplierName": "Northridge Office Supplies", "contactName": "Sarah Johnson", "emailAddress": "sarah.johnson@northridgesupplies.co.uk", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GB", "postalCode": "EC1N 7TE"}], "status": "Active", "balance": 0, "defaultCurrency": "GBP", "sourceModifiedDate": "2026-03-18T10:30:00Z"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"supplierName": "", "phone": "+44 25691 154789", "status": "Active"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} -examplesVersion: 1.0.2 -generatedTests: {} -releaseNotes: | - ## Typescript SDK Changes: - * `codatsyncpayables.companies.list()`: `response.results[].dataConnections[].integrationKey` **Changed** - * `codatsyncpayables.companies.create()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncpayables.companies.replace()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncpayables.companies.update()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncpayables.companies.get()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncpayables.connections.list()`: `response.results[].integrationKey` **Changed** - * `codatsyncpayables.connections.create()`: `response.integrationKey` **Changed** - * `codatsyncpayables.connections.get()`: `response.integrationKey` **Changed** - * `codatsyncpayables.connections.unlink()`: `response.integrationKey` **Changed** -generatedFiles: - - .gitattributes - - .npmignore - - FUNCTIONS.md - - RUNTIMES.md - - USAGE.md - - docs/lib/utils/retryconfig.md - - docs/sdk/models/errors/errormessage.md - - docs/sdk/models/operations/createbankaccountrequest.md - - docs/sdk/models/operations/createbillpaymentrequest.md - - docs/sdk/models/operations/createbillrequest.md - - docs/sdk/models/operations/createconnectionrequest.md - - docs/sdk/models/operations/createconnectionrequestbody.md - - docs/sdk/models/operations/createsupplierrequest.md - - docs/sdk/models/operations/deletecompanyrequest.md - - docs/sdk/models/operations/deleteconnectionrequest.md - - docs/sdk/models/operations/downloadbillattachmentrequest.md - - docs/sdk/models/operations/getcompanyinformationrequest.md - - docs/sdk/models/operations/getcompanyrequest.md - - docs/sdk/models/operations/getconnectionrequest.md - - docs/sdk/models/operations/getmappingoptionsbillsrequest.md - - docs/sdk/models/operations/getmappingoptionspaymentsrequest.md - - docs/sdk/models/operations/listbillattachmentsrequest.md - - docs/sdk/models/operations/listbillsrequest.md - - docs/sdk/models/operations/listcompaniesrequest.md - - docs/sdk/models/operations/listconnectionsrequest.md - - docs/sdk/models/operations/listsuppliersrequest.md - - docs/sdk/models/operations/replacecompanyrequest.md - - docs/sdk/models/operations/unlinkconnectionrequest.md - - docs/sdk/models/operations/unlinkconnectionupdateconnection.md - - docs/sdk/models/operations/updatecompanyrequest.md - - docs/sdk/models/operations/uploadbillattachmentrequest.md - - docs/sdk/models/shared/accountmappingoption.md - - docs/sdk/models/shared/accountstatus.md - - docs/sdk/models/shared/address.md - - docs/sdk/models/shared/addresstype.md - - docs/sdk/models/shared/attachment.md - - docs/sdk/models/shared/attachmentupload.md - - docs/sdk/models/shared/bankaccount.md - - docs/sdk/models/shared/bankaccountmappingoption.md - - docs/sdk/models/shared/bankaccountprototype.md - - docs/sdk/models/shared/bankaccountstatus.md - - docs/sdk/models/shared/bankaccounttype.md - - docs/sdk/models/shared/bill.md - - docs/sdk/models/shared/billaccountref.md - - docs/sdk/models/shared/billlineitem.md - - docs/sdk/models/shared/billmappingoptions.md - - docs/sdk/models/shared/billpayment.md - - docs/sdk/models/shared/billpaymentaccountref.md - - docs/sdk/models/shared/billpaymentprototype.md - - docs/sdk/models/shared/billprototype.md - - docs/sdk/models/shared/bills.md - - docs/sdk/models/shared/billstatus.md - - docs/sdk/models/shared/billtaxrateref.md - - docs/sdk/models/shared/clientratelimitwebhook.md - - docs/sdk/models/shared/clientratelimitwebhookpayload.md - - docs/sdk/models/shared/codatfile.md - - docs/sdk/models/shared/companies.md - - docs/sdk/models/shared/company.md - - docs/sdk/models/shared/companyinformation.md - - docs/sdk/models/shared/companyreference.md - - docs/sdk/models/shared/companyreferencelinks.md - - docs/sdk/models/shared/companyrequestbody.md - - docs/sdk/models/shared/companyupdaterequest.md - - docs/sdk/models/shared/connection.md - - docs/sdk/models/shared/connections.md - - docs/sdk/models/shared/dataconnectionerror.md - - docs/sdk/models/shared/dataconnectionstatus.md - - docs/sdk/models/shared/datatype.md - - docs/sdk/models/shared/errorstatus.md - - docs/sdk/models/shared/errorvalidation.md - - docs/sdk/models/shared/errorvalidationitem.md - - docs/sdk/models/shared/halref.md - - docs/sdk/models/shared/links.md - - docs/sdk/models/shared/pagination.md - - docs/sdk/models/shared/paymentmappingoptions.md - - docs/sdk/models/shared/security.md - - docs/sdk/models/shared/sourcetype.md - - docs/sdk/models/shared/supplier.md - - docs/sdk/models/shared/supplierprototype.md - - docs/sdk/models/shared/supplierref.md - - docs/sdk/models/shared/suppliers.md - - docs/sdk/models/shared/supplierstatus.md - - docs/sdk/models/shared/taxratemappingoption.md - - docs/sdk/models/shared/taxratestatus.md - - docs/sdk/models/shared/trackingref.md - - docs/sdks/bankaccounts/README.md - - docs/sdks/billpayments/README.md - - docs/sdks/bills/README.md - - docs/sdks/companies/README.md - - docs/sdks/companyinformation/README.md - - docs/sdks/connections/README.md - - docs/sdks/suppliers/README.md - - eslint.config.mjs - - examples/.env.template - - examples/README.md - - examples/companiesList.example.ts - - examples/package.json - - jsr.json - - package.json - - src/core.ts - - src/funcs/bankAccountsCreate.ts - - src/funcs/billPaymentsCreate.ts - - src/funcs/billPaymentsGetPaymentOptions.ts - - src/funcs/billsCreate.ts - - src/funcs/billsDownloadAttachment.ts - - src/funcs/billsGetBillOptions.ts - - src/funcs/billsList.ts - - src/funcs/billsListAttachments.ts - - src/funcs/billsUploadAttachment.ts - - src/funcs/companiesCreate.ts - - src/funcs/companiesDelete.ts - - src/funcs/companiesGet.ts - - src/funcs/companiesList.ts - - src/funcs/companiesReplace.ts - - src/funcs/companiesUpdate.ts - - src/funcs/companyInformationGet.ts - - src/funcs/connectionsCreate.ts - - src/funcs/connectionsDelete.ts - - src/funcs/connectionsGet.ts - - src/funcs/connectionsList.ts - - src/funcs/connectionsUnlink.ts - - src/funcs/suppliersCreate.ts - - src/funcs/suppliersList.ts - - src/funcs/validateWebhook.ts - - src/hooks/hooks.ts - - src/hooks/index.ts - - src/hooks/types.ts - - src/index.ts - - src/lib/base64.ts - - src/lib/config.ts - - src/lib/dlv.ts - - src/lib/encodings.ts - - src/lib/files.ts - - src/lib/http.ts - - src/lib/is-plain-object.ts - - src/lib/logger.ts - - src/lib/matchers.ts - - src/lib/primitives.ts - - src/lib/retries.ts - - src/lib/schemas.ts - - src/lib/sdks.ts - - src/lib/security.ts - - src/lib/url.ts - - src/sdk/bankaccounts.ts - - src/sdk/billpayments.ts - - src/sdk/bills.ts - - src/sdk/companies.ts - - src/sdk/companyinformation.ts - - src/sdk/connections.ts - - src/sdk/index.ts - - src/sdk/models/errors/codatsyncpayableserror.ts - - src/sdk/models/errors/errormessage.ts - - src/sdk/models/errors/httpclienterrors.ts - - src/sdk/models/errors/index.ts - - src/sdk/models/errors/responsevalidationerror.ts - - src/sdk/models/errors/sdkerror.ts - - src/sdk/models/errors/sdkvalidationerror.ts - - src/sdk/models/operations/createbankaccount.ts - - src/sdk/models/operations/createbill.ts - - src/sdk/models/operations/createbillpayment.ts - - src/sdk/models/operations/createconnection.ts - - src/sdk/models/operations/createsupplier.ts - - src/sdk/models/operations/deletecompany.ts - - src/sdk/models/operations/deleteconnection.ts - - src/sdk/models/operations/downloadbillattachment.ts - - src/sdk/models/operations/getcompany.ts - - src/sdk/models/operations/getcompanyinformation.ts - - src/sdk/models/operations/getconnection.ts - - src/sdk/models/operations/getmappingoptionsbills.ts - - src/sdk/models/operations/getmappingoptionspayments.ts - - src/sdk/models/operations/index.ts - - src/sdk/models/operations/listbillattachments.ts - - src/sdk/models/operations/listbills.ts - - src/sdk/models/operations/listcompanies.ts - - src/sdk/models/operations/listconnections.ts - - src/sdk/models/operations/listsuppliers.ts - - src/sdk/models/operations/replacecompany.ts - - src/sdk/models/operations/unlinkconnection.ts - - src/sdk/models/operations/updatecompany.ts - - src/sdk/models/operations/uploadbillattachment.ts - - src/sdk/models/shared/accountmappingoption.ts - - src/sdk/models/shared/accountstatus.ts - - src/sdk/models/shared/address.ts - - src/sdk/models/shared/addresstype.ts - - src/sdk/models/shared/attachment.ts - - src/sdk/models/shared/attachmentupload.ts - - src/sdk/models/shared/bankaccount.ts - - src/sdk/models/shared/bankaccountmappingoption.ts - - src/sdk/models/shared/bankaccountprototype.ts - - src/sdk/models/shared/bankaccountstatus.ts - - src/sdk/models/shared/bankaccounttype.ts - - src/sdk/models/shared/bill.ts - - src/sdk/models/shared/billaccountref.ts - - src/sdk/models/shared/billlineitem.ts - - src/sdk/models/shared/billmappingoptions.ts - - src/sdk/models/shared/billpayment.ts - - src/sdk/models/shared/billpaymentaccountref.ts - - src/sdk/models/shared/billpaymentprototype.ts - - src/sdk/models/shared/billprototype.ts - - src/sdk/models/shared/bills.ts - - src/sdk/models/shared/billstatus.ts - - src/sdk/models/shared/billtaxrateref.ts - - src/sdk/models/shared/clientratelimitwebhook.ts - - src/sdk/models/shared/clientratelimitwebhookpayload.ts - - src/sdk/models/shared/codatfile.ts - - src/sdk/models/shared/companies.ts - - src/sdk/models/shared/company.ts - - src/sdk/models/shared/companyinformation.ts - - src/sdk/models/shared/companyreference.ts - - src/sdk/models/shared/companyrequestbody.ts - - src/sdk/models/shared/companyupdaterequest.ts - - src/sdk/models/shared/connection.ts - - src/sdk/models/shared/connections.ts - - src/sdk/models/shared/dataconnectionerror.ts - - src/sdk/models/shared/dataconnectionstatus.ts - - src/sdk/models/shared/errorvalidation.ts - - src/sdk/models/shared/errorvalidationitem.ts - - src/sdk/models/shared/halref.ts - - src/sdk/models/shared/index.ts - - src/sdk/models/shared/links.ts - - src/sdk/models/shared/pagination.ts - - src/sdk/models/shared/paymentmappingoptions.ts - - src/sdk/models/shared/security.ts - - src/sdk/models/shared/supplier.ts - - src/sdk/models/shared/supplierprototype.ts - - src/sdk/models/shared/supplierref.ts - - src/sdk/models/shared/suppliers.ts - - src/sdk/models/shared/supplierstatus.ts - - src/sdk/models/shared/taxratemappingoption.ts - - src/sdk/models/shared/trackingref.ts - - src/sdk/sdk.ts - - src/sdk/suppliers.ts - - src/sdk/types/async.ts - - src/sdk/types/blobs.ts - - src/sdk/types/constdatetime.ts - - src/sdk/types/decimal.ts - - src/sdk/types/enums.ts - - src/sdk/types/fp.ts - - src/sdk/types/index.ts - - src/sdk/types/operations.ts - - src/sdk/types/rfcdate.ts - - src/sdk/types/streams.ts - - src/sdk/types/unrecognized.ts - - src/sdk/types/webhooks.ts - - tsconfig.json diff --git a/sync-for-payables/.speakeasy/gen.yaml b/sync-for-payables/.speakeasy/gen.yaml deleted file mode 100644 index 1c2ce8765..000000000 --- a/sync-for-payables/.speakeasy/gen.yaml +++ /dev/null @@ -1,91 +0,0 @@ -configVersion: 2.0.0 -generation: - sdkClassName: CodatSyncPayables - maintainOpenAPIOrder: true - usageSnippets: - optionalPropertyRendering: withExample - sdkInitStyle: constructor - useClassNamesForArrayFields: true - fixes: - nameResolutionDec2023: true - nameResolutionFeb2025: false - parameterOrderingFeb2024: true - requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false - sharedNestedComponentsJan2026: false - nameOverrideFeb2026: false - auth: - oAuth2ClientCredentialsEnabled: false - oAuth2PasswordEnabled: false - hoistGlobalSecurity: true - schemas: - allOfMergeStrategy: shallowMerge - requestBodyFieldName: "" - versioningStrategy: automatic - persistentEdits: {} - tests: - generateTests: true - generateNewTests: false - skipResponseBodyAssertions: false - telemetryEnabled: true -typescript: - version: 9.3.2 - acceptHeaderEnum: true - additionalDependencies: - dependencies: {} - devDependencies: {} - peerDependencies: {} - additionalPackageJSON: {} - additionalScripts: {} - alwaysIncludeInboundAndOutbound: false - author: Codat - baseErrorName: CodatSyncPayablesError - clientServerStatusCodesAsErrors: true - constFieldsAlwaysOptional: false - defaultErrorName: SDKError - description: Streamline your customers' accounts payable workflow. - enableCustomCodeRegions: false - enableMCPServer: false - enableReactQuery: false - enumFormat: union - exportZodModelNamespace: false - fixEnumNameSanitization: false - flatAdditionalProperties: false - flattenGlobalSecurity: true - flatteningOrder: body-first - formStringArrayEncodeMode: encoded-string - forwardCompatibleEnumsByDefault: false - forwardCompatibleUnionsByDefault: "false" - generateExamples: true - imports: - option: openapi - paths: - callbacks: sdk/models/callbacks - errors: sdk/models/errors - operations: sdk/models/operations - shared: sdk/models/shared - webhooks: sdk/models/webhooks - inferUnionDiscriminators: true - inputModelSuffix: input - jsonpath: legacy - laxMode: strict - legacyFileNaming: true - maxMethodParams: 0 - methodArguments: infer-optional-args - modelPropertyCasing: camel - moduleFormat: commonjs - multipartArrayFormat: legacy - outputModelSuffix: output - packageName: '@codat/sync-for-payables' - preApplyUnionDiscriminators: true - preserveModelFieldNames: false - responseFormat: flat - sseFlatResponse: false - templateVersion: v2 - unionStrategy: left-to-right - usageSDKInitImports: [] - useIndexModules: true - useOxlint: false - useTsgo: false - zodVersion: v3 diff --git a/sync-for-payables/RELEASES.md b/sync-for-payables/RELEASES.md index aedf3ee15..1806dc99e 100644 --- a/sync-for-payables/RELEASES.md +++ b/sync-for-payables/RELEASES.md @@ -118,4 +118,14 @@ Based on: ### Generated - [typescript v9.3.2] sync-for-payables ### Releases -- [NPM v9.3.2] https://www.npmjs.com/package/@codat/sync-for-payables/v/9.3.2 - sync-for-payables \ No newline at end of file +- [NPM v9.3.2] https://www.npmjs.com/package/@codat/sync-for-payables/v/9.3.2 - sync-for-payables + +## 2026-08-05 19:29:39 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables.yaml +- codat sdk-codegen 1b5626f25df09d713121c5e8a048d9b44b3b7178 https://github.com/codat-spikes/sdk-codegen +### Generated +- [typescript v9.3.3] sync-for-payables +### Releases +- [NPM v9.3.3] https://www.npmjs.com/package/@codat/sync-for-payables/v/9.3.3 - sync-for-payables diff --git a/sync-for-payables/USAGE.md b/sync-for-payables/USAGE.md index 63e81dc1b..4ae2d1271 100644 --- a/sync-for-payables/USAGE.md +++ b/sync-for-payables/USAGE.md @@ -1,22 +1,28 @@ - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); - -``` + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + nominalCode: "22", + name: "Plutus - Payables - Bank Account 12", + accountType: "Debit", + accountNumber: "0120 0440", + sortCode: "50-50-50", + currency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` \ No newline at end of file diff --git a/sync-for-payables/docs/lib/utils/retryconfig.md b/sync-for-payables/docs/lib/utils/retryconfig.md index 08f95f455..69da01b9f 100644 --- a/sync-for-payables/docs/lib/utils/retryconfig.md +++ b/sync-for-payables/docs/lib/utils/retryconfig.md @@ -1,24 +1,24 @@ -# RetryConfig - -Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. - -## Fields - -| Name | Type | Description | Example | -| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | -| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | -| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | -| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | - -## BackoffStrategy - -The backoff strategy allows retrying a request with an exponential backoff between each retry. - -### Fields - -| Name | Type | Description | Example | -| ------------------ | ------------ | ----------------------------------------- | -------- | -| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | -| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | -| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | | `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/errors/errormessage.md b/sync-for-payables/docs/sdk/models/errors/errormessage.md index 3b0d871c2..bcb72caaa 100644 --- a/sync-for-payables/docs/sdk/models/errors/errormessage.md +++ b/sync-for-payables/docs/sdk/models/errors/errormessage.md @@ -1,23 +1,21 @@ -# ErrorMessage - -Your `query` parameter was not correctly formed - -## Example Usage - -```typescript -import { ErrorMessage } from "@codat/sync-for-payables/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | -| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | -| `validation` | [shared.ErrorValidation](../../../sdk/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. | -| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +# ErrorMessage + +## Example Usage + +```typescript +import { ErrorMessage } from "@codat/sync-for-payables/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | +| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | +| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `validation` | [shared.ErrorValidation](../../../sdk/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. | +| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | | `detailedErrorCode` | *number* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createbankaccountrequest.md b/sync-for-payables/docs/sdk/models/operations/createbankaccountrequest.md index 69ced2b35..ecd1d6523 100644 --- a/sync-for-payables/docs/sdk/models/operations/createbankaccountrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/createbankaccountrequest.md @@ -1,21 +1,21 @@ -# CreateBankAccountRequest - -## Example Usage - -```typescript -import { CreateBankAccountRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: CreateBankAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +# CreateBankAccountRequest + +## Example Usage + +```typescript +import { CreateBankAccountRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: CreateBankAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `idempotencyKey` | *string* | :heavy_minus_sign: | N/A | | | `bankAccountPrototype` | [shared.BankAccountPrototype](../../../sdk/models/shared/bankaccountprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md b/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md index d6a553341..46ab49f90 100644 --- a/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md @@ -1,23 +1,23 @@ -# CreateBillPaymentRequest - -## Example Usage - -```typescript -import { CreateBillPaymentRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: CreateBillPaymentRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | -| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +# CreateBillPaymentRequest + +## Example Usage + +```typescript +import { CreateBillPaymentRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: CreateBillPaymentRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `idempotencyKey` | *string* | :heavy_minus_sign: | N/A | | | `billPaymentPrototype` | [shared.BillPaymentPrototype](../../../sdk/models/shared/billpaymentprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createbillrequest.md b/sync-for-payables/docs/sdk/models/operations/createbillrequest.md index cf72c5eba..6b6626cc7 100644 --- a/sync-for-payables/docs/sdk/models/operations/createbillrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/createbillrequest.md @@ -1,21 +1,21 @@ -# CreateBillRequest - -## Example Usage - -```typescript -import { CreateBillRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: CreateBillRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | -| `billPrototype` | [shared.BillPrototype](../../../sdk/models/shared/billprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# CreateBillRequest + +## Example Usage + +```typescript +import { CreateBillRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: CreateBillRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `idempotencyKey` | *string* | :heavy_minus_sign: | N/A | | +| `billPrototype` | [shared.BillPrototype](../../../sdk/models/shared/billprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createconnectionrequest.md b/sync-for-payables/docs/sdk/models/operations/createconnectionrequest.md index fde0ad5ae..b13896cec 100644 --- a/sync-for-payables/docs/sdk/models/operations/createconnectionrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/createconnectionrequest.md @@ -1,18 +1,18 @@ -# CreateConnectionRequest - -## Example Usage - -```typescript -import { CreateConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: CreateConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateConnectionRequest + +## Example Usage + +```typescript +import { CreateConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: CreateConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [operations.CreateConnectionRequestBody](../../../sdk/models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createconnectionrequestbody.md b/sync-for-payables/docs/sdk/models/operations/createconnectionrequestbody.md index 1e30f32b7..e8ba5236c 100644 --- a/sync-for-payables/docs/sdk/models/operations/createconnectionrequestbody.md +++ b/sync-for-payables/docs/sdk/models/operations/createconnectionrequestbody.md @@ -1,17 +1,17 @@ -# CreateConnectionRequestBody - -## Example Usage - -```typescript -import { CreateConnectionRequestBody } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: CreateConnectionRequestBody = { - platformKey: "gbol", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# CreateConnectionRequestBody + +## Example Usage + +```typescript +import { CreateConnectionRequestBody } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: CreateConnectionRequestBody = { + platformKey: "gbol", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `platformKey` | *string* | :heavy_minus_sign: | 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. | gbol | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createsupplierrequest.md b/sync-for-payables/docs/sdk/models/operations/createsupplierrequest.md index 7bca76b8c..04de4f3ac 100644 --- a/sync-for-payables/docs/sdk/models/operations/createsupplierrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/createsupplierrequest.md @@ -1,21 +1,21 @@ -# CreateSupplierRequest - -## Example Usage - -```typescript -import { CreateSupplierRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: CreateSupplierRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +# CreateSupplierRequest + +## Example Usage + +```typescript +import { CreateSupplierRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: CreateSupplierRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `idempotencyKey` | *string* | :heavy_minus_sign: | N/A | | | `supplierPrototype` | [shared.SupplierPrototype](../../../sdk/models/shared/supplierprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/deletecompanyrequest.md b/sync-for-payables/docs/sdk/models/operations/deletecompanyrequest.md index 119f62cbe..22583937d 100644 --- a/sync-for-payables/docs/sdk/models/operations/deletecompanyrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/deletecompanyrequest.md @@ -1,17 +1,17 @@ -# DeleteCompanyRequest - -## Example Usage - -```typescript -import { DeleteCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: DeleteCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# DeleteCompanyRequest + +## Example Usage + +```typescript +import { DeleteCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: DeleteCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/deleteconnectionrequest.md b/sync-for-payables/docs/sdk/models/operations/deleteconnectionrequest.md index 9d33a8e82..03c5b1211 100644 --- a/sync-for-payables/docs/sdk/models/operations/deleteconnectionrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/deleteconnectionrequest.md @@ -1,19 +1,19 @@ -# DeleteConnectionRequest - -## Example Usage - -```typescript -import { DeleteConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: DeleteConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# DeleteConnectionRequest + +## Example Usage + +```typescript +import { DeleteConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: DeleteConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md b/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md index e770d3238..335f930de 100644 --- a/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md @@ -1,23 +1,23 @@ -# DownloadBillAttachmentRequest - -## Example Usage - -```typescript -import { DownloadBillAttachmentRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: DownloadBillAttachmentRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +# DownloadBillAttachmentRequest + +## Example Usage + +```typescript +import { DownloadBillAttachmentRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: DownloadBillAttachmentRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | | `attachmentId` | *string* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/getcompanyinformationrequest.md b/sync-for-payables/docs/sdk/models/operations/getcompanyinformationrequest.md index 63c2c7a9f..1352b094b 100644 --- a/sync-for-payables/docs/sdk/models/operations/getcompanyinformationrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/getcompanyinformationrequest.md @@ -1,19 +1,19 @@ -# GetCompanyInformationRequest - -## Example Usage - -```typescript -import { GetCompanyInformationRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: GetCompanyInformationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCompanyInformationRequest + +## Example Usage + +```typescript +import { GetCompanyInformationRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: GetCompanyInformationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/getcompanyrequest.md b/sync-for-payables/docs/sdk/models/operations/getcompanyrequest.md index 95935d443..144018cba 100644 --- a/sync-for-payables/docs/sdk/models/operations/getcompanyrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/getcompanyrequest.md @@ -1,17 +1,17 @@ -# GetCompanyRequest - -## Example Usage - -```typescript -import { GetCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: GetCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyRequest + +## Example Usage + +```typescript +import { GetCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: GetCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/getconnectionrequest.md b/sync-for-payables/docs/sdk/models/operations/getconnectionrequest.md index db3c292f6..db2b8f0fb 100644 --- a/sync-for-payables/docs/sdk/models/operations/getconnectionrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/getconnectionrequest.md @@ -1,19 +1,19 @@ -# GetConnectionRequest - -## Example Usage - -```typescript -import { GetConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: GetConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetConnectionRequest + +## Example Usage + +```typescript +import { GetConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: GetConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/getmappingoptionsbillsrequest.md b/sync-for-payables/docs/sdk/models/operations/getmappingoptionsbillsrequest.md index 5ad854a14..2406be15d 100644 --- a/sync-for-payables/docs/sdk/models/operations/getmappingoptionsbillsrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/getmappingoptionsbillsrequest.md @@ -1,24 +1,23 @@ -# GetMappingOptionsBillsRequest - -## Example Usage - -```typescript -import { GetMappingOptionsBillsRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: GetMappingOptionsBillsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: - "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - statusQuery: "status=Archived", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | +# GetMappingOptionsBillsRequest + +## Example Usage + +```typescript +import { GetMappingOptionsBillsRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: GetMappingOptionsBillsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + statusQuery: "status=Archived", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | | `statusQuery` | *string* | :heavy_minus_sign: | Codat query string allows you to filter by `status` (`status=Active\|\|status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat's query string. | status=Archived | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/getmappingoptionspaymentsrequest.md b/sync-for-payables/docs/sdk/models/operations/getmappingoptionspaymentsrequest.md index de36ca789..6abe4ed6a 100644 --- a/sync-for-payables/docs/sdk/models/operations/getmappingoptionspaymentsrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/getmappingoptionspaymentsrequest.md @@ -1,24 +1,23 @@ -# GetMappingOptionsPaymentsRequest - -## Example Usage - -```typescript -import { GetMappingOptionsPaymentsRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: GetMappingOptionsPaymentsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: - "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - statusQuery: "status=Archived", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | +# GetMappingOptionsPaymentsRequest + +## Example Usage + +```typescript +import { GetMappingOptionsPaymentsRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: GetMappingOptionsPaymentsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + statusQuery: "status=Archived", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | | `statusQuery` | *string* | :heavy_minus_sign: | Codat query string allows you to filter by `status` (`status=Active\|\|status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat's query string. | status=Archived | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md b/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md index 603c66a5b..a921e768d 100644 --- a/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md @@ -1,21 +1,21 @@ -# ListBillAttachmentsRequest - -## Example Usage - -```typescript -import { ListBillAttachmentsRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: ListBillAttachmentsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# ListBillAttachmentsRequest + +## Example Usage + +```typescript +import { ListBillAttachmentsRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: ListBillAttachmentsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/listbillsrequest.md b/sync-for-payables/docs/sdk/models/operations/listbillsrequest.md index dcb8ccac2..62a9ba220 100644 --- a/sync-for-payables/docs/sdk/models/operations/listbillsrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/listbillsrequest.md @@ -1,23 +1,22 @@ -# ListBillsRequest - -## Example Usage - -```typescript -import { ListBillsRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: ListBillsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: - "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | +# ListBillsRequest + +## Example Usage + +```typescript +import { ListBillsRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: ListBillsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | | `query` | *string* | :heavy_minus_sign: | Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat's query string [here](https://docs.codat.io/using-the-api/querying). Platfrom specfic statuses: Xero supports Open \| PartiallyPaid \| Paid \| Void \| Draft. Qbo supports Open \| PartiallyPaid \| Paid. FreeAgent supports Open \| PartiallyPaid \| Paid. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/listcompaniesrequest.md b/sync-for-payables/docs/sdk/models/operations/listcompaniesrequest.md index 892f70b57..2f738e1d2 100644 --- a/sync-for-payables/docs/sdk/models/operations/listcompaniesrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/listcompaniesrequest.md @@ -1,23 +1,23 @@ -# ListCompaniesRequest - -## Example Usage - -```typescript -import { ListCompaniesRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: ListCompaniesRequest = { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | -| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +# ListCompaniesRequest + +## Example Usage + +```typescript +import { ListCompaniesRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: ListCompaniesRequest = { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `tags` | *string* | :heavy_minus_sign: | Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). | region=uk && team=invoice-finance | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/listconnectionsrequest.md b/sync-for-payables/docs/sdk/models/operations/listconnectionsrequest.md index b66c01daa..0eac93468 100644 --- a/sync-for-payables/docs/sdk/models/operations/listconnectionsrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/listconnectionsrequest.md @@ -1,23 +1,23 @@ -# ListConnectionsRequest - -## Example Usage - -```typescript -import { ListConnectionsRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: ListConnectionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListConnectionsRequest + +## Example Usage + +```typescript +import { ListConnectionsRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: ListConnectionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/listsuppliersrequest.md b/sync-for-payables/docs/sdk/models/operations/listsuppliersrequest.md index c77c6c8a7..be76d8678 100644 --- a/sync-for-payables/docs/sdk/models/operations/listsuppliersrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/listsuppliersrequest.md @@ -1,23 +1,22 @@ -# ListSuppliersRequest - -## Example Usage - -```typescript -import { ListSuppliersRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: ListSuppliersRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: - "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | +# ListSuppliersRequest + +## Example Usage + +```typescript +import { ListSuppliersRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: ListSuppliersRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `continuationToken` | *string* | :heavy_minus_sign: | Retrieve the next page of results using the continuation token from the previous response. | continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== | | `query` | *string* | :heavy_minus_sign: | Codat query string allows you to filter by `sourceModifiedDate` or if a supplier is `Active` or `Archived` in the accounting software. Learn more about Codat's query string [here](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/replacecompanyrequest.md b/sync-for-payables/docs/sdk/models/operations/replacecompanyrequest.md index 9b4ba9a91..206dd0cba 100644 --- a/sync-for-payables/docs/sdk/models/operations/replacecompanyrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/replacecompanyrequest.md @@ -1,18 +1,18 @@ -# ReplaceCompanyRequest - -## Example Usage - -```typescript -import { ReplaceCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: ReplaceCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# ReplaceCompanyRequest + +## Example Usage + +```typescript +import { ReplaceCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: ReplaceCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyRequestBody` | [shared.CompanyRequestBody](../../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/unlinkconnectionrequest.md b/sync-for-payables/docs/sdk/models/operations/unlinkconnectionrequest.md index a4d0c3f0f..1bf269609 100644 --- a/sync-for-payables/docs/sdk/models/operations/unlinkconnectionrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/unlinkconnectionrequest.md @@ -1,20 +1,20 @@ -# UnlinkConnectionRequest - -## Example Usage - -```typescript -import { UnlinkConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: UnlinkConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# UnlinkConnectionRequest + +## Example Usage + +```typescript +import { UnlinkConnectionRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UnlinkConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `requestBody` | [operations.UnlinkConnectionUpdateConnection](../../../sdk/models/operations/unlinkconnectionupdateconnection.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/unlinkconnectionupdateconnection.md b/sync-for-payables/docs/sdk/models/operations/unlinkconnectionupdateconnection.md index 8e09632f0..22889253e 100644 --- a/sync-for-payables/docs/sdk/models/operations/unlinkconnectionupdateconnection.md +++ b/sync-for-payables/docs/sdk/models/operations/unlinkconnectionupdateconnection.md @@ -1,15 +1,15 @@ -# UnlinkConnectionUpdateConnection - -## Example Usage - -```typescript -import { UnlinkConnectionUpdateConnection } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: UnlinkConnectionUpdateConnection = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | \ No newline at end of file +# UnlinkConnectionUpdateConnection + +## Example Usage + +```typescript +import { UnlinkConnectionUpdateConnection } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UnlinkConnectionUpdateConnection = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md b/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md index f00dbf031..9b9c752c1 100644 --- a/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md @@ -1,23 +1,23 @@ -# UpdateBillRequest - -## Example Usage - -```typescript -import { UpdateBillRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: UpdateBillRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | -| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +# UpdateBillRequest + +## Example Usage + +```typescript +import { UpdateBillRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UpdateBillRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `idempotencyKey` | *string* | :heavy_minus_sign: | N/A | | | `billPrototype` | [shared.BillPrototype](../../../sdk/models/shared/billprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/updatecompanyrequest.md b/sync-for-payables/docs/sdk/models/operations/updatecompanyrequest.md index 144ed6cd0..4967f1e5a 100644 --- a/sync-for-payables/docs/sdk/models/operations/updatecompanyrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/updatecompanyrequest.md @@ -1,18 +1,18 @@ -# UpdateCompanyRequest - -## Example Usage - -```typescript -import { UpdateCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: UpdateCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# UpdateCompanyRequest + +## Example Usage + +```typescript +import { UpdateCompanyRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UpdateCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyUpdateRequest` | [shared.CompanyUpdateRequest](../../../sdk/models/shared/companyupdaterequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/updatesupplierrequest.md b/sync-for-payables/docs/sdk/models/operations/updatesupplierrequest.md index ae033594d..3602215ad 100644 --- a/sync-for-payables/docs/sdk/models/operations/updatesupplierrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/updatesupplierrequest.md @@ -1,22 +1,22 @@ -# UpdateSupplierRequest - -## Example Usage - -```typescript -import { UpdateSupplierRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -let value: UpdateSupplierRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `supplierId` | *string* | :heavy_check_mark: | Unique identifier for a supplier. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +# UpdateSupplierRequest + +## Example Usage + +```typescript +import { UpdateSupplierRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UpdateSupplierRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `supplierId` | *string* | :heavy_check_mark: | Unique identifier for a supplier. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | | `supplierPrototype` | [shared.SupplierPrototype](../../../sdk/models/shared/supplierprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md b/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md index eeccc2601..9913016d1 100644 --- a/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md @@ -1,18 +1,22 @@ -# UploadBillAttachmentRequest - -## Example Usage - -```typescript -import { UploadBillAttachmentRequest } from "@codat/sync-for-payables/sdk/models/operations"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +# UploadBillAttachmentRequest + +## Example Usage + +```typescript +import { UploadBillAttachmentRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UploadBillAttachmentRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | | `attachmentUpload` | [shared.AttachmentUpload](../../../sdk/models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md b/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md index 012cbca5f..74d54c083 100644 --- a/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md +++ b/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md @@ -1,29 +1,21 @@ -# AccountMappingOption - -## Example Usage - -```typescript -import { AccountMappingOption } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: AccountMappingOption = { - id: "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", - nominalCode: "610", - name: "Accounts Payable", - type: "Liability", - currency: "GBP", - status: "Active", - sourceModifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | -| `nominalCode` | *string* | :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` | *string* | :heavy_minus_sign: | Name of the account. | Accounts Payable | -| `type` | *string* | :heavy_minus_sign: | Type of account. | Liability | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | The current status of the account. | Active | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# AccountMappingOption + +## Example Usage + +```typescript +import { AccountMappingOption } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: AccountMappingOption = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company. | +| `nominalCode` | *string* | :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. | +| `name` | *string* | :heavy_minus_sign: | Name of the account. | +| `type` | *string* | :heavy_minus_sign: | Type of account. | +| `currency` | *string* | :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. | +| `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/accountstatus.md b/sync-for-payables/docs/sdk/models/shared/accountstatus.md index 9d08accad..b96cebdf9 100644 --- a/sync-for-payables/docs/sdk/models/shared/accountstatus.md +++ b/sync-for-payables/docs/sdk/models/shared/accountstatus.md @@ -1,17 +1,17 @@ -# AccountStatus - -The current status of the account. - -## Example Usage - -```typescript -import { AccountStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: AccountStatus = "Active"; -``` - -## Values - -```typescript -"Active" | "Archived" +# AccountStatus + +The current status of the account. + +## Example Usage + +```typescript +import { AccountStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: AccountStatus = "Active"; +``` + +## Values + +```typescript +"Active" | "Archived" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/address.md b/sync-for-payables/docs/sdk/models/shared/address.md index 0484dced3..90593b6a1 100644 --- a/sync-for-payables/docs/sdk/models/shared/address.md +++ b/sync-for-payables/docs/sdk/models/shared/address.md @@ -1,21 +1,21 @@ -# Address - -## Example Usage - -```typescript -import { Address } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Address = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [shared.AddressType](../../../sdk/models/shared/addresstype.md) | :heavy_minus_sign: | The type of the address | -| `line1` | *string* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *string* | :heavy_minus_sign: | Line 2 of the customer address. | -| `city` | *string* | :heavy_minus_sign: | City of the customer address. | -| `region` | *string* | :heavy_minus_sign: | Region of the customer address. | -| `country` | *string* | :heavy_minus_sign: | Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. | +# Address + +## Example Usage + +```typescript +import { Address } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Address = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [shared.AddressType](../../../sdk/models/shared/addresstype.md) | :heavy_minus_sign: | The type of the address | +| `line1` | *string* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *string* | :heavy_minus_sign: | Line 2 of the customer address. | +| `city` | *string* | :heavy_minus_sign: | City of the customer address. | +| `region` | *string* | :heavy_minus_sign: | Region of the customer address. | +| `country` | *string* | :heavy_minus_sign: | Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. | | `postalCode` | *string* | :heavy_minus_sign: | Postal code or zip code. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/addresstype.md b/sync-for-payables/docs/sdk/models/shared/addresstype.md index 4dad9f2df..b0ad2f5e8 100644 --- a/sync-for-payables/docs/sdk/models/shared/addresstype.md +++ b/sync-for-payables/docs/sdk/models/shared/addresstype.md @@ -1,17 +1,17 @@ -# AddressType - -The type of the address - -## Example Usage - -```typescript -import { AddressType } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: AddressType = "Billing"; -``` - -## Values - -```typescript -"Unknown" | "Billing" | "Delivery" +# AddressType + +The type of the address + +## Example Usage + +```typescript +import { AddressType } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: AddressType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Billing" | "Delivery" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/attachment.md b/sync-for-payables/docs/sdk/models/shared/attachment.md index 83e98b96e..b635970df 100644 --- a/sync-for-payables/docs/sdk/models/shared/attachment.md +++ b/sync-for-payables/docs/sdk/models/shared/attachment.md @@ -1,41 +1,41 @@ -# Attachment - - The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. - - > **Retrieving attachments** - > - > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. - - Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. - - Note that different integrations have different requirements for file size and extension of attachments. - - | Integration | File size | File extension | - |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| - | Xero | 4 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 | - | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | - | NetSuite | 100 MB | 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". | - -## Example Usage - -```typescript -import { Attachment } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Attachment = { - dateCreated: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting software. | | -| `name` | *string* | :heavy_minus_sign: | Name of the attachment file. | | -| `contentType` | *string* | :heavy_minus_sign: | File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.

Supported file types vary per platform. | | -| `dateCreated` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `fileSize` | *number* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | -| `includeWhenSent` | *boolean* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | +# Attachment + + The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + + > **Retrieving attachments** + > + > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + + Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + + Note that different integrations have different requirements for file size and extension of attachments. + + | Integration | File size | File extension | + |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Xero | 4 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 | + | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | + | NetSuite | 100 MB | 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". | + +## Example Usage + +```typescript +import { Attachment } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Attachment = { + dateCreated: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting software. | | +| `name` | *string* | :heavy_minus_sign: | Name of the attachment file. | | +| `contentType` | *string* | :heavy_minus_sign: | File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.

Supported file types vary per platform. | | +| `dateCreated` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `fileSize` | *number* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | +| `includeWhenSent` | *boolean* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | | `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/attachmentupload.md b/sync-for-payables/docs/sdk/models/shared/attachmentupload.md index f574e91ee..c8c41335d 100644 --- a/sync-for-payables/docs/sdk/models/shared/attachmentupload.md +++ b/sync-for-payables/docs/sdk/models/shared/attachmentupload.md @@ -1,15 +1,17 @@ -# AttachmentUpload - -## Example Usage - -```typescript -import { AttachmentUpload } from "@codat/sync-for-payables/sdk/models/shared"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [shared.CodatFile](../../../sdk/models/shared/codatfile.md) | :heavy_check_mark: | The file to be uploaded as an attachment. | \ No newline at end of file +# AttachmentUpload + +## Example Usage + +```typescript +import { AttachmentUpload } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: AttachmentUpload = { + file: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `file` | *CodatFile | Blob* | :heavy_check_mark: | The file to be uploaded as an attachment. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccount.md b/sync-for-payables/docs/sdk/models/shared/bankaccount.md index 75197d533..1b6c5bf73 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccount.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccount.md @@ -1,27 +1,26 @@ -# BankAccount - -## Example Usage - -```typescript -import { BankAccount } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BankAccount = { - currency: "GBP", - status: "Active", - sourceModifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the bank account, unique for the company in the accounting software. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `name` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.BankAccountType](../../../sdk/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. | | -| `accountNumber` | *string* | :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. | | -| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# BankAccount + +## Example Usage + +```typescript +import { BankAccount } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BankAccount = { + sourceModifiedDate: "2022-10-23T00:00:00Z", + currency: "GBP", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `id` | *string* | :heavy_minus_sign: | Identifier for the bank account, unique for the company in the accounting software. | | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `name` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `accountType` | [shared.BankAccountType](../../../sdk/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. | | +| `accountNumber` | *string* | :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. | | +| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md b/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md index af7f469d5..132420ce4 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md @@ -1,28 +1,23 @@ -# BankAccountMappingOption - -## Example Usage - -```typescript -import { BankAccountMappingOption } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BankAccountMappingOption = { - id: "3d5a8e00-d108-4045-8823-7f342676cffa", - name: "Bank of Dave current account", - status: "Active", - sourceModifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | 3d5a8e00-d108-4045-8823-7f342676cffa | -| `name` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | Bank of Dave current account | -| `accountNumber` | *string* | :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. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `sortCode` | *string* | :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. | | -| `currency` | *string* | :heavy_minus_sign: | The bank account's base currency. | | -| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | -| `accountType` | [shared.BankAccountType](../../../sdk/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. | | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# BankAccountMappingOption + +## Example Usage + +```typescript +import { BankAccountMappingOption } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BankAccountMappingOption = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | +| `name` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | +| `accountNumber` | *string* | :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. | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | +| `sortCode` | *string* | :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. | +| `currency` | *string* | :heavy_minus_sign: | The bank account's base currency. | +| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | N/A | +| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md b/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md index 16cff76dc..847dd00ce 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md @@ -1,25 +1,25 @@ -# BankAccountPrototype - -## Example Usage - -```typescript -import { BankAccountPrototype } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BankAccountPrototype = { - name: null, - accountType: "Debit", - accountNumber: "", - currency: "GBP", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `name` | *string* | :heavy_check_mark: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_check_mark: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `accountNumber` | *string* | :heavy_check_mark: | Account number for the bank account.

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

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +# BankAccountPrototype + +## Example Usage + +```typescript +import { BankAccountPrototype } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BankAccountPrototype = { + name: "string", + accountType: "string", + accountNumber: "string", + currency: "GBP", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `name` | *string* | :heavy_check_mark: | Name of the bank account in the accounting software. | | +| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_check_mark: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `accountNumber` | *string* | :heavy_check_mark: | Account number for the bank account.

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

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | | `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccountstatus.md b/sync-for-payables/docs/sdk/models/shared/bankaccountstatus.md index c318b5897..80b904274 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccountstatus.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccountstatus.md @@ -1,17 +1,17 @@ -# BankAccountStatus - -The current status of the bank account. - -## Example Usage - -```typescript -import { BankAccountStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BankAccountStatus = "Active"; -``` - -## Values - -```typescript -"Active" | "Archived" +# BankAccountStatus + +The current status of the bank account. + +## Example Usage + +```typescript +import { BankAccountStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BankAccountStatus = "Active"; +``` + +## Values + +```typescript +"Active" | "Archived" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccounttype.md b/sync-for-payables/docs/sdk/models/shared/bankaccounttype.md index 4fac2543a..6a3574c4d 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccounttype.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccounttype.md @@ -1,19 +1,19 @@ -# 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. - -## Example Usage - -```typescript -import { BankAccountType } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BankAccountType = "Unknown"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" +# 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. + +## Example Usage + +```typescript +import { BankAccountType } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BankAccountType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Credit" | "Debit" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bill.md b/sync-for-payables/docs/sdk/models/shared/bill.md index 7f71a4294..e5e0f19c8 100644 --- a/sync-for-payables/docs/sdk/models/shared/bill.md +++ b/sync-for-payables/docs/sdk/models/shared/bill.md @@ -1,38 +1,38 @@ -# Bill - -Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -## Example Usage - -```typescript -import { Bill } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Bill = { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: null, - status: "Open", - sourceModifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | -| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | -| `supplierRef` | [shared.SupplierRef](../../../sdk/models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `issueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `currencyRate` | *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. \| | | -| `lineItems` | [shared.BillLineItem](../../../sdk/models/shared/billlineitem.md)[] | :heavy_minus_sign: | Array of Bill line items. | | -| `status` | [shared.BillStatus](../../../sdk/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | -| `totalAmount` | *Decimal* | :heavy_minus_sign: | Amount of the bill, including tax. | | -| `amountDue` | *Decimal* | :heavy_minus_sign: | Amount outstanding on the bill. | | +# Bill + +Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +## Example Usage + +```typescript +import { Bill } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Bill = { + supplierRef: { + id: "string", + supplierName: "string", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + sourceModifiedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | +| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `supplierRef` | [shared.SupplierRef](../../../sdk/models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | +| `issueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `dueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `currencyRate` | *Decimal | number* | :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. \| | | +| `lineItems` | [shared.BillLineItem](../../../sdk/models/shared/billlineitem.md)[] | :heavy_minus_sign: | Array of Bill line items. | | +| `status` | [shared.BillStatus](../../../sdk/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | +| `totalAmount` | *Decimal | number* | :heavy_minus_sign: | Amount of the bill, including tax. | | +| `amountDue` | *Decimal | number* | :heavy_minus_sign: | Amount outstanding on the bill. | | | `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billaccountref.md b/sync-for-payables/docs/sdk/models/shared/billaccountref.md index 70e405007..288f831c3 100644 --- a/sync-for-payables/docs/sdk/models/shared/billaccountref.md +++ b/sync-for-payables/docs/sdk/models/shared/billaccountref.md @@ -1,17 +1,17 @@ -# BillAccountRef - -Reference to the account to which the line item is linked. - -## Example Usage - -```typescript -import { BillAccountRef } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillAccountRef = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +# BillAccountRef + +Reference to the account to which the line item is linked. + +## Example Usage + +```typescript +import { BillAccountRef } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillAccountRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | | `id` | *string* | :heavy_minus_sign: | 'id' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billlineitem.md b/sync-for-payables/docs/sdk/models/shared/billlineitem.md index 8d828a732..0160cedcd 100644 --- a/sync-for-payables/docs/sdk/models/shared/billlineitem.md +++ b/sync-for-payables/docs/sdk/models/shared/billlineitem.md @@ -1,29 +1,22 @@ -# BillLineItem - -## Example Usage - -```typescript -import { BillLineItem } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillLineItem = { - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `description` | *string* | :heavy_minus_sign: | Friendly name of the goods or services received. | -| `unitAmount` | *Decimal* | :heavy_minus_sign: | Unit price of the goods or service. | -| `quantity` | *Decimal* | :heavy_minus_sign: | Number of units of goods or services received. | -| `taxAmount` | *Decimal* | :heavy_minus_sign: | Amount of tax applied to the line item. | -| `accountRef` | [shared.BillAccountRef](../../../sdk/models/shared/billaccountref.md) | :heavy_minus_sign: | Reference to the account to which the line item is linked. | -| `totalAmount` | *Decimal* | :heavy_minus_sign: | Total amount of the line, including tax. | -| `taxRateRef` | [shared.BillTaxRateRef](../../../sdk/models/shared/billtaxrateref.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | +# BillLineItem + +## Example Usage + +```typescript +import { BillLineItem } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillLineItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `description` | *string* | :heavy_minus_sign: | Friendly name of the goods or services received. | +| `unitAmount` | *Decimal | number* | :heavy_minus_sign: | Unit price of the goods or service. | +| `quantity` | *Decimal | number* | :heavy_minus_sign: | Number of units of goods or services received. | +| `taxAmount` | *Decimal | number* | :heavy_minus_sign: | Amount of tax applied to the line item. | +| `accountRef` | [shared.BillAccountRef](../../../sdk/models/shared/billaccountref.md) | :heavy_minus_sign: | Reference to the account to which the line item is linked. | +| `totalAmount` | *Decimal | number* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `taxRateRef` | [shared.BillTaxRateRef](../../../sdk/models/shared/billtaxrateref.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | | `trackingRefs` | [shared.TrackingRef](../../../sdk/models/shared/trackingref.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billmappingoptions.md b/sync-for-payables/docs/sdk/models/shared/billmappingoptions.md index ce404e26f..d36a5aaef 100644 --- a/sync-for-payables/docs/sdk/models/shared/billmappingoptions.md +++ b/sync-for-payables/docs/sdk/models/shared/billmappingoptions.md @@ -1,36 +1,19 @@ -# BillMappingOptions - -The bill mapping options for a company's accounting software. - -## Example Usage - -```typescript -import { BillMappingOptions } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillMappingOptions = { - accounts: [ - { - id: "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", - nominalCode: "610", - name: "Accounts Payable", - type: "Liability", - currency: "GBP", - status: "Active", - sourceModifiedDate: "2022-10-23T00:00:00Z", - }, - ], - taxRates: [ - { - id: "d2939064-dd3a-4c0f-9865-a238c2193515", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `accounts` | [shared.AccountMappingOption](../../../sdk/models/shared/accountmappingoption.md)[] | :heavy_minus_sign: | N/A | -| `taxRates` | [shared.TaxRateMappingOption](../../../sdk/models/shared/taxratemappingoption.md)[] | :heavy_minus_sign: | N/A | +# BillMappingOptions + +The bill mapping options for a company's accounting software. + +## Example Usage + +```typescript +import { BillMappingOptions } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillMappingOptions = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `accounts` | [shared.AccountMappingOption](../../../sdk/models/shared/accountmappingoption.md)[] | :heavy_minus_sign: | N/A | +| `taxRates` | [shared.TaxRateMappingOption](../../../sdk/models/shared/taxratemappingoption.md)[] | :heavy_minus_sign: | N/A | | `pagination` | [shared.Pagination](../../../sdk/models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billpayment.md b/sync-for-payables/docs/sdk/models/shared/billpayment.md index 9a39e102b..8111103e1 100644 --- a/sync-for-payables/docs/sdk/models/shared/billpayment.md +++ b/sync-for-payables/docs/sdk/models/shared/billpayment.md @@ -1,29 +1,28 @@ -# BillPayment - -## Example Usage - -```typescript -import { BillPayment } from "@codat/sync-for-payables/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -let value: BillPayment = { - amount: new Decimal("22"), - date: "2022-10-23T00:00:00.000Z", - reference: "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "9e32cbf8-e7d5-4d4d-a593-08d550682aab", - }, - currencyRate: new Decimal("1"), -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting software. | | -| `amount` | *Decimal* | :heavy_minus_sign: | Amount of the payment in the bill currency. | 1329.54 | -| `date` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `reference` | *string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | -| `accountRef` | [shared.BillPaymentAccountRef](../../../sdk/models/shared/billpaymentaccountref.md) | :heavy_minus_sign: | Reference to the bank account / credit card which you are using to pay the bill. | | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file +# BillPayment + +## Example Usage + +```typescript +import { BillPayment } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillPayment = { + amount: 22, + date: "2022-10-23T00:00:00.000Z", + reference: "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "9e32cbf8-e7d5-4d4d-a593-08d550682aab", + }, + currencyRate: 1, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting software. | | +| `amount` | *Decimal | number* | :heavy_minus_sign: | Amount of the payment in the bill currency. | 1329.54 | +| `date` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `reference` | *string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `accountRef` | [shared.BillPaymentAccountRef](../../../sdk/models/shared/billpaymentaccountref.md) | :heavy_minus_sign: | Reference to the bank account / credit card which you are using to pay the bill. | | +| `currencyRate` | *Decimal | number* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billpaymentaccountref.md b/sync-for-payables/docs/sdk/models/shared/billpaymentaccountref.md index 1ba880f63..d9c0ea61e 100644 --- a/sync-for-payables/docs/sdk/models/shared/billpaymentaccountref.md +++ b/sync-for-payables/docs/sdk/models/shared/billpaymentaccountref.md @@ -1,19 +1,17 @@ -# BillPaymentAccountRef - -Reference to the bank account / credit card which you are using to pay the bill. - -## Example Usage - -```typescript -import { BillPaymentAccountRef } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillPaymentAccountRef = { - id: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +# BillPaymentAccountRef + +Reference to the bank account / credit card which you are using to pay the bill. + +## Example Usage + +```typescript +import { BillPaymentAccountRef } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillPaymentAccountRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | | `id` | *string* | :heavy_check_mark: | Unique ID of the bank account / credit card | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md b/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md index d9aadc8bb..24e972890 100644 --- a/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md @@ -1,27 +1,26 @@ -# BillPaymentPrototype - -## Example Usage - -```typescript -import { BillPaymentPrototype } from "@codat/sync-for-payables/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -let value: BillPaymentPrototype = { - amount: new Decimal("1329.54"), - date: "2022-10-23T00:00:00Z", - reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount` | *Decimal* | :heavy_check_mark: | Amount of the payment in the bill currency. | 1329.54 | -| `date` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `reference` | *string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | -| `accountRef` | [shared.BillPaymentAccountRef](../../../sdk/models/shared/billpaymentaccountref.md) | :heavy_check_mark: | Reference to the bank account / credit card which you are using to pay the bill. | | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file +# BillPaymentPrototype + +## Example Usage + +```typescript +import { BillPaymentPrototype } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillPaymentPrototype = { + amount: 1329.54, + date: "string", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "string", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Decimal | number* | :heavy_check_mark: | Amount of the payment in the bill currency. | 1329.54 | +| `date` | *string* | :heavy_check_mark: | Date the bill payment was recorded in the accounting software. | | +| `reference` | *string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `accountRef` | [shared.BillPaymentAccountRef](../../../sdk/models/shared/billpaymentaccountref.md) | :heavy_check_mark: | Reference to the bank account / credit card which you are using to pay the bill. | | +| `currencyRate` | *Decimal | number* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billprototype.md b/sync-for-payables/docs/sdk/models/shared/billprototype.md index d3be78020..8b3db26b8 100644 --- a/sync-for-payables/docs/sdk/models/shared/billprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/billprototype.md @@ -1,31 +1,31 @@ -# BillPrototype - -## Example Usage - -```typescript -import { BillPrototype } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillPrototype = { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: null, - status: "Open", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | -| `supplierRef` | [shared.SupplierRef](../../../sdk/models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `issueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `currencyRate` | *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. \| | | -| `lineItems` | [shared.BillLineItem](../../../sdk/models/shared/billlineitem.md)[] | :heavy_minus_sign: | Array of Bill line items. | | +# BillPrototype + +## Example Usage + +```typescript +import { BillPrototype } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillPrototype = { + supplierRef: { + id: "string", + supplierName: "string", + }, + issueDate: "string", + dueDate: "string", + currency: "GBP", + status: "Open", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `supplierRef` | [shared.SupplierRef](../../../sdk/models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | +| `issueDate` | *string* | :heavy_check_mark: | Date of the bill as recorded in the accounting software. | | +| `dueDate` | *string* | :heavy_check_mark: | Date the supplier is due to be paid. | | +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `currencyRate` | *Decimal | number* | :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. \| | | +| `lineItems` | [shared.BillLineItem](../../../sdk/models/shared/billlineitem.md)[] | :heavy_minus_sign: | Array of Bill line items. | | | `status` | [shared.BillStatus](../../../sdk/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bills.md b/sync-for-payables/docs/sdk/models/shared/bills.md index 317958c74..635d26765 100644 --- a/sync-for-payables/docs/sdk/models/shared/bills.md +++ b/sync-for-payables/docs/sdk/models/shared/bills.md @@ -1,39 +1,16 @@ -# Bills - -## Example Usage - -```typescript -import { Bills } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Bills = { - results: [ - { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: [ - { - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - sourceModifiedDate: "2022-10-23T00:00:00Z", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `results` | [shared.Bill](../../../sdk/models/shared/bill.md)[] | :heavy_minus_sign: | N/A | +# Bills + +## Example Usage + +```typescript +import { Bills } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Bills = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `results` | [shared.Bill](../../../sdk/models/shared/bill.md)[] | :heavy_minus_sign: | N/A | | `pagination` | [shared.Pagination](../../../sdk/models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billstatus.md b/sync-for-payables/docs/sdk/models/shared/billstatus.md index 24bd0930d..7993a1550 100644 --- a/sync-for-payables/docs/sdk/models/shared/billstatus.md +++ b/sync-for-payables/docs/sdk/models/shared/billstatus.md @@ -1,17 +1,17 @@ -# BillStatus - -Current state of the bill. If creating a bill the status must be `Open`. - -## Example Usage - -```typescript -import { BillStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillStatus = "Open"; -``` - -## Values - -```typescript -"Unknown" | "Open" | "PartiallyPaid" | "Paid" | "Void" | "Draft" +# BillStatus + +Current state of the bill. If creating a bill the status must be `Open`. + +## Example Usage + +```typescript +import { BillStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Open" | "PartiallyPaid" | "Paid" | "Void" | "Draft" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billtaxrateref.md b/sync-for-payables/docs/sdk/models/shared/billtaxrateref.md index 4233d84a8..9980912db 100644 --- a/sync-for-payables/docs/sdk/models/shared/billtaxrateref.md +++ b/sync-for-payables/docs/sdk/models/shared/billtaxrateref.md @@ -1,17 +1,17 @@ -# BillTaxRateRef - -Reference to the tax rate to which the line item is linked. - -## Example Usage - -```typescript -import { BillTaxRateRef } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: BillTaxRateRef = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +# BillTaxRateRef + +Reference to the tax rate to which the line item is linked. + +## Example Usage + +```typescript +import { BillTaxRateRef } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: BillTaxRateRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting software. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md index b1e7e5ffa..69b481312 100644 --- a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md +++ b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md @@ -1,25 +1,22 @@ -# ClientRateLimitWebhook - -## Example Usage - -```typescript -import { ClientRateLimitWebhook } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: ClientRateLimitWebhook = { - id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - eventType: "client.rateLimit.reset", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - expiryDate: "2022-10-23T00:00:00Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | -| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +# ClientRateLimitWebhook + +## Example Usage + +```typescript +import { ClientRateLimitWebhook } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: ClientRateLimitWebhook = { + id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", + eventType: "client.rateLimit.reset", + generatedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | +| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `payload` | [shared.ClientRateLimitWebhookPayload](../../../sdk/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md index afe0d6bcf..a869d5fe9 100644 --- a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md +++ b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md @@ -1,19 +1,19 @@ -# ClientRateLimitWebhookPayload - -## Example Usage - -```typescript -import { ClientRateLimitWebhookPayload } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: ClientRateLimitWebhookPayload = { - expiryDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | -| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | +# ClientRateLimitWebhookPayload + +## Example Usage + +```typescript +import { ClientRateLimitWebhookPayload } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: ClientRateLimitWebhookPayload = { + expiryDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | +| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | | `expiryDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/codatfile.md b/sync-for-payables/docs/sdk/models/shared/codatfile.md index 3df5c34d8..57c34370b 100644 --- a/sync-for-payables/docs/sdk/models/shared/codatfile.md +++ b/sync-for-payables/docs/sdk/models/shared/codatfile.md @@ -1,16 +1,16 @@ -# CodatFile - -## Example Usage - -```typescript -import { CodatFile } from "@codat/sync-for-payables/sdk/models/shared"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `fileName` | *string* | :heavy_check_mark: | N/A | -| `content` | *ReadableStream* | :heavy_check_mark: | N/A | \ No newline at end of file +# CodatFile + +## Example Usage + +```typescript +import { CodatFile } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: CodatFile = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `content` | *ReadableStream | Blob | ArrayBuffer | Uint8Array* | :heavy_check_mark: | N/A | +| `fileName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/companies.md b/sync-for-payables/docs/sdk/models/shared/companies.md index 6d817ea79..51e961c33 100644 --- a/sync-for-payables/docs/sdk/models/shared/companies.md +++ b/sync-for-payables/docs/sdk/models/shared/companies.md @@ -1,31 +1,23 @@ -# Companies - -## Example Usage - -```typescript -import { Companies } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Companies = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Companies + +## Example Usage + +```typescript +import { Companies } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Companies = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/company.md b/sync-for-payables/docs/sdk/models/shared/company.md index b1717626e..f38424624 100644 --- a/sync-for-payables/docs/sdk/models/shared/company.md +++ b/sync-for-payables/docs/sdk/models/shared/company.md @@ -1,63 +1,61 @@ -# Company - -In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](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. - -## Example Usage - -```typescript -import { Company } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Company = { - id: "0498e921-9b53-4396-a412-4f2f5983b0a2", - name: "string", - redirect: - "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", - lastSync: "2022-01-01T12:00:00.000Z", - created: "2022-01-01T12:00:00.000Z", - createdByUserName: "string", - products: [ - "spend-insights", - "lending", - ], - tags: { - "region": "us", - "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c", - }, - dataConnections: [ - { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - platformName: "Basiq", - linkUrl: - "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", - status: "Linked", - lastSync: "2022-10-27T10:22:43.6464237Z", - created: "2022-10-27T09:53:29Z", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | -| `description` | *string* | :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. | -| `redirect` | *string* | :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 | -| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | -| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | -| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | -| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/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. | | +# Company + +In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](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. + +## Example Usage + +```typescript +import { Company } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Company = { + id: "0498e921-9b53-4396-a412-4f2f5983b0a2", + name: "string", + redirect: "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", + lastSync: "2022-01-01T12:00:00.000Z", + created: "2022-01-01T12:00:00.000Z", + createdByUserName: "string", + products: [ + "spend-insights", + "lending", + ], + tags: { + "region": "us", + "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c", + }, + dataConnections: [ + { + id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", + integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", + integrationKey: "dfxm", + sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", + sourceType: "Banking", + platformName: "Basiq", + linkUrl: "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", + status: "Linked", + lastSync: "2022-10-27T10:22:43.6464237Z", + created: "2022-10-27T09:53:29Z", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | +| `description` | *string* | :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. | +| `redirect` | *string* | :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 | +| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | +| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | The parent entity or controlling organization of this company. Null if the company has no parent. | | +| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/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. | | | `dataConnections` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/companyinformation.md b/sync-for-payables/docs/sdk/models/shared/companyinformation.md index 6a466c52e..87b48ac51 100644 --- a/sync-for-payables/docs/sdk/models/shared/companyinformation.md +++ b/sync-for-payables/docs/sdk/models/shared/companyinformation.md @@ -1,18 +1,18 @@ -# CompanyInformation - -Gets the latest basic info for a company. - -## Example Usage - -```typescript -import { CompanyInformation } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: CompanyInformation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `companyName` | *string* | :heavy_minus_sign: | Name of the linked company. | +# CompanyInformation + +Gets the latest basic info for a company. + +## Example Usage + +```typescript +import { CompanyInformation } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: CompanyInformation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `companyName` | *string* | :heavy_minus_sign: | Name of the linked company. | | `baseCurrency` | *string* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. Used by the currency rate. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/companyreference.md b/sync-for-payables/docs/sdk/models/shared/companyreference.md index 5c0ddc8f6..0066e9b51 100644 --- a/sync-for-payables/docs/sdk/models/shared/companyreference.md +++ b/sync-for-payables/docs/sdk/models/shared/companyreference.md @@ -1,23 +1,23 @@ -# CompanyReference - -## Example Usage - -```typescript -import { CompanyReference } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: CompanyReference = { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_minus_sign: | The name of the company | Codat Ltd. | -| `description` | *string* | :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. | -| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | +# CompanyReference + +## Example Usage + +```typescript +import { CompanyReference } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: CompanyReference = { + id: "8a210b68-6988-11ed-a1eb-0242ac120002", + name: "Codat Ltd.", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_minus_sign: | The name of the company | Codat Ltd. | +| `description` | *string* | :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. | +| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/companyreferencelinks.md b/sync-for-payables/docs/sdk/models/shared/companyreferencelinks.md index 0849f2a89..abcbe7db0 100644 --- a/sync-for-payables/docs/sdk/models/shared/companyreferencelinks.md +++ b/sync-for-payables/docs/sdk/models/shared/companyreferencelinks.md @@ -1,17 +1,17 @@ -# CompanyReferenceLinks - -A collection of links for the company. - -## Example Usage - -```typescript -import { CompanyReferenceLinks } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: CompanyReferenceLinks = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +# CompanyReferenceLinks + +A collection of links for the company. + +## Example Usage + +```typescript +import { CompanyReferenceLinks } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: CompanyReferenceLinks = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | | `portal` | *string* | :heavy_minus_sign: | Link to the company page in the portal. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/companyrequestbody.md b/sync-for-payables/docs/sdk/models/shared/companyrequestbody.md index a5961b8ca..68571f05a 100644 --- a/sync-for-payables/docs/sdk/models/shared/companyrequestbody.md +++ b/sync-for-payables/docs/sdk/models/shared/companyrequestbody.md @@ -1,20 +1,20 @@ -# CompanyRequestBody - -## Example Usage - -```typescript -import { CompanyRequestBody } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: CompanyRequestBody = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | -| `description` | *string* | :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. | +# CompanyRequestBody + +## Example Usage + +```typescript +import { CompanyRequestBody } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: CompanyRequestBody = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | +| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/companyupdaterequest.md b/sync-for-payables/docs/sdk/models/shared/companyupdaterequest.md index c2895414e..f89a74add 100644 --- a/sync-for-payables/docs/sdk/models/shared/companyupdaterequest.md +++ b/sync-for-payables/docs/sdk/models/shared/companyupdaterequest.md @@ -1,20 +1,20 @@ -# CompanyUpdateRequest - -## Example Usage - -```typescript -import { CompanyUpdateRequest } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: CompanyUpdateRequest = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | -| `description` | *string* | :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. | +# CompanyUpdateRequest + +## Example Usage + +```typescript +import { CompanyUpdateRequest } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: CompanyUpdateRequest = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | +| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/connection.md b/sync-for-payables/docs/sdk/models/shared/connection.md index 8f6a4b0d4..b3a78e88e 100644 --- a/sync-for-payables/docs/sdk/models/shared/connection.md +++ b/sync-for-payables/docs/sdk/models/shared/connection.md @@ -1,49 +1,48 @@ -# Connection - -A connection represents a [company's](https://docs.codat.io/sync-for-payables-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). - -## Example Usage - -```typescript -import { Connection } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Connection = { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - platformName: "Basiq", - linkUrl: - "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", - status: "Linked", - lastSync: "2022-10-27T10:22:43.6464237Z", - created: "2022-10-27T09:53:29Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | -| `integrationKey` | *string* | :heavy_minus_sign: | 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. | | -| `sourceId` | *string* | :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 | -| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | -| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | -| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | +# Connection + +A connection represents a [company's](https://docs.codat.io/sync-for-payables-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). + +## Example Usage + +```typescript +import { Connection } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Connection = { + id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", + integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", + integrationKey: "dfxm", + sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", + sourceType: "Banking", + platformName: "Basiq", + linkUrl: "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", + status: "Linked", + lastSync: "2022-10-27T10:22:43.6464237Z", + created: "2022-10-27T09:53:29Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `integrationKey` | *string* | :heavy_minus_sign: | 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. | | +| `sourceId` | *string* | :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 | +| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | +| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | +| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | +| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | +| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | | `connectionInfo` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/connections.md b/sync-for-payables/docs/sdk/models/shared/connections.md index 4605317ee..3a8730c44 100644 --- a/sync-for-payables/docs/sdk/models/shared/connections.md +++ b/sync-for-payables/docs/sdk/models/shared/connections.md @@ -1,31 +1,23 @@ -# Connections - -## Example Usage - -```typescript -import { Connections } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Connections = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Connections + +## Example Usage + +```typescript +import { Connections } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Connections = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md b/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md index 9c60fb1db..22c536d75 100644 --- a/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md +++ b/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md @@ -1,23 +1,23 @@ -# DataConnectionError - -## Example Usage - -```typescript -import { DataConnectionError } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: DataConnectionError = { - erroredOnUtc: "2022-10-23T00:00:00Z", - resolvedOnUtc: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | -| `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | -| `erroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `status` | [shared.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +# DataConnectionError + +## Example Usage + +```typescript +import { DataConnectionError } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: DataConnectionError = { + erroredOnUtc: "2022-10-23T00:00:00Z", + resolvedOnUtc: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | +| `erroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/dataconnectionstatus.md b/sync-for-payables/docs/sdk/models/shared/dataconnectionstatus.md index 99bdbad24..34b3ac00f 100644 --- a/sync-for-payables/docs/sdk/models/shared/dataconnectionstatus.md +++ b/sync-for-payables/docs/sdk/models/shared/dataconnectionstatus.md @@ -1,17 +1,17 @@ -# DataConnectionStatus - -The current authorization status of the data connection. - -## Example Usage - -```typescript -import { DataConnectionStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: DataConnectionStatus = "Deauthorized"; -``` - -## Values - -```typescript -"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" +# DataConnectionStatus + +The current authorization status of the data connection. + +## Example Usage + +```typescript +import { DataConnectionStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: DataConnectionStatus = "PendingAuth"; +``` + +## Values + +```typescript +"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/datatype.md b/sync-for-payables/docs/sdk/models/shared/datatype.md index 158edb5e0..32f968447 100644 --- a/sync-for-payables/docs/sdk/models/shared/datatype.md +++ b/sync-for-payables/docs/sdk/models/shared/datatype.md @@ -1,17 +1,17 @@ -# DataType - -The type of the linked reference. - -## Example Usage - -```typescript -import { DataType } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: DataType = "trackingCategories"; -``` - -## Values - -```typescript -"trackingCategories" | "customers" +# DataType + +Available data types + +## Example Usage + +```typescript +import { DataType } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: DataType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/errorstatus.md b/sync-for-payables/docs/sdk/models/shared/errorstatus.md index 97ce376ef..6e26e9f05 100644 --- a/sync-for-payables/docs/sdk/models/shared/errorstatus.md +++ b/sync-for-payables/docs/sdk/models/shared/errorstatus.md @@ -1,17 +1,17 @@ -# ErrorStatus - -The current status of a transient error. Null statuses indicate that the error is not transient. - -## Example Usage - -```typescript -import { ErrorStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: ErrorStatus = "Resolved"; -``` - -## Values - -```typescript -"Active" | "Resolved" +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + +## Example Usage + +```typescript +import { ErrorStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: ErrorStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/errorvalidation.md b/sync-for-payables/docs/sdk/models/shared/errorvalidation.md index d1ae45764..fd1c0c75d 100644 --- a/sync-for-payables/docs/sdk/models/shared/errorvalidation.md +++ b/sync-for-payables/docs/sdk/models/shared/errorvalidation.md @@ -1,18 +1,18 @@ -# ErrorValidation - -A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { ErrorValidation } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: ErrorValidation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | +# ErrorValidation + +A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { ErrorValidation } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: ErrorValidation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/errorvalidationitem.md b/sync-for-payables/docs/sdk/models/shared/errorvalidationitem.md index c05370744..0b2d15f3b 100644 --- a/sync-for-payables/docs/sdk/models/shared/errorvalidationitem.md +++ b/sync-for-payables/docs/sdk/models/shared/errorvalidationitem.md @@ -1,17 +1,17 @@ -# ErrorValidationItem - -## Example Usage - -```typescript -import { ErrorValidationItem } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: ErrorValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ErrorValidationItem + +## Example Usage + +```typescript +import { ErrorValidationItem } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: ErrorValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/halref.md b/sync-for-payables/docs/sdk/models/shared/halref.md index aba309c2d..16ffa1d6f 100644 --- a/sync-for-payables/docs/sdk/models/shared/halref.md +++ b/sync-for-payables/docs/sdk/models/shared/halref.md @@ -1,15 +1,15 @@ -# HalRef - -## Example Usage - -```typescript -import { HalRef } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: HalRef = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +# HalRef + +## Example Usage + +```typescript +import { HalRef } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: HalRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | | `href` | *string* | :heavy_minus_sign: | Uri hypertext reference. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/links.md b/sync-for-payables/docs/sdk/models/shared/links.md index 17d8cd9be..7c997f6c9 100644 --- a/sync-for-payables/docs/sdk/models/shared/links.md +++ b/sync-for-payables/docs/sdk/models/shared/links.md @@ -1,25 +1,18 @@ -# Links - -## Example Usage - -```typescript -import { Links } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Links = { - self: { - href: "/companies", - }, - current: { - href: "/companies?page=1&pageSize=10", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | +# Links + +## Example Usage + +```typescript +import { Links } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Links = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | | `previous` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/pagination.md b/sync-for-payables/docs/sdk/models/shared/pagination.md index 3e1d39ddc..a919d1a72 100644 --- a/sync-for-payables/docs/sdk/models/shared/pagination.md +++ b/sync-for-payables/docs/sdk/models/shared/pagination.md @@ -1,15 +1,15 @@ -# Pagination - -## Example Usage - -```typescript -import { Pagination } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Pagination = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# Pagination + +## Example Usage + +```typescript +import { Pagination } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Pagination = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `continuationToken` | *string* | :heavy_minus_sign: | A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/paymentmappingoptions.md b/sync-for-payables/docs/sdk/models/shared/paymentmappingoptions.md index dcfa3080b..264233634 100644 --- a/sync-for-payables/docs/sdk/models/shared/paymentmappingoptions.md +++ b/sync-for-payables/docs/sdk/models/shared/paymentmappingoptions.md @@ -1,27 +1,18 @@ -# PaymentMappingOptions - -Gets the bill payments mapping options for a company's accounting software - -## Example Usage - -```typescript -import { PaymentMappingOptions } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: PaymentMappingOptions = { - bankAccounts: [ - { - id: "3d5a8e00-d108-4045-8823-7f342676cffa", - name: "Bank of Dave current account", - status: "Active", - sourceModifiedDate: "2022-10-23T00:00:00Z", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `bankAccounts` | [shared.BankAccountMappingOption](../../../sdk/models/shared/bankaccountmappingoption.md)[] | :heavy_minus_sign: | N/A | +# PaymentMappingOptions + +Gets the bill payments mapping options for a company's accounting software + +## Example Usage + +```typescript +import { PaymentMappingOptions } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: PaymentMappingOptions = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `bankAccounts` | [shared.BankAccountMappingOption](../../../sdk/models/shared/bankaccountmappingoption.md)[] | :heavy_minus_sign: | N/A | | `pagination` | [shared.Pagination](../../../sdk/models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/security.md b/sync-for-payables/docs/sdk/models/shared/security.md index 5f89ebba0..8402c9fd9 100644 --- a/sync-for-payables/docs/sdk/models/shared/security.md +++ b/sync-for-payables/docs/sdk/models/shared/security.md @@ -1,17 +1,15 @@ -# Security - -## Example Usage - -```typescript -import { Security } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: Security = { - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `authHeader` | *string* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file +# Security + +## Example Usage + +```typescript +import { Security } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Security = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `authHeader` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/sourcetype.md b/sync-for-payables/docs/sdk/models/shared/sourcetype.md index f0a72e771..d64b8336d 100644 --- a/sync-for-payables/docs/sdk/models/shared/sourcetype.md +++ b/sync-for-payables/docs/sdk/models/shared/sourcetype.md @@ -1,17 +1,17 @@ -# SourceType - -The type of platform of the connection. - -## Example Usage - -```typescript -import { SourceType } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: SourceType = "Accounting"; -``` - -## Values - -```typescript -"Accounting" | "Banking" | "BankFeed" | "Commerce" | "Expense" | "Other" | "Unknown" +# SourceType + +The type of platform of the connection. + +## Example Usage + +```typescript +import { SourceType } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: SourceType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/supplier.md b/sync-for-payables/docs/sdk/models/shared/supplier.md index 4eac748f5..f6d9644d8 100644 --- a/sync-for-payables/docs/sdk/models/shared/supplier.md +++ b/sync-for-payables/docs/sdk/models/shared/supplier.md @@ -1,51 +1,50 @@ -# Supplier - -Suppliers are people or organizations that provide something, such as a product or service. Use the [List suppliers](https://docs.codat.io/sync-for-payables-v2-api#/operations/list-suppliers) endpoint to retrieve a list of all suppliers for a company. - -Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-v2-api#/schemas/Bill). - - -## Example Usage - -```typescript -import { Supplier } from "@codat/sync-for-payables/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -let value: Supplier = { - id: "sup-10933920", - supplierName: "Northridge Office Supplies", - contactName: "Sarah Johnson", - emailAddress: "sarah.johnson@northridgesupplies.co.uk", - phone: "+44 (0)1223 322410", - addresses: [ - { - type: "Billing", - line1: "Flat 1", - line2: "2 Dennis Avenue", - city: "London", - region: "Camden", - country: "GB", - postalCode: "EC1N 7TE", - }, - ], - status: "Active", - balance: new Decimal("0"), - defaultCurrency: "GBP", - sourceModifiedDate: "2026-03-18T10:30:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | -| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | -| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_minus_sign: | Status of the supplier. | | -| `balance` | *Decimal* | :heavy_minus_sign: | Amount outstanding against the supplier. | | -| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +# Supplier + +Suppliers are people or organizations that provide something, such as a product or service. Use the [List suppliers](https://docs.codat.io/sync-for-payables-v2-api#/operations/list-suppliers) endpoint to retrieve a list of all suppliers for a company. + +Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-v2-api#/schemas/Bill). + + +## Example Usage + +```typescript +import { Supplier } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Supplier = { + id: "sup-10933920", + supplierName: "Northridge Office Supplies", + contactName: "Sarah Johnson", + emailAddress: "sarah.johnson@northridgesupplies.co.uk", + phone: "+44 (0)1223 322410", + addresses: [ + { + type: "Billing", + line1: "Flat 1", + line2: "2 Dennis Avenue", + city: "London", + region: "Camden", + country: "GB", + postalCode: "EC1N 7TE", + }, + ], + status: "Active", + balance: 0, + defaultCurrency: "GBP", + sourceModifiedDate: "2026-03-18T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_minus_sign: | Status of the supplier. | | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Amount outstanding against the supplier. | | +| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | | `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/supplierprototype.md b/sync-for-payables/docs/sdk/models/shared/supplierprototype.md index 2e69e091e..21589dbda 100644 --- a/sync-for-payables/docs/sdk/models/shared/supplierprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/supplierprototype.md @@ -1,26 +1,26 @@ -# SupplierPrototype - -## Example Usage - -```typescript -import { SupplierPrototype } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: SupplierPrototype = { - supplierName: "", - phone: "+44 25691 154789", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `supplierName` | *string* | :heavy_check_mark: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | -| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `balance` | *Decimal* | :heavy_minus_sign: | Amount outstanding against the supplier. | | +# SupplierPrototype + +## Example Usage + +```typescript +import { SupplierPrototype } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: SupplierPrototype = { + supplierName: "string", + phone: "+44 25691 154789", + status: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `supplierName` | *string* | :heavy_check_mark: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Amount outstanding against the supplier. | | | `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/supplierref.md b/sync-for-payables/docs/sdk/models/shared/supplierref.md index c08bc8af6..4b5257729 100644 --- a/sync-for-payables/docs/sdk/models/shared/supplierref.md +++ b/sync-for-payables/docs/sdk/models/shared/supplierref.md @@ -1,20 +1,18 @@ -# SupplierRef - -Reference to the supplier the record relates to. - -## Example Usage - -```typescript -import { SupplierRef } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: SupplierRef = { - id: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | -| `id` | *string* | :heavy_check_mark: | The supplier's unique ID | +# SupplierRef + +Reference to the supplier the record relates to. + +## Example Usage + +```typescript +import { SupplierRef } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: SupplierRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `id` | *string* | :heavy_check_mark: | The supplier's unique ID | | `supplierName` | *string* | :heavy_minus_sign: | The supplier's name | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/suppliers.md b/sync-for-payables/docs/sdk/models/shared/suppliers.md index d2581385b..e5fe6de27 100644 --- a/sync-for-payables/docs/sdk/models/shared/suppliers.md +++ b/sync-for-payables/docs/sdk/models/shared/suppliers.md @@ -1,42 +1,16 @@ -# Suppliers - -## Example Usage - -```typescript -import { Suppliers } from "@codat/sync-for-payables/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -let value: Suppliers = { - results: [ - { - id: "sup-10933920", - supplierName: "Northridge Office Supplies", - contactName: "Sarah Johnson", - emailAddress: "sarah.johnson@northridgesupplies.co.uk", - phone: "+44 (0)1223 322410", - addresses: [ - { - type: "Billing", - line1: "Flat 1", - line2: "2 Dennis Avenue", - city: "London", - region: "Camden", - country: "GB", - postalCode: "EC1N 7TE", - }, - ], - status: "Active", - balance: new Decimal("0"), - defaultCurrency: "GBP", - sourceModifiedDate: "2026-03-18T10:30:00Z", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `results` | [shared.Supplier](../../../sdk/models/shared/supplier.md)[] | :heavy_minus_sign: | N/A | +# Suppliers + +## Example Usage + +```typescript +import { Suppliers } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: Suppliers = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `results` | [shared.Supplier](../../../sdk/models/shared/supplier.md)[] | :heavy_minus_sign: | N/A | | `pagination` | [shared.Pagination](../../../sdk/models/shared/pagination.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/supplierstatus.md b/sync-for-payables/docs/sdk/models/shared/supplierstatus.md index 575c3229e..be4e303ed 100644 --- a/sync-for-payables/docs/sdk/models/shared/supplierstatus.md +++ b/sync-for-payables/docs/sdk/models/shared/supplierstatus.md @@ -1,17 +1,17 @@ -# SupplierStatus - -Status of the supplier. - -## Example Usage - -```typescript -import { SupplierStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: SupplierStatus = "Archived"; -``` - -## Values - -```typescript -"Unknown" | "Active" | "Archived" +# SupplierStatus + +Status of the supplier. + +## Example Usage + +```typescript +import { SupplierStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: SupplierStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Active" | "Archived" ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/taxratemappingoption.md b/sync-for-payables/docs/sdk/models/shared/taxratemappingoption.md index 7bf026e93..b7caec3ab 100644 --- a/sync-for-payables/docs/sdk/models/shared/taxratemappingoption.md +++ b/sync-for-payables/docs/sdk/models/shared/taxratemappingoption.md @@ -1,22 +1,20 @@ -# TaxRateMappingOption - -## Example Usage - -```typescript -import { TaxRateMappingOption } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: TaxRateMappingOption = { - id: "d2939064-dd3a-4c0f-9865-a238c2193515", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the tax rate, unique for the company in the accounting software. | d2939064-dd3a-4c0f-9865-a238c2193515 | -| `name` | *string* | :heavy_minus_sign: | Codat-augmented name of the tax rate in the accounting software. | | -| `code` | *string* | :heavy_minus_sign: | Code for the tax rate from the accounting software. | | -| `effectiveTaxRate` | *Decimal* | :heavy_minus_sign: | See Effective tax rates description. | | -| `totalTaxRate` | *Decimal* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | | -| `status` | [shared.TaxRateStatus](../../../sdk/models/shared/taxratestatus.md) | :heavy_minus_sign: | Status of the tax rate in the accounting software.
- `Active` - An active tax rate in use by a company.
- `Archived` - A tax rate that has been archived or is inactive in the accounting software. | | \ No newline at end of file +# TaxRateMappingOption + +## Example Usage + +```typescript +import { TaxRateMappingOption } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: TaxRateMappingOption = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the tax rate, unique for the company in the accounting software. | +| `name` | *string* | :heavy_minus_sign: | Codat-augmented name of the tax rate in the accounting software. | +| `code` | *string* | :heavy_minus_sign: | Code for the tax rate from the accounting software. | +| `effectiveTaxRate` | *Decimal | number* | :heavy_minus_sign: | See Effective tax rates description. | +| `totalTaxRate` | *Decimal | number* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | +| `status` | [shared.TaxRateStatus](../../../sdk/models/shared/taxratestatus.md) | :heavy_minus_sign: | Status of the tax rate in the accounting software.
- `Active` - An active tax rate in use by a company.
- `Archived` - A tax rate that has been archived or is inactive in the accounting software. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/taxratestatus.md b/sync-for-payables/docs/sdk/models/shared/taxratestatus.md index dd0ffc12b..875d1aa2a 100644 --- a/sync-for-payables/docs/sdk/models/shared/taxratestatus.md +++ b/sync-for-payables/docs/sdk/models/shared/taxratestatus.md @@ -1,19 +1,19 @@ -# TaxRateStatus - -Status of the tax rate in the accounting software. -- `Active` - An active tax rate in use by a company. -- `Archived` - A tax rate that has been archived or is inactive in the accounting software. - -## Example Usage - -```typescript -import { TaxRateStatus } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: TaxRateStatus = "Archived"; -``` - -## Values - -```typescript -"Active" | "Archived" +# TaxRateStatus + +Status of the tax rate in the accounting software. +- `Active` - An active tax rate in use by a company. +- `Archived` - A tax rate that has been archived or is inactive in the accounting software. + +## Example Usage + +```typescript +import { TaxRateStatus } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: TaxRateStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/trackingref.md b/sync-for-payables/docs/sdk/models/shared/trackingref.md index ca27b2183..49ce80a5e 100644 --- a/sync-for-payables/docs/sdk/models/shared/trackingref.md +++ b/sync-for-payables/docs/sdk/models/shared/trackingref.md @@ -1,20 +1,17 @@ -# TrackingRef - -## Example Usage - -```typescript -import { TrackingRef } from "@codat/sync-for-payables/sdk/models/shared"; - -let value: TrackingRef = { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the linked tracking category or the unique identifier of the linked customer. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | The type of the linked reference. | trackingCategories | -| `isBillable` | *boolean* | :heavy_minus_sign: | If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. | | \ No newline at end of file +# TrackingRef + +## Example Usage + +```typescript +import { TrackingRef } from "@codat/sync-for-payables/sdk/models/shared"; + +let value: TrackingRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the linked tracking category or the unique identifier of the linked customer. | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | The type of the linked reference. | +| `isBillable` | *boolean* | :heavy_minus_sign: | If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/bankaccounts/README.md b/sync-for-payables/docs/sdks/bankaccounts/README.md index 432e19e5a..015053247 100644 --- a/sync-for-payables/docs/sdks/bankaccounts/README.md +++ b/sync-for-payables/docs/sdks/bankaccounts/README.md @@ -1,230 +1,218 @@ -# BankAccounts - -## Overview - -Create a bank account for a given company's connection. - -### Available Operations - -* [create](#create) - Create bank account - -## create - -The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. - -[Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - -### Example Usage: Bank account example - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - nominalCode: "22", - name: "Plutus - Payables - Bank Account 12", - accountType: "Debit", - accountNumber: "0120 0440", - sortCode: "50-50-50", - currency: "GBP", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - nominalCode: "22", - name: "Plutus - Payables - Bank Account 12", - accountType: "Debit", - accountNumber: "0120 0440", - sortCode: "50-50-50", - currency: "GBP", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Created bank account - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - name: "", - accountType: "Debit", - accountNumber: "", - currency: "GBP", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - name: "", - accountType: "Debit", - accountNumber: "", - currency: "GBP", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - name: "", - accountType: "Debit", - accountNumber: "", - currency: "GBP", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - name: "", - accountType: "Debit", - accountNumber: "", - currency: "GBP", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBankAccountRequest](../../sdk/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BankAccount](../../sdk/models/shared/bankaccount.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# BankAccounts + +## Overview + +Create a bank account for a given company's connection. + +### Available Operations + +* [create](#create) - Create bank account + +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +### Example Usage: Bank account example + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + nominalCode: "22", + name: "Plutus - Payables - Bank Account 12", + accountType: "Debit", + accountNumber: "0120 0440", + sortCode: "50-50-50", + currency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + nominalCode: "22", + name: "Plutus - Payables - Bank Account 12", + accountType: "Debit", + accountNumber: "0120 0440", + sortCode: "50-50-50", + currency: "GBP", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Created bank account + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + currency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + currency: "GBP", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + currency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + currency: "GBP", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountRequest](../../sdk/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BankAccount](../../sdk/models/shared/bankaccount.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/billpayments/README.md b/sync-for-payables/docs/sdks/billpayments/README.md index c0ce8a6c8..f3f894fea 100644 --- a/sync-for-payables/docs/sdks/billpayments/README.md +++ b/sync-for-payables/docs/sdks/billpayments/README.md @@ -1,338 +1,320 @@ -# BillPayments - -## Overview - -Get, create, and update Bill payments. - -### Available Operations - -* [getPaymentOptions](#getpaymentoptions) - Get payment mapping options -* [create](#create) - Create bill payment - -## getPaymentOptions - -Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID. - -By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - -Mapping options are a set of bank accounts used to configure the SMB's payables integration. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.billPayments.getPaymentOptions({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - statusQuery: "status=Archived", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billPaymentsGetPaymentOptions } from "@codat/sync-for-payables/funcs/billPaymentsGetPaymentOptions.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billPaymentsGetPaymentOptions(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - statusQuery: "status=Archived", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billPaymentsGetPaymentOptions failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetMappingOptionsPaymentsRequest](../../sdk/models/operations/getmappingoptionspaymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PaymentMappingOptions](../../sdk/models/shared/paymentmappingoptions.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. - -[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. - -### Example Usage: Bill payment - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.billPayments.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPaymentPrototype: { - amount: new Decimal("1329.54"), - date: "2022-10-23T00:00:00Z", - reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "", - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billPaymentsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPaymentPrototype: { - amount: new Decimal("1329.54"), - date: "2022-10-23T00:00:00Z", - reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "", - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billPaymentsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Bill payment example - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.billPayments.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPaymentPrototype: { - amount: new Decimal("22"), - date: "2022-10-23T00:00:00.000Z", - reference: "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "7bda9f44sr56", - }, - currencyRate: new Decimal("1"), - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billPaymentsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPaymentPrototype: { - amount: new Decimal("22"), - date: "2022-10-23T00:00:00.000Z", - reference: "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "7bda9f44sr56", - }, - currencyRate: new Decimal("1"), - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billPaymentsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.billPayments.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPaymentPrototype: { - amount: new Decimal("1329.54"), - date: "2022-10-23T00:00:00Z", - reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "", - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billPaymentsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPaymentPrototype: { - amount: new Decimal("1329.54"), - date: "2022-10-23T00:00:00Z", - reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", - accountRef: { - id: "", - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billPaymentsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBillPaymentRequest](../../sdk/models/operations/createbillpaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BillPayment](../../sdk/models/shared/billpayment.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# BillPayments + +## Overview + +Get, create, and update Bill payments. + +### Available Operations + +* [getPaymentOptions](#getpaymentoptions) - Get payment mapping options +* [create](#create) - Create bill payment + +## getPaymentOptions + +Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID. + +By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. + +Mapping options are a set of bank accounts used to configure the SMB's payables integration. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.billPayments.getPaymentOptions({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + statusQuery: "status=Archived", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billPaymentsGetPaymentOptions } from "@codat/sync-for-payables/funcs/billPaymentsGetPaymentOptions.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billPaymentsGetPaymentOptions(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + statusQuery: "status=Archived", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billPaymentsGetPaymentOptions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetMappingOptionsPaymentsRequest](../../sdk/models/operations/getmappingoptionspaymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PaymentMappingOptions](../../sdk/models/shared/paymentmappingoptions.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + +[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + +### Example Usage: Bill payment + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.billPayments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: 1329.54, + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billPaymentsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: 1329.54, + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billPaymentsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Bill payment example + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.billPayments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: 22, + date: "2022-10-23T00:00:00.000Z", + reference: "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "7bda9f44sr56", + }, + currencyRate: 1, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billPaymentsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: 22, + date: "2022-10-23T00:00:00.000Z", + reference: "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "7bda9f44sr56", + }, + currencyRate: 1, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billPaymentsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.billPayments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: 1329.54, + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billPaymentsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: 1329.54, + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billPaymentsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBillPaymentRequest](../../sdk/models/operations/createbillpaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BillPayment](../../sdk/models/shared/billpayment.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/bills/README.md b/sync-for-payables/docs/sdks/bills/README.md index 545aa7c43..caf78a37c 100644 --- a/sync-for-payables/docs/sdks/bills/README.md +++ b/sync-for-payables/docs/sdks/bills/README.md @@ -1,1414 +1,1340 @@ -# Bills - -## Overview - -Get, create, and update Bills. - -### Available Operations - -* [getBillOptions](#getbilloptions) - Get bill mapping options -* [list](#list) - List bills -* [create](#create) - Create bill -* [update](#update) - Update bill -* [uploadAttachment](#uploadattachment) - Upload bill attachment -* [listAttachments](#listattachments) - List bill attachments -* [downloadAttachment](#downloadattachment) - Download bill attachment - -## getBillOptions - -Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company's connection ID. - -By default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - -Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.getBillOptions({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - statusQuery: "status=Archived", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsGetBillOptions } from "@codat/sync-for-payables/funcs/billsGetBillOptions.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsGetBillOptions(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - statusQuery: "status=Archived", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsGetBillOptions failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetMappingOptionsBillsRequest](../../sdk/models/operations/getmappingoptionsbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BillMappingOptions](../../sdk/models/shared/billmappingoptions.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## list - -The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - -[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. - -### Example Usage: Bills - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Source modified date - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (open) - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Open", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Open", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (open) & source modified date - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (partially paid) - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=PartiallyPaid", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=PartiallyPaid", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (partially paid) & source modified date - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListBillsRequest](../../sdk/models/operations/listbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Bills](../../sdk/models/shared/bills.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - -[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -### Example Usage: Create bill - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billPrototype: { - reference: "bill_b8qmmj4ksf1suax", - supplierRef: { - id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", - supplierName: "DIISR - Small Business Services", - }, - issueDate: "2023-04-23T00:00:00", - dueDate: "2023-04-23T00:00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - lineItems: [ - { - description: "Half day training - Microsoft Office", - unitAmount: new Decimal("1800"), - quantity: new Decimal("1"), - taxAmount: new Decimal("360"), - accountRef: { - id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", - }, - totalAmount: new Decimal("2160"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", - unitAmount: new Decimal("4000"), - quantity: new Decimal("1"), - taxAmount: new Decimal("800"), - accountRef: { - id: "f96c9458-d724-47bf-8f74-a9d5726465ce", - }, - totalAmount: new Decimal("4800"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Stationery charges", - unitAmount: new Decimal("32"), - quantity: new Decimal("8"), - taxAmount: new Decimal("51.2"), - accountRef: { - id: "cba6527d-f102-4538-b421-e483233e9d5a", - }, - totalAmount: new Decimal("307.2"), - taxRateRef: { - id: "INPUT2", - }, - trackingRefs: [ - { - id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billPrototype: { - reference: "bill_b8qmmj4ksf1suax", - supplierRef: { - id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", - supplierName: "DIISR - Small Business Services", - }, - issueDate: "2023-04-23T00:00:00", - dueDate: "2023-04-23T00:00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - lineItems: [ - { - description: "Half day training - Microsoft Office", - unitAmount: new Decimal("1800"), - quantity: new Decimal("1"), - taxAmount: new Decimal("360"), - accountRef: { - id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", - }, - totalAmount: new Decimal("2160"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", - unitAmount: new Decimal("4000"), - quantity: new Decimal("1"), - taxAmount: new Decimal("800"), - accountRef: { - id: "f96c9458-d724-47bf-8f74-a9d5726465ce", - }, - totalAmount: new Decimal("4800"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Stationery charges", - unitAmount: new Decimal("32"), - quantity: new Decimal("8"), - taxAmount: new Decimal("51.2"), - accountRef: { - id: "cba6527d-f102-4538-b421-e483233e9d5a", - }, - totalAmount: new Decimal("307.2"), - taxRateRef: { - id: "INPUT2", - }, - trackingRefs: [ - { - id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Created bill - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: null, - status: "Open", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: null, - status: "Open", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: null, - status: "Open", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: null, - status: "Open", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBillRequest](../../sdk/models/operations/createbillrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Bill](../../sdk/models/shared/bill.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - -[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Xero | Yes | -| Oracle NetSuite | No | -| Sage Intacct | No | -| Zoho Books | No | - - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: [ - { - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: [ - { - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update bill - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPrototype: { - reference: "bill_updated_ref", - supplierRef: { - id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", - }, - issueDate: "2023-04-23T00:00:00", - dueDate: "2023-05-23T00:00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - lineItems: [ - { - description: "Updated line item - Microsoft Office training", - unitAmount: new Decimal("2000"), - quantity: new Decimal("1"), - taxAmount: new Decimal("400"), - accountRef: { - id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", - }, - totalAmount: new Decimal("2400"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Desktop/network support via email & phone - updated rate", - unitAmount: new Decimal("4500"), - quantity: new Decimal("1"), - taxAmount: new Decimal("900"), - accountRef: { - id: "f96c9458-d724-47bf-8f74-a9d5726465ce", - }, - totalAmount: new Decimal("5400"), - taxRateRef: { - id: "INPUT2", - }, - trackingRefs: [ - { - id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; -import { Decimal } from "@codat/sync-for-payables/sdk/types"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPrototype: { - reference: "bill_updated_ref", - supplierRef: { - id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", - }, - issueDate: "2023-04-23T00:00:00", - dueDate: "2023-05-23T00:00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - lineItems: [ - { - description: "Updated line item - Microsoft Office training", - unitAmount: new Decimal("2000"), - quantity: new Decimal("1"), - taxAmount: new Decimal("400"), - accountRef: { - id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", - }, - totalAmount: new Decimal("2400"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Desktop/network support via email & phone - updated rate", - unitAmount: new Decimal("4500"), - quantity: new Decimal("1"), - taxAmount: new Decimal("900"), - accountRef: { - id: "f96c9458-d724-47bf-8f74-a9d5726465ce", - }, - totalAmount: new Decimal("5400"), - taxRateRef: { - id: "INPUT2", - }, - trackingRefs: [ - { - id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Updated bill - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: [ - { - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - billPrototype: { - supplierRef: { - id: "", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - lineItems: [ - { - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - dataType: "trackingCategories", - }, - ], - }, - ], - status: "Open", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateBillRequest](../../sdk/models/operations/updatebillrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Bill](../../sdk/models/shared/bill.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## uploadAttachment - -The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. - -[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.uploadAttachment({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsUploadAttachment } from "@codat/sync-for-payables/funcs/billsUploadAttachment.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsUploadAttachment(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsUploadAttachment failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UploadBillAttachmentRequest](../../sdk/models/operations/uploadbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Attachment](../../sdk/models/shared/attachment.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## listAttachments - -The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. - -[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.listAttachments({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsListAttachments } from "@codat/sync-for-payables/funcs/billsListAttachments.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsListAttachments(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsListAttachments failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListBillAttachmentsRequest](../../sdk/models/operations/listbillattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Attachment[]](../../models/.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## downloadAttachment - -The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. - -[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - -Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. - - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.bills.downloadAttachment({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsDownloadAttachment } from "@codat/sync-for-payables/funcs/billsDownloadAttachment.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await billsDownloadAttachment(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("billsDownloadAttachment failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DownloadBillAttachmentRequest](../../sdk/models/operations/downloadbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[ReadableStream](../../models/data.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Bills + +## Overview + +Get, create, and update Bills. + +### Available Operations + +* [getBillOptions](#getbilloptions) - Get bill mapping options +* [list](#list) - List bills +* [create](#create) - Create bill +* [update](#update) - Update bill +* [uploadAttachment](#uploadattachment) - Upload bill attachment +* [listAttachments](#listattachments) - List bill attachments +* [downloadAttachment](#downloadattachment) - Download bill attachment + +## getBillOptions + +Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company's connection ID. + +By default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. + +Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.getBillOptions({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + statusQuery: "status=Archived", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsGetBillOptions } from "@codat/sync-for-payables/funcs/billsGetBillOptions.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsGetBillOptions(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + statusQuery: "status=Archived", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsGetBillOptions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetMappingOptionsBillsRequest](../../sdk/models/operations/getmappingoptionsbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BillMappingOptions](../../sdk/models/shared/billmappingoptions.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. + +### Example Usage: Bills + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (open) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Open", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Open", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (open) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (partially paid) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=PartiallyPaid", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=PartiallyPaid", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (partially paid) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListBillsRequest](../../sdk/models/operations/listbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Bills](../../sdk/models/shared/bills.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Example Usage: Create bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + reference: "bill_b8qmmj4ksf1suax", + supplierRef: { + id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", + supplierName: "DIISR - Small Business Services", + }, + issueDate: "2023-04-23T00:00:00", + dueDate: "2023-04-23T00:00:00", + currency: "GBP", + currencyRate: 1, + lineItems: [ + { + description: "Half day training - Microsoft Office", + unitAmount: 1800, + quantity: 1, + taxAmount: 360, + accountRef: { + id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + totalAmount: 2160, + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", + unitAmount: 4000, + quantity: 1, + taxAmount: 800, + accountRef: { + id: "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + totalAmount: 4800, + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Stationery charges", + unitAmount: 32, + quantity: 8, + taxAmount: 51.2, + accountRef: { + id: "cba6527d-f102-4538-b421-e483233e9d5a", + }, + totalAmount: 307.2, + taxRateRef: { + id: "INPUT2", + }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + reference: "bill_b8qmmj4ksf1suax", + supplierRef: { + id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", + supplierName: "DIISR - Small Business Services", + }, + issueDate: "2023-04-23T00:00:00", + dueDate: "2023-04-23T00:00:00", + currency: "GBP", + currencyRate: 1, + lineItems: [ + { + description: "Half day training - Microsoft Office", + unitAmount: 1800, + quantity: 1, + taxAmount: 360, + accountRef: { + id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + totalAmount: 2160, + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", + unitAmount: 4000, + quantity: 1, + taxAmount: 800, + accountRef: { + id: "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + totalAmount: 4800, + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Stationery charges", + unitAmount: 32, + quantity: 8, + taxAmount: 51.2, + accountRef: { + id: "cba6527d-f102-4538-b421-e483233e9d5a", + }, + totalAmount: 307.2, + taxRateRef: { + id: "INPUT2", + }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Created bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBillRequest](../../sdk/models/operations/createbillrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Bill](../../sdk/models/shared/bill.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | +| Oracle NetSuite | No | +| Sage Intacct | No | +| Zoho Books | No | + + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + reference: "bill_updated_ref", + supplierRef: { + id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", + }, + issueDate: "2023-04-23T00:00:00", + dueDate: "2023-05-23T00:00:00", + currency: "GBP", + currencyRate: 1, + lineItems: [ + { + description: "Updated line item - Microsoft Office training", + unitAmount: 2000, + quantity: 1, + taxAmount: 400, + accountRef: { + id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + totalAmount: 2400, + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Desktop/network support via email & phone - updated rate", + unitAmount: 4500, + quantity: 1, + taxAmount: 900, + accountRef: { + id: "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + totalAmount: 5400, + taxRateRef: { + id: "INPUT2", + }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + reference: "bill_updated_ref", + supplierRef: { + id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", + }, + issueDate: "2023-04-23T00:00:00", + dueDate: "2023-05-23T00:00:00", + currency: "GBP", + currencyRate: 1, + lineItems: [ + { + description: "Updated line item - Microsoft Office training", + unitAmount: 2000, + quantity: 1, + taxAmount: 400, + accountRef: { + id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + totalAmount: 2400, + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Desktop/network support via email & phone - updated rate", + unitAmount: 4500, + quantity: 1, + taxAmount: 900, + accountRef: { + id: "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + totalAmount: 5400, + taxRateRef: { + id: "INPUT2", + }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Updated bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateBillRequest](../../sdk/models/operations/updatebillrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Bill](../../sdk/models/shared/bill.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## uploadAttachment + +The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.uploadAttachment({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsUploadAttachment } from "@codat/sync-for-payables/funcs/billsUploadAttachment.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsUploadAttachment(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsUploadAttachment failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UploadBillAttachmentRequest](../../sdk/models/operations/uploadbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Attachment](../../sdk/models/shared/attachment.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## listAttachments + +The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.listAttachments({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsListAttachments } from "@codat/sync-for-payables/funcs/billsListAttachments.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsListAttachments(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsListAttachments failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListBillAttachmentsRequest](../../sdk/models/operations/listbillattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Attachment[]](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## downloadAttachment + +The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.downloadAttachment({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsDownloadAttachment } from "@codat/sync-for-payables/funcs/billsDownloadAttachment.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsDownloadAttachment(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsDownloadAttachment failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DownloadBillAttachmentRequest](../../sdk/models/operations/downloadbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[ReadableStream](../../models/data.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/companies/README.md b/sync-for-payables/docs/sdks/companies/README.md index 86f656c14..90b3acc1f 100644 --- a/sync-for-payables/docs/sdks/companies/README.md +++ b/sync-for-payables/docs/sdks/companies/README.md @@ -1,1050 +1,1050 @@ -# Companies - -## Overview - -Create and manage your SMB users' companies. - -### Available Operations - -* [list](#list) - List companies -* [create](#create) - Create company -* [replace](#replace) - Replace company -* [update](#update) - Update company -* [delete](#delete) - Delete a company -* [get](#get) - Get company - -## list - -The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances. - -A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -## Filter by tags - -The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - -- equals (`=`) -- not equals (`!=`) -- contains (`~`) - -For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: -- Foreign key: `uid = {yourCustomerId}` -- Region: `region != uk` -- Owning team and region: `region = uk && owningTeam = invoice-finance` - -### Example Usage: List of Companies - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesList } from "@codat/sync-for-payables/funcs/companiesList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatSyncPayables, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` -### Example Usage: One company - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesList } from "@codat/sync-for-payables/funcs/companiesList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatSyncPayables, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. - -A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncPayables, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a description - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.create({ - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncPayables, { - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a tag - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncPayables, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With no description - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.create({ - name: "Technicalium", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncPayables, { - name: "Technicalium", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## replace - -Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - -A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update description - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -Use the *Update company* endpoint to update the name, description, or tags of the company. - -The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - -A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update tags - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. - -A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatSyncPayables.companies.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesDelete } from "@codat/sync-for-payables/funcs/companiesDelete.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesDelete(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -The *Get company* endpoint returns a single company for a given `companyId`. - -A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - -### Example Usage: Parent multi-entity company - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Simple company - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Subsidiary multi-entity company - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Companies + +## Overview + +Create and manage your SMB users' companies. + +### Available Operations + +* [list](#list) - List companies +* [create](#create) - Create company +* [replace](#replace) - Replace company +* [update](#update) - Update company +* [delete](#delete) - Delete a company +* [get](#get) - Get company + +## list + +The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` + +### Example Usage: List of Companies + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesList } from "@codat/sync-for-payables/funcs/companiesList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatSyncPayables, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` +### Example Usage: One company + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesList } from "@codat/sync-for-payables/funcs/companiesList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatSyncPayables, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a description + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a tag + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With no description + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Technicalium", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Technicalium", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## replace + +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update description + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Use the *Update company* endpoint to update the name, description, or tags of the company. + +The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update tags + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatSyncPayables.companies.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesDelete } from "@codat/sync-for-payables/funcs/companiesDelete.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesDelete(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get company* endpoint returns a single company for a given `companyId`. + +A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage: Parent multi-entity company + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Simple company + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Subsidiary multi-entity company + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/companyinformation/README.md b/sync-for-payables/docs/sdks/companyinformation/README.md index 69ba5168f..ad67ea821 100644 --- a/sync-for-payables/docs/sdks/companyinformation/README.md +++ b/sync-for-payables/docs/sdks/companyinformation/README.md @@ -1,88 +1,88 @@ -# CompanyInformation - -## Overview - -View company profile from the source platform. - -### Available Operations - -* [get](#get) - Get company information - -## get - -Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. - - - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.companyInformation.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { companyInformationGet } from "@codat/sync-for-payables/funcs/companyInformationGet.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companyInformationGet(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companyInformationGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyInformationRequest](../../sdk/models/operations/getcompanyinformationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyInformation](../../sdk/models/shared/companyinformation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# CompanyInformation + +## Overview + +View company profile from the source platform. + +### Available Operations + +* [get](#get) - Get company information + +## get + +Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + + + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companyInformation.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companyInformationGet } from "@codat/sync-for-payables/funcs/companyInformationGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companyInformationGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companyInformationGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyInformationRequest](../../sdk/models/operations/getcompanyinformationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyInformation](../../sdk/models/shared/companyinformation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/connections/README.md b/sync-for-payables/docs/sdks/connections/README.md index 452a258b5..bbb0f3b96 100644 --- a/sync-for-payables/docs/sdks/connections/README.md +++ b/sync-for-payables/docs/sdks/connections/README.md @@ -1,468 +1,468 @@ -# Connections - -## Overview - -Create new and manage existing data connections for a company. - -### Available Operations - -* [list](#list) - List connections -* [create](#create) - Create connection -* [get](#get) - Get connection -* [delete](#delete) - Delete connection -* [unlink](#unlink) - Unlink connection - -## list - -List the connections for a company. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.connections.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { connectionsList } from "@codat/sync-for-payables/funcs/connectionsList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -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. - -### Example Usage: Connection - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { connectionsCreate } from "@codat/sync-for-payables/funcs/connectionsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { connectionsCreate } from "@codat/sync-for-payables/funcs/connectionsCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -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. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.connections.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { connectionsGet } from "@codat/sync-for-payables/funcs/connectionsGet.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsGet(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -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. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatSyncPayables.connections.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { connectionsDelete } from "@codat/sync-for-payables/funcs/connectionsDelete.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsDelete(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("connectionsDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## unlink - -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. - -### Example Usage - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.connections.unlink({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - status: "Unlinked", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { connectionsUnlink } from "@codat/sync-for-payables/funcs/connectionsUnlink.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsUnlink(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - status: "Unlinked", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsUnlink failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Connections + +## Overview + +Create new and manage existing data connections for a company. + +### Available Operations + +* [list](#list) - List connections +* [create](#create) - Create connection +* [get](#get) - Get connection +* [delete](#delete) - Delete connection +* [unlink](#unlink) - Unlink connection + +## list + +List the connections for a company. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.connections.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsList } from "@codat/sync-for-payables/funcs/connectionsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +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. + +### Example Usage: Connection + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsCreate } from "@codat/sync-for-payables/funcs/connectionsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsCreate } from "@codat/sync-for-payables/funcs/connectionsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +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. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.connections.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsGet } from "@codat/sync-for-payables/funcs/connectionsGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +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. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatSyncPayables.connections.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsDelete } from "@codat/sync-for-payables/funcs/connectionsDelete.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsDelete(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("connectionsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## unlink + +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. + +### Example Usage + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.connections.unlink({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: { + status: "Unlinked", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsUnlink } from "@codat/sync-for-payables/funcs/connectionsUnlink.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsUnlink(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: { + status: "Unlinked", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsUnlink failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/suppliers/README.md b/sync-for-payables/docs/sdks/suppliers/README.md index 059dfa32c..af0567bc2 100644 --- a/sync-for-payables/docs/sdks/suppliers/README.md +++ b/sync-for-payables/docs/sdks/suppliers/README.md @@ -1,836 +1,824 @@ -# Suppliers - -## Overview - -Get, create, and update Suppliers. - -### Available Operations - -* [list](#list) - List suppliers -* [create](#create) - Create supplier -* [update](#update) - Update supplier - -## list - -The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - -For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Xero | Yes | -| Oracle NetSuite | Yes | -| Sage Intacct | Yes | -| Zoho Books | Yes | - -### Example Usage: Source modified date - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (active) - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Active", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Active", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (active) & source modified date - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (archived) - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Archived", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Archived", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Status (archived) & source modified date - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Suppliers - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListSuppliersRequest](../../sdk/models/operations/listsuppliersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Suppliers](../../sdk/models/shared/suppliers.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Xero | Yes | -| Oracle NetSuite | Yes | -| Sage Intacct | Yes | -| Zoho Books | Yes | - - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierPrototype: { - supplierName: "", - phone: "+44 25691 154789", - status: "Unknown", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersCreate } from "@codat/sync-for-payables/funcs/suppliersCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierPrototype: { - supplierName: "", - phone: "+44 25691 154789", - status: "Unknown", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Suppliers - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierPrototype: { - supplierName: "Northridge Office Supplies", - contactName: "Sarah Johnson", - emailAddress: "sarah.johnson@northridgesupplies.co.uk", - phone: "+44 (0)1223 322410", - addresses: [ - { - type: "Billing", - line1: "Flat 1", - line2: "2 Dennis Avenue", - city: "London", - region: "Camden", - country: "GB", - postalCode: "EC1N 7TE", - }, - ], - status: "Active", - defaultCurrency: "GBP", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersCreate } from "@codat/sync-for-payables/funcs/suppliersCreate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersCreate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierPrototype: { - supplierName: "Northridge Office Supplies", - contactName: "Sarah Johnson", - emailAddress: "sarah.johnson@northridgesupplies.co.uk", - phone: "+44 (0)1223 322410", - addresses: [ - { - type: "Billing", - line1: "Flat 1", - line2: "2 Dennis Avenue", - city: "London", - region: "Camden", - country: "GB", - postalCode: "EC1N 7TE", - }, - ], - status: "Active", - defaultCurrency: "GBP", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateSupplierRequest](../../sdk/models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Supplier](../../sdk/models/shared/supplier.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -This is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record. - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Xero | Yes | -| Oracle NetSuite | No | -| Sage Intacct | No | -| Zoho Books | No | - -### Platform-specific behavior - -- **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating. -- **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update. - - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplierPrototype: { - supplierName: "", - phone: "+44 25691 154789", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersUpdate } from "@codat/sync-for-payables/funcs/suppliersUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplierPrototype: { - supplierName: "", - phone: "+44 25691 154789", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update supplier - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplierPrototype: { - supplierName: "Northridge Office Supplies", - contactName: "Sarah Johnson", - emailAddress: "sarah.johnson@northridgesupplies.co.uk", - phone: "+44 (0)1223 322410", - addresses: [ - { - type: "Billing", - line1: "Flat 1", - line2: "2 Dennis Avenue", - city: "London", - region: "Camden", - country: "GB", - postalCode: "EC1N 7TE", - }, - ], - status: "Active", - defaultCurrency: "GBP", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersUpdate } from "@codat/sync-for-payables/funcs/suppliersUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplierPrototype: { - supplierName: "Northridge Office Supplies", - contactName: "Sarah Johnson", - emailAddress: "sarah.johnson@northridgesupplies.co.uk", - phone: "+44 (0)1223 322410", - addresses: [ - { - type: "Billing", - line1: "Flat 1", - line2: "2 Dennis Avenue", - city: "London", - region: "Camden", - country: "GB", - postalCode: "EC1N 7TE", - }, - ], - status: "Active", - defaultCurrency: "GBP", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Updated supplier - - -```typescript -import { CodatSyncPayables } from "@codat/sync-for-payables"; - -const codatSyncPayables = new CodatSyncPayables({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncPayables.suppliers.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplierPrototype: { - supplierName: "", - phone: "+44 25691 154789", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { suppliersUpdate } from "@codat/sync-for-payables/funcs/suppliersUpdate.js"; - -// Use `CodatSyncPayablesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncPayables = new CodatSyncPayablesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersUpdate(codatSyncPayables, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplierPrototype: { - supplierName: "", - phone: "+44 25691 154789", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateSupplierRequest](../../sdk/models/operations/updatesupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Supplier](../../sdk/models/shared/supplier.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Suppliers + +## Overview + +Get, create, and update Suppliers. + +### Available Operations + +* [list](#list) - List suppliers +* [create](#create) - Create supplier +* [update](#update) - Update supplier + +## list + +The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. + +For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | +| Oracle NetSuite | Yes | +| Sage Intacct | Yes | +| Zoho Books | Yes | + +### Example Usage: Source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (active) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Active", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Active", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (active) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (archived) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Archived", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Archived", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (archived) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Suppliers + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListSuppliersRequest](../../sdk/models/operations/listsuppliersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Suppliers](../../sdk/models/shared/suppliers.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | +| Oracle NetSuite | Yes | +| Sage Intacct | Yes | +| Zoho Books | Yes | + + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierPrototype: { + phone: "+44 25691 154789", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersCreate } from "@codat/sync-for-payables/funcs/suppliersCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierPrototype: { + phone: "+44 25691 154789", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Suppliers + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierPrototype: { + supplierName: "Northridge Office Supplies", + contactName: "Sarah Johnson", + emailAddress: "sarah.johnson@northridgesupplies.co.uk", + phone: "+44 (0)1223 322410", + addresses: [ + { + type: "Billing", + line1: "Flat 1", + line2: "2 Dennis Avenue", + city: "London", + region: "Camden", + country: "GB", + postalCode: "EC1N 7TE", + }, + ], + status: "Active", + defaultCurrency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersCreate } from "@codat/sync-for-payables/funcs/suppliersCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierPrototype: { + supplierName: "Northridge Office Supplies", + contactName: "Sarah Johnson", + emailAddress: "sarah.johnson@northridgesupplies.co.uk", + phone: "+44 (0)1223 322410", + addresses: [ + { + type: "Billing", + line1: "Flat 1", + line2: "2 Dennis Avenue", + city: "London", + region: "Camden", + country: "GB", + postalCode: "EC1N 7TE", + }, + ], + status: "Active", + defaultCurrency: "GBP", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateSupplierRequest](../../sdk/models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Supplier](../../sdk/models/shared/supplier.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +This is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record. + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | +| Oracle NetSuite | No | +| Sage Intacct | No | +| Zoho Books | No | + +### Platform-specific behavior + +- **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating. +- **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update. + + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplierPrototype: { + phone: "+44 25691 154789", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersUpdate } from "@codat/sync-for-payables/funcs/suppliersUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplierPrototype: { + phone: "+44 25691 154789", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update supplier + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplierPrototype: { + supplierName: "Northridge Office Supplies", + contactName: "Sarah Johnson", + emailAddress: "sarah.johnson@northridgesupplies.co.uk", + phone: "+44 (0)1223 322410", + addresses: [ + { + type: "Billing", + line1: "Flat 1", + line2: "2 Dennis Avenue", + city: "London", + region: "Camden", + country: "GB", + postalCode: "EC1N 7TE", + }, + ], + status: "Active", + defaultCurrency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersUpdate } from "@codat/sync-for-payables/funcs/suppliersUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplierPrototype: { + supplierName: "Northridge Office Supplies", + contactName: "Sarah Johnson", + emailAddress: "sarah.johnson@northridgesupplies.co.uk", + phone: "+44 (0)1223 322410", + addresses: [ + { + type: "Billing", + line1: "Flat 1", + line2: "2 Dennis Avenue", + city: "London", + region: "Camden", + country: "GB", + postalCode: "EC1N 7TE", + }, + ], + status: "Active", + defaultCurrency: "GBP", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Updated supplier + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplierPrototype: { + phone: "+44 25691 154789", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersUpdate } from "@codat/sync-for-payables/funcs/suppliersUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplierPrototype: { + phone: "+44 25691 154789", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateSupplierRequest](../../sdk/models/operations/updatesupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Supplier](../../sdk/models/shared/supplier.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/jsr.json b/sync-for-payables/jsr.json deleted file mode 100644 index b2c9844ee..000000000 --- a/sync-for-payables/jsr.json +++ /dev/null @@ -1,27 +0,0 @@ - - -{ - "name": "@codat/sync-for-payables", - "version": "9.3.2", - "exports": { - ".": "./src/index.ts", - "./sdk/models/errors": "./src/sdk/models/errors/index.ts", - "./sdk/models/shared": "./src/sdk/models/shared/index.ts", - "./sdk/models/operations": "./src/sdk/models/operations/index.ts", - "./lib/config": "./src/lib/config.ts", - "./lib/http": "./src/lib/http.ts", - "./lib/retries": "./src/lib/retries.ts", - "./lib/sdks": "./src/lib/sdks.ts", - "./types": "./src/sdk/types/index.ts" - }, - "publish": { - "include": [ - "LICENSE", - "README.md", - "RUNTIMES.md", - "USAGE.md", - "jsr.json", - "src/**/*.ts" - ] - } -} diff --git a/sync-for-payables/package.json b/sync-for-payables/package.json index 2fd28d81f..fb61aef52 100644 --- a/sync-for-payables/package.json +++ b/sync-for-payables/package.json @@ -1,31 +1,59 @@ { "name": "@codat/sync-for-payables", - "version": "9.3.2", + "version": "9.3.3", "author": "Codat", - "main": "./index.js", - "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/codatio/client-sdk-typescript.git", "directory": "sync-for-payables" }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, "scripts": { - "lint": "eslint --cache --max-warnings=0 src", - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "peerDependencies": { - + "build": "tsc && tsc -p tsconfig.esm.json", + "prepare": "npm run build" }, "devDependencies": { - "@eslint/js": "^9.26.0", - "eslint": "^9.26.0", - "globals": "^15.14.0", - "typescript": "~5.8.3", - "typescript-eslint": "^8.26.0" + "typescript": "^4.0 || ^5.0" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./sdk/models/shared": { + "types": "./dist/sdk/models/shared/index.d.ts", + "default": "./dist/sdk/models/shared/index.js" + }, + "./sdk/models/operations": { + "types": "./dist/sdk/models/operations/index.d.ts", + "default": "./dist/sdk/models/operations/index.js" + }, + "./sdk/models/errors": { + "types": "./dist/sdk/models/errors/index.d.ts", + "default": "./dist/sdk/models/errors/index.js" + }, + "./sdk/types": { + "types": "./dist/sdk/types/index.d.ts", + "default": "./dist/sdk/types/index.js" + }, + "./core.js": { + "types": "./dist/core.d.ts", + "default": "./dist/core.js" + }, + "./lib/http": { + "types": "./dist/lib/sdkconfig.d.ts", + "default": "./dist/lib/sdkconfig.js" + }, + "./funcs/*.js": { + "types": "./dist/funcs/*.d.ts", + "default": "./dist/funcs/*.js" + }, + "./package.json": "./package.json" }, "dependencies": { - "decimal.js": "^10.4.3", - "zod": "^3.25.0 || ^4.0.0" + "decimal.js": "^10.4.3" } } diff --git a/sync-for-payables/src/apis/BankAccounts.ts b/sync-for-payables/src/apis/BankAccounts.ts new file mode 100644 index 000000000..4563cb5bc --- /dev/null +++ b/sync-for-payables/src/apis/BankAccounts.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BankAccount, + BankAccountPrototype, + ErrorMessage, +} from '../sdk/models/index'; +import { + BankAccountFromJSON, + BankAccountToJSON, + BankAccountPrototypeFromJSON, + BankAccountPrototypeToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateBankAccountRequest { + companyId: string; + connectionId: string; + idempotencyKey?: string; + bankAccountPrototype?: BankAccountPrototype; +} + +/** + * + */ +export class BankAccounts extends runtime.BaseAPI { + + /** + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + * Create bank account + */ + private async createBankAccountRaw(requestParameters: CreateBankAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBankAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBankAccount().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['idempotencyKey'] != null) { + headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bankAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-bank-account', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BankAccountPrototypeToJSON(requestParameters['bankAccountPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BankAccountFromJSON(jsonValue)); + } + + /** + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + * Create bank account + */ + async create(requestParameters: CreateBankAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBankAccountRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-payables/src/apis/BillPayments.ts b/sync-for-payables/src/apis/BillPayments.ts new file mode 100644 index 000000000..18a2ea826 --- /dev/null +++ b/sync-for-payables/src/apis/BillPayments.ts @@ -0,0 +1,172 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BillPayment, + BillPaymentPrototype, + ErrorMessage, + PaymentMappingOptions, +} from '../sdk/models/index'; +import { + BillPaymentFromJSON, + BillPaymentToJSON, + BillPaymentPrototypeFromJSON, + BillPaymentPrototypeToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PaymentMappingOptionsFromJSON, + PaymentMappingOptionsToJSON, +} from '../sdk/models/index'; + +export interface CreateBillPaymentRequest { + companyId: string; + connectionId: string; + billId: string; + idempotencyKey?: string; + billPaymentPrototype?: BillPaymentPrototype; +} + +export interface GetMappingOptionsPaymentsRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + statusQuery?: string; +} + +/** + * + */ +export class BillPayments extends runtime.BaseAPI { + + /** + * The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company\'s connection. [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + * Create bill payment + */ + private async createBillPaymentRaw(requestParameters: CreateBillPaymentRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBillPayment().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBillPayment().' + ); + } + + if (requestParameters['billId'] == null) { + throw new runtime.RequiredError( + 'billId', + 'Required parameter "billId" was null or undefined when calling createBillPayment().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['idempotencyKey'] != null) { + headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))), + method: 'POST', + operationId: 'create-bill-payment', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BillPaymentPrototypeToJSON(requestParameters['billPaymentPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillPaymentFromJSON(jsonValue)); + } + + /** + * The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company\'s connection. [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + * Create bill payment + */ + async create(requestParameters: CreateBillPaymentRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBillPaymentRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company\'s connection ID. By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. Mapping options are a set of bank accounts used to configure the SMB\'s payables integration. + * Get payment mapping options + */ + private async getMappingOptionsPaymentsRaw(requestParameters: GetMappingOptionsPaymentsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getMappingOptionsPayments().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getMappingOptionsPayments().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['continuationToken'] != null) { + queryParameters['continuationToken'] = requestParameters['continuationToken']; + } + + if (requestParameters['statusQuery'] != null) { + queryParameters['statusQuery'] = requestParameters['statusQuery']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-mapping-options-payments', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaymentMappingOptionsFromJSON(jsonValue)); + } + + /** + * Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company\'s connection ID. By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. Mapping options are a set of bank accounts used to configure the SMB\'s payables integration. + * Get payment mapping options + */ + async getPaymentOptions(requestParameters: GetMappingOptionsPaymentsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getMappingOptionsPaymentsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-payables/src/apis/Bills.ts b/sync-for-payables/src/apis/Bills.ts new file mode 100644 index 000000000..2619772fe --- /dev/null +++ b/sync-for-payables/src/apis/Bills.ts @@ -0,0 +1,543 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { CodatFile } from '../sdk/models/index'; +import type { Attachment } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Bill, + BillMappingOptions, + BillPrototype, + ErrorMessage, +} from '../sdk/models/index'; +import { + BillFromJSON, + BillToJSON, + BillMappingOptionsFromJSON, + BillMappingOptionsToJSON, + BillPrototypeFromJSON, + BillPrototypeToJSON, + BillsFromJSON, + BillsToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateBillRequest { + companyId: string; + connectionId: string; + idempotencyKey?: string; + billPrototype?: BillPrototype; +} + +export interface DownloadBillAttachmentRequest { + companyId: string; + connectionId: string; + billId: string; + attachmentId: string; +} + +export interface GetMappingOptionsBillsRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + statusQuery?: string; +} + +export interface ListBillAttachmentsRequest { + companyId: string; + connectionId: string; + billId: string; +} + +export interface ListBillsRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + query?: string; +} + +export interface UpdateBillRequest { + companyId: string; + connectionId: string; + billId: string; + idempotencyKey?: string; + billPrototype?: BillPrototype; +} + +export interface UploadBillAttachmentRequest { + companyId: string; + connectionId: string; + billId: string; + file?: CodatFile | Blob; +} + +/** + * + */ +export class Bills extends runtime.BaseAPI { + + /** + * The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company\'s connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * Create bill + */ + private async createBillRaw(requestParameters: CreateBillRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBill().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBill().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['idempotencyKey'] != null) { + headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-bill', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BillPrototypeToJSON(requestParameters['billPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillFromJSON(jsonValue)); + } + + /** + * The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company\'s connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * Create bill + */ + async create(requestParameters: CreateBillRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBillRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * Download bill attachment + */ + private async downloadBillAttachmentRaw(requestParameters: DownloadBillAttachmentRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling downloadBillAttachment().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling downloadBillAttachment().' + ); + } + + if (requestParameters['billId'] == null) { + throw new runtime.RequiredError( + 'billId', + 'Required parameter "billId" was null or undefined when calling downloadBillAttachment().' + ); + } + + if (requestParameters['attachmentId'] == null) { + throw new runtime.RequiredError( + 'attachmentId', + 'Required parameter "attachmentId" was null or undefined when calling downloadBillAttachment().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + headerParameters['Accept'] = 'application/octet-stream'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))).replace(`{${"attachmentId"}}`, encodeURIComponent(String(requestParameters['attachmentId']))), + method: 'GET', + operationId: 'download-bill-attachment', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.BlobApiResponse(response); + } + + /** + * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * Download bill attachment + */ + async downloadAttachment(requestParameters: DownloadBillAttachmentRequest, options?: runtime.RequestOptions): Promise> { + const response = await this.downloadBillAttachmentRaw(requestParameters, options); + return response.raw.body as ReadableStream; + } + + /** + * Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company\'s connection ID. By default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. Mapping options are a set of accounts and tax rates used to configure the SMB\'s payables integration. + * Get bill mapping options + */ + private async getMappingOptionsBillsRaw(requestParameters: GetMappingOptionsBillsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getMappingOptionsBills().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getMappingOptionsBills().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['continuationToken'] != null) { + queryParameters['continuationToken'] = requestParameters['continuationToken']; + } + + if (requestParameters['statusQuery'] != null) { + queryParameters['statusQuery'] = requestParameters['statusQuery']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-mapping-options-bills', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillMappingOptionsFromJSON(jsonValue)); + } + + /** + * Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company\'s connection ID. By default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. Mapping options are a set of accounts and tax rates used to configure the SMB\'s payables integration. + * Get bill mapping options + */ + async getBillOptions(requestParameters: GetMappingOptionsBillsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getMappingOptionsBillsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * List bill attachments + */ + private async listBillAttachmentsRaw(requestParameters: ListBillAttachmentsRequest, options?: runtime.RequestOptions): Promise>> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listBillAttachments().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling listBillAttachments().' + ); + } + + if (requestParameters['billId'] == null) { + throw new runtime.RequiredError( + 'billId', + 'Required parameter "billId" was null or undefined when calling listBillAttachments().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))), + method: 'GET', + operationId: 'list-bill-attachments', + errorStatuses: [401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response); + } + + /** + * The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * List bill attachments + */ + async listAttachments(requestParameters: ListBillAttachmentsRequest, options?: runtime.RequestOptions): Promise> { + const response = await this.listBillAttachmentsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company\'s connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. By default, the endpoint will return all bills with a status of \'Open\' & \'PartiallyPaid\' to show all oustanding bills. + * List bills + */ + private async listBillsRaw(requestParameters: ListBillsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listBills().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling listBills().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['continuationToken'] != null) { + queryParameters['continuationToken'] = requestParameters['continuationToken']; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'list-bills', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillsFromJSON(jsonValue)); + } + + /** + * The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company\'s connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. By default, the endpoint will return all bills with a status of \'Open\' & \'PartiallyPaid\' to show all oustanding bills. + * List bills + */ + async list(requestParameters: ListBillsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listBillsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company\'s connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | No | | Sage Intacct | No | | Zoho Books | No | + * Update bill + */ + private async updateBillRaw(requestParameters: UpdateBillRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateBill().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling updateBill().' + ); + } + + if (requestParameters['billId'] == null) { + throw new runtime.RequiredError( + 'billId', + 'Required parameter "billId" was null or undefined when calling updateBill().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['idempotencyKey'] != null) { + headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))), + method: 'PUT', + operationId: 'update-bill', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BillPrototypeToJSON(requestParameters['billPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillFromJSON(jsonValue)); + } + + /** + * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company\'s connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | No | | Sage Intacct | No | | Zoho Books | No | + * Update bill + */ + async update(requestParameters: UpdateBillRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateBillRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * Upload bill attachment + */ + private async uploadBillAttachmentRaw(requestParameters: UploadBillAttachmentRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling uploadBillAttachment().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling uploadBillAttachment().' + ); + } + + if (requestParameters['billId'] == null) { + throw new runtime.RequiredError( + 'billId', + 'Required parameter "billId" was null or undefined when calling uploadBillAttachment().' + ); + } + + if (requestParameters['file'] == null) { + throw new runtime.RequiredError( + 'file', + 'Required parameter "file" was null or undefined when calling uploadBillAttachment().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any, fileName?: string): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['file'] != null) { + const uploadFile: any = requestParameters['file']; + if (uploadFile && typeof uploadFile === 'object' && 'content' in uploadFile) { + const uploadBlob = new Blob([uploadFile.content], { type: getContentTypeFromFileName(uploadFile.fileName) }); + formParams.append('file', uploadBlob, uploadFile.fileName); + } else { + formParams.append('file', uploadFile as any); + } + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))), + method: 'POST', + operationId: 'upload-bill-attachment', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: formParams, + }, options); + + return new runtime.JSONApiResponse(response); + } + + /** + * The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB\'s financial obligations to their supplier for a purchase of goods or services. + * Upload bill attachment + */ + async uploadAttachment(requestParameters: UploadBillAttachmentRequest, options?: runtime.RequestOptions): Promise { + const response = await this.uploadBillAttachmentRaw(requestParameters, options); + return (await response.value()) as shared.Attachment; + } + +} + +function getContentTypeFromFileName(fileName: string): string { + const ext = (fileName || '').toLowerCase().split('.').pop(); + const mimeTypes: Record = { + json: 'application/json', xml: 'application/xml', html: 'text/html', htm: 'text/html', + txt: 'text/plain', csv: 'text/csv', pdf: 'application/pdf', png: 'image/png', + jpg: 'image/jpeg', jpeg: 'image/jpeg', gif: 'image/gif', svg: 'image/svg+xml', + js: 'application/javascript', css: 'text/css', zip: 'application/zip', tar: 'application/x-tar', + gz: 'application/gzip', mp4: 'video/mp4', mp3: 'audio/mpeg', wav: 'audio/wav', + webp: 'image/webp', ico: 'image/x-icon', woff: 'font/woff', woff2: 'font/woff2', + ttf: 'font/ttf', otf: 'font/otf', + }; + return (ext && mimeTypes[ext]) || 'application/octet-stream'; +} diff --git a/sync-for-payables/src/apis/Companies.ts b/sync-for-payables/src/apis/Companies.ts new file mode 100644 index 000000000..c8255a9eb --- /dev/null +++ b/sync-for-payables/src/apis/Companies.ts @@ -0,0 +1,338 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Company, + CompanyRequestBody, + CompanyUpdateRequest, + ErrorMessage, +} from '../sdk/models/index'; +import { + CompaniesFromJSON, + CompaniesToJSON, + CompanyFromJSON, + CompanyToJSON, + CompanyRequestBodyFromJSON, + CompanyRequestBodyToJSON, + CompanyUpdateRequestFromJSON, + CompanyUpdateRequestToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody; +} + +export interface DeleteCompanyRequest { + companyId: string; +} + +export interface GetCompanyRequest { + companyId: string; +} + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; +} + +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody; +} + +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest; +} + +/** + * + */ +export class Companies extends runtime.BaseAPI { + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. 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`. + * Create company + */ + private async createCompanyRaw(requestParameters: CreateCompanyRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'POST', + operationId: 'create-company', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. 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`. + * Create company + */ + async create(companyRequestBody?: CompanyRequestBody, options?: runtime.RequestOptions): Promise { + const response = await this.createCompanyRaw({ companyRequestBody: companyRequestBody }, options); + return await response.value(); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Delete a company + */ + private async deleteCompanyRaw(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'DELETE', + operationId: 'delete-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Delete a company + */ + async delete(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise { + await this.deleteCompanyRaw(requestParameters, options); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Get company + */ + private async getCompanyRaw(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Get company + */ + async get(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + private async listCompaniesRaw(requestParameters: ListCompaniesRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'GET', + operationId: 'list-companies', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompaniesFromJSON(jsonValue)); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + async list(requestParameters: ListCompaniesRequest = {}, options?: runtime.RequestOptions): Promise { + const response = await this.listCompaniesRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Replace company + */ + private async replaceCompanyRaw(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling replaceCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PUT', + operationId: 'replace-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Replace company + */ + async replace(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.replaceCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + private async updateCompanyRaw(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PATCH', + operationId: 'update-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyUpdateRequestToJSON(requestParameters['companyUpdateRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + async update(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateCompanyRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-payables/src/apis/CompanyInformation.ts b/sync-for-payables/src/apis/CompanyInformation.ts new file mode 100644 index 000000000..18d1fc809 --- /dev/null +++ b/sync-for-payables/src/apis/CompanyInformation.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + ErrorMessage, +} from '../sdk/models/index'; +import { + CompanyInformationFromJSON, + CompanyInformationToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface GetCompanyInformationRequest { + companyId: string; + connectionId: string; +} + +/** + * + */ +export class CompanyInformation extends runtime.BaseAPI { + + /** + * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + * Get company information + */ + private async getCompanyInformationRaw(requestParameters: GetCompanyInformationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyInformation().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCompanyInformation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/info`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-company-information', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyInformationFromJSON(jsonValue)); + } + + /** + * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + * Get company information + */ + async get(requestParameters: GetCompanyInformationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyInformationRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-payables/src/apis/Connections.ts b/sync-for-payables/src/apis/Connections.ts new file mode 100644 index 000000000..e41c89bbc --- /dev/null +++ b/sync-for-payables/src/apis/Connections.ts @@ -0,0 +1,324 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Connection, + CreateConnectionRequestBody, + ErrorMessage, + UpdateConnection, +} from '../sdk/models/index'; +import { + ConnectionFromJSON, + ConnectionToJSON, + ConnectionsFromJSON, + ConnectionsToJSON, + CreateConnectionRequestBodyFromJSON, + CreateConnectionRequestBodyToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + UpdateConnectionFromJSON, + UpdateConnectionToJSON, +} from '../sdk/models/index'; + +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody; +} + +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface GetConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + requestBody?: UpdateConnection; +} + +/** + * + */ +export class Connections extends runtime.BaseAPI { + + /** + * 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. + * Create connection + */ + private async createConnectionRaw(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateConnectionRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * 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. + * Create connection + */ + async create(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * 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. + * Delete connection + */ + private async deleteConnectionRaw(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling deleteConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'DELETE', + operationId: 'delete-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * 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. + * Delete connection + */ + async delete(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise { + await this.deleteConnectionRaw(requestParameters, options); + } + + /** + * 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. + * Get connection + */ + private async getConnectionRaw(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * 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. + * Get connection + */ + async get(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * List the connections for a company. + * List connections + */ + private async listConnectionsRaw(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listConnections().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-connections', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionsFromJSON(jsonValue)); + } + + /** + * List the connections for a company. + * List connections + */ + async list(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listConnectionsRaw(requestParameters, options); + return await response.value(); + } + + /** + * 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. + * Unlink connection + */ + private async unlinkConnectionRaw(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling unlinkConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling unlinkConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'PATCH', + operationId: 'unlink-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateConnectionToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * 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. + * Unlink connection + */ + async unlink(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.unlinkConnectionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-payables/src/apis/Suppliers.ts b/sync-for-payables/src/apis/Suppliers.ts new file mode 100644 index 000000000..be786520a --- /dev/null +++ b/sync-for-payables/src/apis/Suppliers.ts @@ -0,0 +1,229 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + ErrorMessage, + Supplier, + SupplierPrototype, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + SupplierFromJSON, + SupplierToJSON, + SupplierPrototypeFromJSON, + SupplierPrototypeToJSON, + SuppliersFromJSON, + SuppliersToJSON, +} from '../sdk/models/index'; + +export interface CreateSupplierRequest { + companyId: string; + connectionId: string; + idempotencyKey?: string; + supplierPrototype?: SupplierPrototype; +} + +export interface ListSuppliersRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + query?: string; +} + +export interface UpdateSupplierRequest { + companyId: string; + connectionId: string; + supplierId: string; + supplierPrototype?: SupplierPrototype; +} + +/** + * + */ +export class Suppliers extends runtime.BaseAPI { + + /** + * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Zoho Books | Yes | + * Create supplier + */ + private async createSupplierRaw(requestParameters: CreateSupplierRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createSupplier().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createSupplier().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['idempotencyKey'] != null) { + headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/suppliers`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-supplier', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SupplierPrototypeToJSON(requestParameters['supplierPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SupplierFromJSON(jsonValue)); + } + + /** + * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Zoho Books | Yes | + * Create supplier + */ + async create(requestParameters: CreateSupplierRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createSupplierRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Zoho Books | Yes | + * List suppliers + */ + private async listSuppliersRaw(requestParameters: ListSuppliersRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listSuppliers().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling listSuppliers().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['continuationToken'] != null) { + queryParameters['continuationToken'] = requestParameters['continuationToken']; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/suppliers`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'list-suppliers', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SuppliersFromJSON(jsonValue)); + } + + /** + * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Zoho Books | Yes | + * List suppliers + */ + async list(requestParameters: ListSuppliersRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listSuppliersRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. This is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | No | | Sage Intacct | No | | Zoho Books | No | ### Platform-specific behavior - **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating. - **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update. + * Update supplier + */ + private async updateSupplierRaw(requestParameters: UpdateSupplierRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateSupplier().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling updateSupplier().' + ); + } + + if (requestParameters['supplierId'] == null) { + throw new runtime.RequiredError( + 'supplierId', + 'Required parameter "supplierId" was null or undefined when calling updateSupplier().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/payables/suppliers/{supplierId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"supplierId"}}`, encodeURIComponent(String(requestParameters['supplierId']))), + method: 'PUT', + operationId: 'update-supplier', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SupplierPrototypeToJSON(requestParameters['supplierPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SupplierFromJSON(jsonValue)); + } + + /** + * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. This is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | | Oracle NetSuite | No | | Sage Intacct | No | | Zoho Books | No | ### Platform-specific behavior - **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating. - **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update. + * Update supplier + */ + async update(requestParameters: UpdateSupplierRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateSupplierRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-payables/src/apis/index.ts b/sync-for-payables/src/apis/index.ts new file mode 100644 index 000000000..5d414328a --- /dev/null +++ b/sync-for-payables/src/apis/index.ts @@ -0,0 +1,9 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './BankAccounts'; +export * from './BillPayments'; +export * from './Bills'; +export * from './Companies'; +export * from './CompanyInformation'; +export * from './Connections'; +export * from './Suppliers'; diff --git a/sync-for-payables/src/core.ts b/sync-for-payables/src/core.ts index 3ef31d337..543d99b44 100644 --- a/sync-for-payables/src/core.ts +++ b/sync-for-payables/src/core.ts @@ -1,13 +1,4 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { ClientSDK } from "./lib/sdks.js"; - -/** - * A minimal client to use when calling standalone SDK functions. Typically, an - * instance of this class would be instantiated once at the start of an - * application and passed around through some dependency injection mechanism to - * parts of an application that need to make SDK calls. - */ -export class CodatSyncPayablesCore extends ClientSDK {} +export { CodatSyncPayables, CodatSyncPayables as CodatSyncPayablesCore } from './sdk'; diff --git a/sync-for-payables/src/funcs/_adapter.ts b/sync-for-payables/src/funcs/_adapter.ts new file mode 100644 index 000000000..56e5acd53 --- /dev/null +++ b/sync-for-payables/src/funcs/_adapter.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ + +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; + +export async function toResult(call: () => Promise): Promise> { + try { + return OK(await call()); + } catch (err) { + return ERR(err instanceof Error ? err : new Error(String(err))); + } +} diff --git a/sync-for-payables/src/funcs/bankAccountsCreate.ts b/sync-for-payables/src/funcs/bankAccountsCreate.ts index c3ff3ed10..6b32e7b6d 100644 --- a/sync-for-payables/src/funcs/bankAccountsCreate.ts +++ b/sync-for-payables/src/funcs/bankAccountsCreate.ts @@ -1,216 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bank account - * - * @remarks - * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - */ -export function bankAccountsCreate( - client: CodatSyncPayablesCore, - request: operations.CreateBankAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BankAccount, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.CreateBankAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BankAccount, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateBankAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.bankAccountPrototype, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bankAccounts", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "Idempotency-Key": encodeSimple( - "Idempotency-Key", - payload["Idempotency-Key"], - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bank-account", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bankAccounts"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BankAccount, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.BankAccount$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function bankAccountsCreate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bankAccounts.create(request, options))); } diff --git a/sync-for-payables/src/funcs/billPaymentsCreate.ts b/sync-for-payables/src/funcs/billPaymentsCreate.ts index 882a67539..de947f173 100644 --- a/sync-for-payables/src/funcs/billPaymentsCreate.ts +++ b/sync-for-payables/src/funcs/billPaymentsCreate.ts @@ -1,221 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bill payment - * - * @remarks - * The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. - * - * [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. - */ -export function billPaymentsCreate( - client: CodatSyncPayablesCore, - request: operations.CreateBillPaymentRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BillPayment, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.CreateBillPaymentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BillPayment, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateBillPaymentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.billPaymentPrototype, { - explode: true, - }); - - const pathParams = { - billId: encodeSimple("billId", payload.billId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "Idempotency-Key": encodeSimple( - "Idempotency-Key", - payload["Idempotency-Key"], - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bill-payment", - oAuth2Scopes: null, +type Call = CodatSyncPayables["billPayments"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BillPayment, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.BillPayment$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billPaymentsCreate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.billPayments.create(request, options))); } diff --git a/sync-for-payables/src/funcs/billPaymentsGetPaymentOptions.ts b/sync-for-payables/src/funcs/billPaymentsGetPaymentOptions.ts index f042d24e9..f72d07bf9 100644 --- a/sync-for-payables/src/funcs/billPaymentsGetPaymentOptions.ts +++ b/sync-for-payables/src/funcs/billPaymentsGetPaymentOptions.ts @@ -1,217 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get payment mapping options - * - * @remarks - * Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID. - * - * By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - * - * Mapping options are a set of bank accounts used to configure the SMB's payables integration. - */ -export function billPaymentsGetPaymentOptions( - client: CodatSyncPayablesCore, - request: operations.GetMappingOptionsPaymentsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PaymentMappingOptions, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.GetMappingOptionsPaymentsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PaymentMappingOptions, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetMappingOptionsPaymentsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments", - )(pathParams); - - const query = encodeFormQuery({ - "continuationToken": payload.continuationToken, - "statusQuery": payload.statusQuery, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-mapping-options-payments", - oAuth2Scopes: null, +type Call = CodatSyncPayables["billPayments"]["getPaymentOptions"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PaymentMappingOptions, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PaymentMappingOptions$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billPaymentsGetPaymentOptions( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.billPayments.getPaymentOptions(request, options))); } diff --git a/sync-for-payables/src/funcs/billsCreate.ts b/sync-for-payables/src/funcs/billsCreate.ts index c84752311..c641af22b 100644 --- a/sync-for-payables/src/funcs/billsCreate.ts +++ b/sync-for-payables/src/funcs/billsCreate.ts @@ -1,215 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bill - * - * @remarks - * The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - */ -export function billsCreate( - client: CodatSyncPayablesCore, - request: operations.CreateBillRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Bill, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.CreateBillRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Bill, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateBillRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.billPrototype, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "Idempotency-Key": encodeSimple( - "Idempotency-Key", - payload["Idempotency-Key"], - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bill", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Bill, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.Bill$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsCreate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.create(request, options))); } diff --git a/sync-for-payables/src/funcs/billsDownloadAttachment.ts b/sync-for-payables/src/funcs/billsDownloadAttachment.ts index 475a3bbcd..060cdecfd 100644 --- a/sync-for-payables/src/funcs/billsDownloadAttachment.ts +++ b/sync-for-payables/src/funcs/billsDownloadAttachment.ts @@ -1,205 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Download bill attachment - * - * @remarks - * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - * - * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. - */ -export function billsDownloadAttachment( - client: CodatSyncPayablesCore, - request: operations.DownloadBillAttachmentRequest, - options?: RequestOptions, -): APIPromise< - Result< - ReadableStream, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.DownloadBillAttachmentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - ReadableStream, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.DownloadBillAttachmentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - attachmentId: encodeSimple("attachmentId", payload.attachmentId, { - explode: false, - charEncoding: "percent", - }), - billId: encodeSimple("billId", payload.billId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/octet-stream", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "download-bill-attachment", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["downloadAttachment"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - ReadableStream, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.stream(200, z.instanceof(ReadableStream)), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsDownloadAttachment( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.downloadAttachment(request, options))); } diff --git a/sync-for-payables/src/funcs/billsGetBillOptions.ts b/sync-for-payables/src/funcs/billsGetBillOptions.ts index cfe0b7655..939539194 100644 --- a/sync-for-payables/src/funcs/billsGetBillOptions.ts +++ b/sync-for-payables/src/funcs/billsGetBillOptions.ts @@ -1,217 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get bill mapping options - * - * @remarks - * Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company's connection ID. - * - * By default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - * - * Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. - */ -export function billsGetBillOptions( - client: CodatSyncPayablesCore, - request: operations.GetMappingOptionsBillsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BillMappingOptions, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.GetMappingOptionsBillsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BillMappingOptions, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetMappingOptionsBillsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills", - )(pathParams); - - const query = encodeFormQuery({ - "continuationToken": payload.continuationToken, - "statusQuery": payload.statusQuery, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-mapping-options-bills", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["getBillOptions"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BillMappingOptions, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.BillMappingOptions$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsGetBillOptions( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.getBillOptions(request, options))); } diff --git a/sync-for-payables/src/funcs/billsList.ts b/sync-for-payables/src/funcs/billsList.ts index e776abb6a..f6d99ce9e 100644 --- a/sync-for-payables/src/funcs/billsList.ts +++ b/sync-for-payables/src/funcs/billsList.ts @@ -1,217 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List bills - * - * @remarks - * The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - * - * By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. - */ -export function billsList( - client: CodatSyncPayablesCore, - request: operations.ListBillsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Bills, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.ListBillsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Bills, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListBillsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills", - )(pathParams); - - const query = encodeFormQuery({ - "continuationToken": payload.continuationToken, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-bills", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Bills, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Bills$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsList( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.list(request, options))); } diff --git a/sync-for-payables/src/funcs/billsListAttachments.ts b/sync-for-payables/src/funcs/billsListAttachments.ts index 7d43c85a4..cd81e739e 100644 --- a/sync-for-payables/src/funcs/billsListAttachments.ts +++ b/sync-for-payables/src/funcs/billsListAttachments.ts @@ -1,214 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List bill attachments - * - * @remarks - * The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - */ -export function billsListAttachments( - client: CodatSyncPayablesCore, - request: operations.ListBillAttachmentsRequest, - options?: RequestOptions, -): APIPromise< - Result< - Array, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.ListBillAttachmentsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - Array, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListBillAttachmentsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - billId: encodeSimple("billId", payload.billId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-bill-attachments", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["listAttachments"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - Array, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, z.array(shared.Attachment$inboundSchema)), - M.jsonErr( - [401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsListAttachments( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.listAttachments(request, options))); } diff --git a/sync-for-payables/src/funcs/billsUpdate.ts b/sync-for-payables/src/funcs/billsUpdate.ts index ffdf57fed..bb087bf01 100644 --- a/sync-for-payables/src/funcs/billsUpdate.ts +++ b/sync-for-payables/src/funcs/billsUpdate.ts @@ -1,230 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update bill - * - * @remarks - * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | No | - * | Sage Intacct | No | - * | Zoho Books | No | - */ -export function billsUpdate( - client: CodatSyncPayablesCore, - request: operations.UpdateBillRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Bill, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.UpdateBillRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Bill, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateBillRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.billPrototype, { explode: true }); - - const pathParams = { - billId: encodeSimple("billId", payload.billId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "Idempotency-Key": encodeSimple( - "Idempotency-Key", - payload["Idempotency-Key"], - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-bill", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Bill, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Bill$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsUpdate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.update(request, options))); } diff --git a/sync-for-payables/src/funcs/billsUploadAttachment.ts b/sync-for-payables/src/funcs/billsUploadAttachment.ts index 7472b6c41..7deeecb46 100644 --- a/sync-for-payables/src/funcs/billsUploadAttachment.ts +++ b/sync-for-payables/src/funcs/billsUploadAttachment.ts @@ -1,251 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { appendForm, encodeSimple, normalizeBlob } from "../lib/encodings.js"; -import { - bytesToBlob, - getContentTypeFromFileName, - readableStreamToArrayBuffer, -} from "../lib/files.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { isBlobLike } from "../sdk/types/blobs.js"; -import { Result } from "../sdk/types/fp.js"; -import { isReadableStream } from "../sdk/types/streams.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Upload bill attachment - * - * @remarks - * The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - */ -export function billsUploadAttachment( - client: CodatSyncPayablesCore, - request: operations.UploadBillAttachmentRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Attachment, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.UploadBillAttachmentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Attachment, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UploadBillAttachmentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = new FormData(); - if (payload.AttachmentUpload != null) { - if (isBlobLike(payload.AttachmentUpload.file)) { - const file = payload.AttachmentUpload.file; - const blob = await normalizeBlob(file); - const name = "name" in file ? (file.name as string) : undefined; - appendForm(body, "file", blob, name); - } else if (isReadableStream(payload.AttachmentUpload.file.content)) { - const buffer = await readableStreamToArrayBuffer( - payload.AttachmentUpload.file.content, - ); - const contentType = - getContentTypeFromFileName(payload.AttachmentUpload.file.fileName) - || "application/octet-stream"; - appendForm( - body, - "file", - bytesToBlob(buffer, contentType), - payload.AttachmentUpload.file.fileName, - ); - } else { - const contentType = - getContentTypeFromFileName(payload.AttachmentUpload.file.fileName) - || "application/octet-stream"; - appendForm( - body, - "file", - bytesToBlob(payload.AttachmentUpload.file.content, contentType), - payload.AttachmentUpload.file.fileName, - ); - } - } - - const pathParams = { - billId: encodeSimple("billId", payload.billId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "upload-bill-attachment", - oAuth2Scopes: null, +type Call = CodatSyncPayables["bills"]["uploadAttachment"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Attachment, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.Attachment$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function billsUploadAttachment( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bills.uploadAttachment(request, options))); } diff --git a/sync-for-payables/src/funcs/companiesCreate.ts b/sync-for-payables/src/funcs/companiesCreate.ts index 3088009cb..fef34a4be 100644 --- a/sync-for-payables/src/funcs/companiesCreate.ts +++ b/sync-for-payables/src/funcs/companiesCreate.ts @@ -1,187 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * 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`. - */ -export function companiesCreate( - client: CodatSyncPayablesCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => shared.CompanyRequestBody$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/companies")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-company", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companies"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "402", "403", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesCreate( + client: CodatSyncPayablesCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.create(request, options))); } diff --git a/sync-for-payables/src/funcs/companiesDelete.ts b/sync-for-payables/src/funcs/companiesDelete.ts index 150318df2..3d6151f8c 100644 --- a/sync-for-payables/src/funcs/companiesDelete.ts +++ b/sync-for-payables/src/funcs/companiesDelete.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesDelete( - client: CodatSyncPayablesCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-company", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companies"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesDelete( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.delete(request, options))); } diff --git a/sync-for-payables/src/funcs/companiesGet.ts b/sync-for-payables/src/funcs/companiesGet.ts index a951fc733..9f48cf0f0 100644 --- a/sync-for-payables/src/funcs/companiesGet.ts +++ b/sync-for-payables/src/funcs/companiesGet.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesGet( - client: CodatSyncPayablesCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companies"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGet( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.get(request, options))); } diff --git a/sync-for-payables/src/funcs/companiesList.ts b/sync-for-payables/src/funcs/companiesList.ts index 647b990e9..c4df464ba 100644 --- a/sync-for-payables/src/funcs/companiesList.ts +++ b/sync-for-payables/src/funcs/companiesList.ts @@ -1,220 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ -export function companiesList( - client: CodatSyncPayablesCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Companies, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Companies, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListCompaniesRequest$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/companies")(); - - const query = encodeFormQuery({ - "orderBy": payload?.orderBy, - "page": payload?.page, - "pageSize": payload?.pageSize, - "query": payload?.query, - "tags": payload?.tags, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-companies", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companies"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Companies, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Companies$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesList( + client: CodatSyncPayablesCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.list(request, options))); } diff --git a/sync-for-payables/src/funcs/companiesReplace.ts b/sync-for-payables/src/funcs/companiesReplace.ts index 5e270df40..3f991771b 100644 --- a/sync-for-payables/src/funcs/companiesReplace.ts +++ b/sync-for-payables/src/funcs/companiesReplace.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesReplace( - client: CodatSyncPayablesCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ReplaceCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyRequestBody, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "replace-company", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companies"]["replace"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesReplace( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.replace(request, options))); } diff --git a/sync-for-payables/src/funcs/companiesUpdate.ts b/sync-for-payables/src/funcs/companiesUpdate.ts index 6d55577b2..0bffd3d16 100644 --- a/sync-for-payables/src/funcs/companiesUpdate.ts +++ b/sync-for-payables/src/funcs/companiesUpdate.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - */ -export function companiesUpdate( - client: CodatSyncPayablesCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyUpdateRequest, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-company", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companies"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesUpdate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.update(request, options))); } diff --git a/sync-for-payables/src/funcs/companyInformationGet.ts b/sync-for-payables/src/funcs/companyInformationGet.ts index 7b50da07c..8d1f34d81 100644 --- a/sync-for-payables/src/funcs/companyInformationGet.ts +++ b/sync-for-payables/src/funcs/companyInformationGet.ts @@ -1,207 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company information - * - * @remarks - * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. - */ -export function companyInformationGet( - client: CodatSyncPayablesCore, - request: operations.GetCompanyInformationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.GetCompanyInformationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyInformationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/info", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-information", - oAuth2Scopes: null, +type Call = CodatSyncPayables["companyInformation"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyInformation$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companyInformationGet( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companyInformation.get(request, options))); } diff --git a/sync-for-payables/src/funcs/connectionsCreate.ts b/sync-for-payables/src/funcs/connectionsCreate.ts index f49a47f9c..3f832b241 100644 --- a/sync-for-payables/src/funcs/connectionsCreate.ts +++ b/sync-for-payables/src/funcs/connectionsCreate.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create connection - * - * @remarks - * 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. - */ -export function connectionsCreate( - client: CodatSyncPayablesCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-connection", - oAuth2Scopes: null, +type Call = CodatSyncPayables["connections"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsCreate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.create(request, options))); } diff --git a/sync-for-payables/src/funcs/connectionsDelete.ts b/sync-for-payables/src/funcs/connectionsDelete.ts index 55d0f7f67..e537d1334 100644 --- a/sync-for-payables/src/funcs/connectionsDelete.ts +++ b/sync-for-payables/src/funcs/connectionsDelete.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete connection - * - * @remarks - * 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. - */ -export function connectionsDelete( - client: CodatSyncPayablesCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-connection", - oAuth2Scopes: null, +type Call = CodatSyncPayables["connections"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(200, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsDelete( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.delete(request, options))); } diff --git a/sync-for-payables/src/funcs/connectionsGet.ts b/sync-for-payables/src/funcs/connectionsGet.ts index 972e33289..3cb1bbb6c 100644 --- a/sync-for-payables/src/funcs/connectionsGet.ts +++ b/sync-for-payables/src/funcs/connectionsGet.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get connection - * - * @remarks - * 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. - */ -export function connectionsGet( - client: CodatSyncPayablesCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-connection", - oAuth2Scopes: null, +type Call = CodatSyncPayables["connections"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsGet( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.get(request, options))); } diff --git a/sync-for-payables/src/funcs/connectionsList.ts b/sync-for-payables/src/funcs/connectionsList.ts index 1e7d60812..d8445b4fe 100644 --- a/sync-for-payables/src/funcs/connectionsList.ts +++ b/sync-for-payables/src/funcs/connectionsList.ts @@ -1,208 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List connections - * - * @remarks - * List the connections for a company. - */ -export function connectionsList( - client: CodatSyncPayablesCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connections, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connections, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListConnectionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-connections", - oAuth2Scopes: null, +type Call = CodatSyncPayables["connections"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connections, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connections$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsList( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.list(request, options))); } diff --git a/sync-for-payables/src/funcs/connectionsUnlink.ts b/sync-for-payables/src/funcs/connectionsUnlink.ts index 0dc33eb10..22df0c445 100644 --- a/sync-for-payables/src/funcs/connectionsUnlink.ts +++ b/sync-for-payables/src/funcs/connectionsUnlink.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Unlink connection - * - * @remarks - * 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. - */ -export function connectionsUnlink( - client: CodatSyncPayablesCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UnlinkConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "unlink-connection", - oAuth2Scopes: null, +type Call = CodatSyncPayables["connections"]["unlink"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsUnlink( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.unlink(request, options))); } diff --git a/sync-for-payables/src/funcs/suppliersCreate.ts b/sync-for-payables/src/funcs/suppliersCreate.ts index 0d8100cb6..c11cba925 100644 --- a/sync-for-payables/src/funcs/suppliersCreate.ts +++ b/sync-for-payables/src/funcs/suppliersCreate.ts @@ -1,225 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create supplier - * - * @remarks - * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Zoho Books | Yes | - */ -export function suppliersCreate( - client: CodatSyncPayablesCore, - request: operations.CreateSupplierRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.CreateSupplierRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateSupplierRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.supplierPrototype, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/suppliers", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "Idempotency-Key": encodeSimple( - "Idempotency-Key", - payload["Idempotency-Key"], - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-supplier", - oAuth2Scopes: null, +type Call = CodatSyncPayables["suppliers"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.Supplier$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersCreate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.create(request, options))); } diff --git a/sync-for-payables/src/funcs/suppliersList.ts b/sync-for-payables/src/funcs/suppliersList.ts index df736ae44..03b9c1842 100644 --- a/sync-for-payables/src/funcs/suppliersList.ts +++ b/sync-for-payables/src/funcs/suppliersList.ts @@ -1,230 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List suppliers - * - * @remarks - * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - * - * For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Zoho Books | Yes | - */ -export function suppliersList( - client: CodatSyncPayablesCore, - request: operations.ListSuppliersRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Suppliers, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.ListSuppliersRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Suppliers, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListSuppliersRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/suppliers", - )(pathParams); - - const query = encodeFormQuery({ - "continuationToken": payload.continuationToken, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-suppliers", - oAuth2Scopes: null, +type Call = CodatSyncPayables["suppliers"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Suppliers, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Suppliers$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersList( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.list(request, options))); } diff --git a/sync-for-payables/src/funcs/suppliersUpdate.ts b/sync-for-payables/src/funcs/suppliersUpdate.ts index 129cccdae..4533b7006 100644 --- a/sync-for-payables/src/funcs/suppliersUpdate.ts +++ b/sync-for-payables/src/funcs/suppliersUpdate.ts @@ -1,231 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncPayables, CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update supplier - * - * @remarks - * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * This is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | No | - * | Sage Intacct | No | - * | Zoho Books | No | - * - * ### Platform-specific behavior - * - * - **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating. - * - **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update. - */ -export function suppliersUpdate( - client: CodatSyncPayablesCore, - request: operations.UpdateSupplierRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncPayablesCore, - request: operations.UpdateSupplierRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateSupplierRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.supplierPrototype, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - supplierId: encodeSimple("supplierId", payload.supplierId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/payables/suppliers/{supplierId}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-supplier", - oAuth2Scopes: null, +type Call = CodatSyncPayables["suppliers"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncPayablesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Supplier$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersUpdate( + client: CodatSyncPayablesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.update(request, options))); } diff --git a/sync-for-payables/src/funcs/validateWebhook.ts b/sync-for-payables/src/funcs/validateWebhook.ts index 8c4d3a6bd..bc3f6044e 100644 --- a/sync-for-payables/src/funcs/validateWebhook.ts +++ b/sync-for-payables/src/funcs/validateWebhook.ts @@ -1,58 +1,72 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodatSyncPayablesCore } from "../core.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { ERR, Result } from "../sdk/types/fp.js"; - -export async function validateWebhook(_client: CodatSyncPayablesCore, { - request: rawRequest, -}: { - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request; -}): Promise< - Result -> { - const request = normalizeRequest(rawRequest); - const knownSchemas = [ - shared.clientRateLimitWebhookFromJSON, - shared.clientRateLimitWebhookFromJSON, - ]; - - const jsonString = await request.text(); - - for (const schema of knownSchemas) { - const ret = schema(jsonString); - if (ret.ok) { - return ret; +/* tslint:disable */ +/* eslint-disable */ + +import type { CodatSyncPayablesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror"; +import type * as shared from "../sdk/models/index"; + +type ValidateWebhookResult = shared.ClientRateLimitWebhook | undefined; + +type WebhookMatchSpec = + | "string" + | "number" + | "boolean" + | "any" + | { kind: "nullable"; inner: WebhookMatchSpec } + | { kind: "array"; items: WebhookMatchSpec } + | { kind: "object"; required: string[]; props: Record }; + +function conformsToWebhookSpec(value: unknown, spec: WebhookMatchSpec): boolean { + if (spec === "any") { return true; } + if (spec === "string") { return typeof value === "string"; } + if (spec === "number") { return typeof value === "number"; } + if (spec === "boolean") { return typeof value === "boolean"; } + if (spec.kind === "nullable") { return value === null || conformsToWebhookSpec(value, spec.inner); } + if (spec.kind === "array") { return Array.isArray(value) && value.every((item) => conformsToWebhookSpec(item, spec.items)); } + if (value === null || typeof value !== "object" || Array.isArray(value)) { return false; } + const object = value as Record; + for (const key of spec.required) { + if (object[key] === undefined) { return false; } + } + for (const key of Object.keys(spec.props)) { + if (object[key] === undefined) { continue; } + if (!conformsToWebhookSpec(object[key], spec.props[key])) { return false; } } - } - - return ERR( - new SDKValidationError( - "No matching schema found for the given webhook payload", - jsonString, - jsonString, - ), - ); + return true; } -function normalizeRequest( - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request, +function normalizeWebhookRequest( + request: { body: string; method: string; url: string; headers: Record | Headers } | Request, ): Request { - if (request instanceof Request) { - return request; - } - return new Request(request.url, request); + if (typeof Request !== "undefined" && request instanceof Request) { return request; } + return new Request(request.url, request); +} + +const WEBHOOK_NO_MATCH_MESSAGE = "No matching schema found for the given webhook payload"; + +const WEBHOOK_MATCH_ORDER: { name: string; spec: WebhookMatchSpec }[] = [ + { name: "ClientRateLimitWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"dailyQuota": "number", "quotaRemaining": "number", "expiryDate": "string"}}}} } +]; + +export function validateWebhook(_client: CodatSyncPayablesCore, { request }: { request: { body: string; method: string; url: string; headers: Record | Headers } | Request }): APIPromise> { + void _client; + return new APIPromise((async (): Promise> => { + const normalized = normalizeWebhookRequest(request); + const jsonString = await normalized.text(); + let parsed: unknown; + try { + parsed = JSON.parse(jsonString); + } catch { + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + } + for (const member of WEBHOOK_MATCH_ORDER) { + if (conformsToWebhookSpec(parsed, member.spec)) { + return OK(parsed as ValidateWebhookResult); + } + } + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + })()); } diff --git a/sync-for-payables/src/hooks/hooks.ts b/sync-for-payables/src/hooks/hooks.ts index d34c88497..b628a2bf8 100644 --- a/sync-for-payables/src/hooks/hooks.ts +++ b/sync-for-payables/src/hooks/hooks.ts @@ -1,132 +1,75 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { RequestInput } from "../lib/http.js"; import { - AfterErrorContext, - AfterErrorHook, - AfterSuccessContext, - AfterSuccessHook, - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, - Hook, - Hooks, - SDKInitHook, - SDKInitOptions, -} from "./types.js"; - -import { initHooks } from "./registration.js"; + AfterErrorContext, AfterErrorHook, AfterSuccessContext, AfterSuccessHook, + BeforeCreateRequestContext, BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, +} from "./types"; +import { RequestInput } from "../lib/sdkconfig"; +import { initHooks } from "./registration"; export class SDKHooks implements Hooks { - sdkInitHooks: SDKInitHook[] = []; - beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; - beforeRequestHooks: BeforeRequestHook[] = []; - afterSuccessHooks: AfterSuccessHook[] = []; - afterErrorHooks: AfterErrorHook[] = []; - - constructor() { - const presetHooks: Array = []; - - for (const hook of presetHooks) { - if ("sdkInit" in hook) { - this.registerSDKInitHook(hook); - } - if ("beforeCreateRequest" in hook) { - this.registerBeforeCreateRequestHook(hook); - } - if ("beforeRequest" in hook) { - this.registerBeforeRequestHook(hook); - } - if ("afterSuccess" in hook) { - this.registerAfterSuccessHook(hook); - } - if ("afterError" in hook) { - this.registerAfterErrorHook(hook); - } + sdkInitHooks: SDKInitHook[] = []; + beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() { + const presetHooks: Array = []; + for (const hook of presetHooks) { + if ("sdkInit" in hook) { this.registerSDKInitHook(hook); } + if ("beforeCreateRequest" in hook) { this.registerBeforeCreateRequestHook(hook); } + if ("beforeRequest" in hook) { this.registerBeforeRequestHook(hook); } + if ("afterSuccess" in hook) { this.registerAfterSuccessHook(hook); } + if ("afterError" in hook) { this.registerAfterErrorHook(hook); } + } + initHooks(this); } - initHooks(this); - } - - registerSDKInitHook(hook: SDKInitHook) { - this.sdkInitHooks.push(hook); - } - - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { - this.beforeCreateRequestHooks.push(hook); - } - - registerBeforeRequestHook(hook: BeforeRequestHook) { - this.beforeRequestHooks.push(hook); - } - - registerAfterSuccessHook(hook: AfterSuccessHook) { - this.afterSuccessHooks.push(hook); - } - - registerAfterErrorHook(hook: AfterErrorHook) { - this.afterErrorHooks.push(hook); - } - sdkInit(opts: SDKInitOptions): SDKInitOptions { - return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); - } + registerSDKInitHook(hook: SDKInitHook) { this.sdkInitHooks.push(hook); } + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { this.beforeCreateRequestHooks.push(hook); } + registerBeforeRequestHook(hook: BeforeRequestHook) { this.beforeRequestHooks.push(hook); } + registerAfterSuccessHook(hook: AfterSuccessHook) { this.afterSuccessHooks.push(hook); } + registerAfterErrorHook(hook: AfterErrorHook) { this.afterErrorHooks.push(hook); } - beforeCreateRequest( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ): RequestInput { - let inp = input; - - for (const hook of this.beforeCreateRequestHooks) { - inp = hook.beforeCreateRequest(hookCtx, inp); + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((o, hook) => hook.sdkInit(o), opts); } - return inp; - } - - async beforeRequest( - hookCtx: BeforeRequestContext, - request: Request, - ): Promise { - let req = request; - - for (const hook of this.beforeRequestHooks) { - req = await hook.beforeRequest(hookCtx, req); + beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput { + let inp = input; + for (const hook of this.beforeCreateRequestHooks) { + inp = hook.beforeCreateRequest(hookCtx, inp); + } + return inp; } - return req; - } - - async afterSuccess( - hookCtx: AfterSuccessContext, - response: Response, - ): Promise { - let res = response; - - for (const hook of this.afterSuccessHooks) { - res = await hook.afterSuccess(hookCtx, res); + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + return req; } - return res; - } - - async afterError( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ): Promise<{ response: Response | null; error: unknown }> { - let res = response; - let err = error; - - for (const hook of this.afterErrorHooks) { - const result = await hook.afterError(hookCtx, res, err); - res = result.response; - err = result.error; + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + return res; } - return { response: res, error: err }; - } + async afterError(hookCtx: AfterErrorContext, response: Response | null, error: unknown): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + return { response: res, error: err }; + } } diff --git a/sync-for-payables/src/hooks/index.ts b/sync-for-payables/src/hooks/index.ts index f60ec7acd..ae868065a 100644 --- a/sync-for-payables/src/hooks/index.ts +++ b/sync-for-payables/src/hooks/index.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./hooks.js"; -export * from "./types.js"; +export * from "./hooks"; +export * from "./types"; diff --git a/sync-for-payables/src/hooks/types.ts b/sync-for-payables/src/hooks/types.ts index 494395f66..3818216a1 100644 --- a/sync-for-payables/src/hooks/types.ts +++ b/sync-for-payables/src/hooks/types.ts @@ -1,29 +1,23 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { SDKOptions } from "../lib/config.js"; -import { HTTPClient, RequestInput } from "../lib/http.js"; -import { RetryConfig } from "../lib/retries.js"; -import { SecurityState } from "../lib/security.js"; -import { WebhookRecipient } from "../sdk/types/webhooks.js"; +import { SDKOptions, RetryConfig, HTTPClient, RequestInput, SecurityState } from "../lib/sdkconfig"; + +export type Awaitable = T | Promise; export type HookContext = { - baseURL: string | URL; - operationID: string; - oAuth2Scopes: string[] | null; - webhookRecipient?: WebhookRecipient; - securitySource?: any | (() => Promise); - retryConfig: RetryConfig; - resolvedSecurity: SecurityState | null; - options: SDKOptions; + baseURL: string | URL; + operationID: string; + oAuth2Scopes: string[] | null; + securitySource?: unknown | (() => Promise); + retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; + options: SDKOptions; }; -export type Awaitable = T | Promise; - export type SDKInitOptions = { - baseURL: URL | null; - client: HTTPClient; + baseURL: URL | null; + client: HTTPClient; }; export type BeforeCreateRequestContext = HookContext & {}; @@ -31,84 +25,37 @@ export type BeforeRequestContext = HookContext & {}; export type AfterSuccessContext = HookContext & {}; export type AfterErrorContext = HookContext & {}; -/** - * SDKInitHook is called when the SDK is initializing. The - * hook can return a new baseURL and HTTP client to be used by the SDK. - */ export interface SDKInitHook { - sdkInit: (opts: SDKInitOptions) => SDKInitOptions; + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; } export interface BeforeCreateRequestHook { - /** - * A hook that is called before the SDK creates a `Request` object. The hook - * can modify how a request is constructed since certain modifications, like - * changing the request URL, cannot be done on a request object directly. - */ - beforeCreateRequest: ( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ) => RequestInput; + beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; } export interface BeforeRequestHook { - /** - * A hook that is called before the SDK sends a request. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * replace the request before it is sent or throw an error to stop the - * request from being sent. - */ - beforeRequest: ( - hookCtx: BeforeRequestContext, - request: Request, - ) => Awaitable; + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; } export interface AfterSuccessHook { - /** - * A hook that is called after the SDK receives a response. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * modify the response before it is handled or throw an error to stop the - * response from being handled. - */ - afterSuccess: ( - hookCtx: AfterSuccessContext, - response: Response, - ) => Awaitable; + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; } export interface AfterErrorHook { - /** - * A hook that is called after the SDK encounters an error, or a - * non-successful response. The hook can introduce instrumentation code such - * as logging, tracing and metrics or modify the response or error values. - */ - afterError: ( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ) => Awaitable<{ - response: Response | null; - error: unknown; - }>; + afterError: (hookCtx: AfterErrorContext, response: Response | null, error: unknown) => Awaitable<{ response: Response | null; error: unknown }>; } export interface Hooks { - /** Registers a hook to be used by the SDK for initialization event. */ - registerSDKInitHook(hook: SDKInitHook): void; - /** Registers a hook to be used by the SDK for to modify `Request` construction. */ - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; - /** Registers a hook to be used by the SDK for the before request event. */ - registerBeforeRequestHook(hook: BeforeRequestHook): void; - /** Registers a hook to be used by the SDK for the after success event. */ - registerAfterSuccessHook(hook: AfterSuccessHook): void; - /** Registers a hook to be used by the SDK for the after error event. */ - registerAfterErrorHook(hook: AfterErrorHook): void; + registerSDKInitHook(hook: SDKInitHook): void; + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; + registerBeforeRequestHook(hook: BeforeRequestHook): void; + registerAfterSuccessHook(hook: AfterSuccessHook): void; + registerAfterErrorHook(hook: AfterErrorHook): void; } export type Hook = - | SDKInitHook - | BeforeCreateRequestHook - | BeforeRequestHook - | AfterSuccessHook - | AfterErrorHook; + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/sync-for-payables/src/index.ts b/sync-for-payables/src/index.ts index dbcba164a..52b74ba06 100644 --- a/sync-for-payables/src/index.ts +++ b/sync-for-payables/src/index.ts @@ -1,9 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./lib/config.js"; -export * as files from "./lib/files.js"; -export { HTTPClient } from "./lib/http.js"; -export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; -export * from "./sdk/sdk.js"; +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './sdk/models/index'; +export * from './sdk/types/rfcdate'; +export * from './sdk'; +export * from './lib/sdkconfig'; diff --git a/sync-for-payables/src/lib/base64.ts b/sync-for-payables/src/lib/base64.ts deleted file mode 100644 index 0aebd8b0a..000000000 --- a/sync-for-payables/src/lib/base64.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function bytesToBase64(u8arr: Uint8Array): string { - return btoa(String.fromCodePoint(...u8arr)); -} - -export function bytesFromBase64(encoded: string): Uint8Array { - return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); -} - -export function stringToBytes(str: string): Uint8Array { - return new TextEncoder().encode(str); -} - -export function stringFromBytes(u8arr: Uint8Array): string { - return new TextDecoder().decode(u8arr); -} - -export function stringToBase64(str: string): string { - return bytesToBase64(stringToBytes(str)); -} - -export function stringFromBase64(b64str: string): string { - return stringFromBytes(bytesFromBase64(b64str)); -} - -export const zodOutbound = z - .instanceof(Uint8Array) - .or(z.string().transform(stringToBytes)); - -export const zodInbound = z - .instanceof(Uint8Array) - .or(z.string().transform(bytesFromBase64)); diff --git a/sync-for-payables/src/lib/config.ts b/sync-for-payables/src/lib/config.ts index 13702fa82..416844419 100644 --- a/sync-for-payables/src/lib/config.ts +++ b/sync-for-payables/src/lib/config.ts @@ -1,68 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { HTTPClient } from "./http.js"; -import { Logger } from "./logger.js"; -import { RetryConfig } from "./retries.js"; -import { Params, pathToFunc } from "./url.js"; - -/** - * Contains the list of servers available to the SDK - */ -export const ServerList = [ - /** - * Production - */ - "https://api.codat.io", -] as const; - -export type SDKOptions = { - authHeader?: string | (() => Promise) | undefined; - - httpClient?: HTTPClient; - /** - * Allows overriding the default server used by the SDK - */ - serverIdx?: number | undefined; - /** - * Allows overriding the default server URL used by the SDK - */ - serverURL?: string | undefined; - /** - * Allows overriding the default user agent used by the SDK - */ - userAgent?: string | undefined; - /** - * Allows overriding the default retry config used by the SDK - */ - retryConfig?: RetryConfig; - timeoutMs?: number; - debugLogger?: Logger; -}; - -export function serverURLFromOptions(options: SDKOptions): URL | null { - let serverURL = options.serverURL; - - const params: Params = {}; - - if (!serverURL) { - const serverIdx = options.serverIdx ?? 0; - if (serverIdx < 0 || serverIdx >= ServerList.length) { - throw new Error(`Invalid server index ${serverIdx}`); - } - serverURL = ServerList[serverIdx] || ""; - } - - const u = pathToFunc(serverURL)(params); - return new URL(u); +export function serverURLFromOptions(options: unknown): string { + void options; + return ""; } - -export const SDK_METADATA = { - language: "typescript", - openapiDocVersion: "3.0.0", - sdkVersion: "9.3.2", - genVersion: "2.879.13", - userAgent: - "speakeasy-sdk/typescript 9.3.2 2.879.13 3.0.0 @codat/sync-for-payables", -} as const; diff --git a/sync-for-payables/src/lib/dlv.ts b/sync-for-payables/src/lib/dlv.ts deleted file mode 100644 index e81091f5e..000000000 --- a/sync-for-payables/src/lib/dlv.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) 2024 Jason Miller (http://jasonformat.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/** - * @param obj The object to walk - * @param key The key path to walk the object with - * @param def A default value to return if the result is undefined - * - * @example - * dlv(obj, "a.b.c.d") - * @example - * dlv(object, ["a", "b", "c", "d"]) - * @example - * dlv(object, "foo.bar.baz", "Hello, default value!") - */ -export function dlv( - obj: any, - key: string | string[], - def?: T, - p?: number, - undef?: never, -): T | undefined { - key = Array.isArray(key) ? key : key.split("."); - for (p = 0; p < key.length; p++) { - const k = key[p]; - obj = k != null && obj ? obj[k] : undef; - } - return obj === undef ? def : obj; -} diff --git a/sync-for-payables/src/lib/encodings.ts b/sync-for-payables/src/lib/encodings.ts deleted file mode 100644 index 2791d25bc..000000000 --- a/sync-for-payables/src/lib/encodings.ts +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bytesToBase64 } from "./base64.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export class EncodingError extends Error { - constructor(message: string) { - super(message); - this.name = "EncodingError"; - } -} - -export function encodeMatrix( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - const keyPrefix = encodeString(pk); - tmp = `${keyPrefix}=${encValue}`; - // trim trailing '=' if value was empty - if (tmp === `${keyPrefix}=`) { - tmp = tmp.slice(0, -1); - } - - // If we end up with the nothing then skip forward - if (!tmp) { - return; - } - - out += `;${tmp}`; - }); - - return out; -} - -export function encodeLabel( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let encValue: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `.${encodeString(k)}.${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) - ? `${encodeString(pk)}=` - : ""; - encValue = `${k}${encodeValue(pv)}`; - } - - out += encValue == null ? "" : `.${encValue}`; - }); - - return out; -} - -type FormEncoder = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string | undefined; - -function formEncoder(sep: string): FormEncoder { - return ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, - ) => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - const encodedSep = encodeString(sep); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep); - } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; - })?.join(encodedSep); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); - }; -} - -export const encodeForm = formEncoder(","); -export const encodeSpaceDelimited = formEncoder(" "); -export const encodePipeDelimited = formEncoder("|"); - -export function encodeBodyForm( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else if (isPlainObject(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else { - encValue = `${encodeValue(pv)}`; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); -} - -export function encodeDeepObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, - ); - } - - return encodeDeepObjectObject(key, value, options); -} - -export function encodeDeepObjectObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - let out = ""; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - if (!isPlainObject(value)) { - throw new EncodingError(`Expected parameter '${key}' to be an object.`); - } - - Object.entries(value).forEach(([ck, cv]) => { - if (cv == null) { - return; - } - - const pk = `${key}[${ck}]`; - - if (isPlainObject(cv)) { - const objOut = encodeDeepObjectObject(pk, cv, options); - - out += objOut == null ? "" : `&${objOut}`; - - return; - } - - const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - const encoded = mapDefined(pairs, (v) => { - return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - })?.join("&"); - - out += encoded == null ? "" : `&${encoded}`; - }); - - return out.slice(1); -} - -export function encodeJSON( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - if (typeof value === "undefined") { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encVal = encodeString(JSON.stringify(value, jsonReplacer)); - - return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; -} - -export const encodeSimple = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - tmp = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; - tmp = `${k}${encodeValue(pv)}`; - } - - out += tmp ? `,${tmp}` : ""; - }); - - return out.slice(1); -}; - -function explode(key: string, value: unknown): [string, unknown][] { - if (Array.isArray(value)) { - return value.map((v) => [key, v]); - } else if (isPlainObject(value)) { - const o = value ?? {}; - return Object.entries(o).map(([k, v]) => [k, v]); - } else { - return [[key, value]]; - } -} - -function serializeValue(value: unknown): string { - if (value == null) { - return ""; - } else if (value instanceof Date) { - return value.toISOString(); - } else if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else if (typeof value === "object") { - return JSON.stringify(value, jsonReplacer); - } - - return `${value}`; -} - -function jsonReplacer(_: string, value: unknown): unknown { - if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else { - return value; - } -} - -function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null { - const res = inp.reduce((acc, v) => { - if (v == null) { - return acc; - } - - const m = mapper(v); - if (m == null) { - return acc; - } - - acc.push(m); - - return acc; - }, []); - - return res.length ? res : null; -} - -function mapDefinedEntries( - inp: Iterable<[K, V]>, - mapper: (v: [K, V]) => R, -): R[] | null { - const acc: R[] = []; - for (const [k, v] of inp) { - if (v == null) { - continue; - } - - const m = mapper([k, v]); - if (m == null) { - continue; - } - - acc.push(m); - } - - return acc.length ? acc : null; -} - -export function queryJoin(...args: (string | undefined)[]): string { - return args.filter(Boolean).join("&"); -} - -type QueryEncoderOptions = { - explode?: boolean; - charEncoding?: "percent" | "none"; - allowEmptyValue?: string[]; -}; - -type QueryEncoder = ( - key: string, - value: unknown, - options?: QueryEncoderOptions, -) => string | undefined; - -type BulkQueryEncoder = ( - values: Record, - options?: QueryEncoderOptions, -) => string; - -export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { - const bulkEncode = function( - values: Record, - options?: QueryEncoderOptions, - ): string { - const opts: QueryEncoderOptions = { - ...options, - explode: options?.explode ?? true, - charEncoding: options?.charEncoding ?? "percent", - }; - - const allowEmptySet = new Set(options?.allowEmptyValue ?? []); - - const encoded = Object.entries(values).map(([key, value]) => { - if (allowEmptySet.has(key)) { - if ( - value === undefined - || value === null - || value === "" - || (Array.isArray(value) && value.length === 0) - ) { - return `${encodeURIComponent(key)}=`; - } - } - return f(key, value, opts); - }); - return queryJoin(...encoded); - }; - - return bulkEncode; -} - -export const encodeJSONQuery = queryEncoder(encodeJSON); -export const encodeFormQuery = queryEncoder(encodeForm); -export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); -export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); -export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); - -function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const tag = val[Symbol.toStringTag]; - if (tag !== "Blob" && tag !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} - -export function appendForm( - fd: FormData, - key: string, - value: unknown, - fileName?: string, -): void { - if (value == null) { - return; - } else if (isBlobLike(value)) { - if (fileName) { - fd.append(key, value as Blob, fileName); - } else { - fd.append(key, value as Blob); - } - } else { - fd.append(key, String(value)); - } -} - -export async function normalizeBlob( - value: Pick, -): Promise { - if (value instanceof Blob) { - return value; - } - return new Blob([await value.arrayBuffer()], { type: value.type }); -} diff --git a/sync-for-payables/src/lib/files.ts b/sync-for-payables/src/lib/files.ts index 6ca6b37d3..1427b8cf6 100644 --- a/sync-for-payables/src/lib/files.ts +++ b/sync-for-payables/src/lib/files.ts @@ -1,104 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Consumes a stream and returns a concatenated array buffer. Useful in - * situations where we need to read the whole file because it forms part of a - * larger payload containing other fields, and we can't modify the underlying - * request structure. - */ -export async function readableStreamToArrayBuffer( - readable: ReadableStream, -): Promise { - const reader = readable.getReader(); - const chunks: Uint8Array[] = []; - - let totalLength = 0; - let done = false; - - while (!done) { - const { value, done: doneReading } = await reader.read(); - - if (doneReading) { - done = true; - } else { - chunks.push(value); - totalLength += value.length; - } - } - - const concatenatedChunks = new Uint8Array(totalLength); - let offset = 0; - - for (const chunk of chunks) { - concatenatedChunks.set(chunk, offset); - offset += chunk.length; - } - - return concatenatedChunks.buffer as ArrayBuffer; +export function bytesToBlob(content: unknown, contentType: string): Blob { + void content; + return new Blob([], { type: contentType }); } -/** - * Determines the MIME content type based on a file's extension. - * Returns null if the extension is not recognized. - */ -export function getContentTypeFromFileName(fileName: string): string | null { - if (!fileName) return null; - - const ext = fileName.toLowerCase().split(".").pop(); - if (!ext) return null; - - const mimeTypes: Record = { - json: "application/json", - xml: "application/xml", - html: "text/html", - htm: "text/html", - txt: "text/plain", - csv: "text/csv", - pdf: "application/pdf", - png: "image/png", - jpg: "image/jpeg", - jpeg: "image/jpeg", - gif: "image/gif", - svg: "image/svg+xml", - js: "application/javascript", - css: "text/css", - zip: "application/zip", - tar: "application/x-tar", - gz: "application/gzip", - mp4: "video/mp4", - mp3: "audio/mpeg", - wav: "audio/wav", - webp: "image/webp", - ico: "image/x-icon", - woff: "font/woff", - woff2: "font/woff2", - ttf: "font/ttf", - otf: "font/otf", - }; - - return mimeTypes[ext] || null; +export function getContentTypeFromFileName(fileName: string): string { + void fileName; + return "application/octet-stream"; } -/** - * Creates a Blob from file content with the given MIME type. - * - * Node.js Buffers are Uint8Array subclasses that may share a pooled - * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing - * such a Buffer directly to `new Blob([buf])` can include the entire - * underlying pool on some runtimes, producing a Blob with extra bytes - * that corrupts multipart uploads. - * - * Copying into a standalone Uint8Array ensures the Blob receives only the - * intended bytes regardless of runtime behaviour. - */ -export function bytesToBlob( - content: Uint8Array | ArrayBuffer | Blob | string, - contentType: string, -): Blob { - if (content instanceof Uint8Array) { - return new Blob([new Uint8Array(content)], { type: contentType }); - } - return new Blob([content as BlobPart], { type: contentType }); +export async function readableStreamToArrayBuffer(readable: unknown): Promise { + void readable; + return new ArrayBuffer(0); } diff --git a/sync-for-payables/src/lib/http.ts b/sync-for-payables/src/lib/http.ts deleted file mode 100644 index 13cf1fd78..000000000 --- a/sync-for-payables/src/lib/http.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type Fetcher = ( - input: RequestInfo | URL, - init?: RequestInit, -) => Promise; - -export type Awaitable = T | Promise; - -const DEFAULT_FETCHER: Fetcher = (input, init) => { - // If input is a Request and init is undefined, Bun will discard the method, - // headers, body and other options that were set on the request object. - // Node.js and browers would ignore an undefined init value. This check is - // therefore needed for interop with Bun. - if (init == null) { - return fetch(input); - } else { - return fetch(input, init); - } -}; - -export type RequestInput = { - /** - * The URL the request will use. - */ - url: URL; - /** - * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - */ - options?: RequestInit | undefined; -}; - -export interface HTTPClientOptions { - fetcher?: Fetcher; -} - -export type BeforeRequestHook = (req: Request) => Awaitable; -export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; -export type ResponseHook = (res: Response, req: Request) => Awaitable; - -export class HTTPClient { - private fetcher: Fetcher; - private requestHooks: BeforeRequestHook[] = []; - private requestErrorHooks: RequestErrorHook[] = []; - private responseHooks: ResponseHook[] = []; - - constructor(private options: HTTPClientOptions = {}) { - this.fetcher = options.fetcher || DEFAULT_FETCHER; - } - - async request(request: Request): Promise { - let req = request; - for (const hook of this.requestHooks) { - const nextRequest = await hook(req); - if (nextRequest) { - req = nextRequest; - } - } - - try { - const res = await this.fetcher(req); - - for (const hook of this.responseHooks) { - await hook(res, req); - } - - return res; - } catch (err) { - for (const hook of this.requestErrorHooks) { - await hook(err, req); - } - - throw err; - } - } - - /** - * Registers a hook that is called before a request is made. The hook function - * can mutate the request or return a new request. This may be useful to add - * additional information to request such as request IDs and tracing headers. - */ - addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** - * Registers a hook that is called when a request cannot be made due to a - * network error. - */ - addHook(hook: "requestError", fn: RequestErrorHook): this; - /** - * Registers a hook that is called when a response has been received from the - * server. - */ - addHook(hook: "response", fn: ResponseHook): this; - addHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ) { - if (args[0] === "beforeRequest") { - this.requestHooks.push(args[1]); - } else if (args[0] === "requestError") { - this.requestErrorHooks.push(args[1]); - } else if (args[0] === "response") { - this.responseHooks.push(args[1]); - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - return this; - } - - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "requestError", fn: RequestErrorHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "response", fn: ResponseHook): this; - removeHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ): this { - let target: unknown[]; - if (args[0] === "beforeRequest") { - target = this.requestHooks; - } else if (args[0] === "requestError") { - target = this.requestErrorHooks; - } else if (args[0] === "response") { - target = this.responseHooks; - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - - const index = target.findIndex((v) => v === args[1]); - if (index >= 0) { - target.splice(index, 1); - } - - return this; - } - - clone(): HTTPClient { - const child = new HTTPClient(this.options); - child.requestHooks = this.requestHooks.slice(); - child.requestErrorHooks = this.requestErrorHooks.slice(); - child.responseHooks = this.responseHooks.slice(); - - return child; - } -} - -export type StatusCodePredicate = number | string | (number | string)[]; - -// A semicolon surrounded by optional whitespace characters is used to separate -// segments in a media type string. -const mediaParamSeparator = /\s*;\s*/g; - -export function matchContentType(response: Response, pattern: string): boolean { - // `*` is a special case which means anything is acceptable. - if (pattern === "*") { - return true; - } - - let contentType = - response.headers.get("content-type")?.trim() || "application/octet-stream"; - contentType = contentType.toLowerCase(); - - const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); - const [wantType = "", ...wantParams] = wantParts; - - if (wantType.split("/").length !== 2) { - return false; - } - - const gotParts = contentType.split(mediaParamSeparator); - const [gotType = "", ...gotParams] = gotParts; - - const [type = "", subtype = ""] = gotType.split("/"); - if (!type || !subtype) { - return false; - } - - if ( - wantType !== "*/*" && - gotType !== wantType && - `${type}/*` !== wantType && - `*/${subtype}` !== wantType - ) { - return false; - } - - if (gotParams.length < wantParams.length) { - return false; - } - - const params = new Set(gotParams); - for (const wantParam of wantParams) { - if (!params.has(wantParam)) { - return false; - } - } - - return true; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -export function matchStatusCode( - response: Response, - codes: StatusCodePredicate, -): boolean { - const actual = `${response.status}`; - const expectedCodes = Array.isArray(codes) ? codes : [codes]; - if (!expectedCodes.length) { - return false; - } - - return expectedCodes.some((ec) => { - const code = `${ec}`; - - if (code === "default") { - return true; - } - - if (!codeRangeRE.test(`${code}`)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -export function matchResponse( - response: Response, - code: StatusCodePredicate, - contentTypePattern: string, -): boolean { - return ( - matchStatusCode(response, code) && - matchContentType(response, contentTypePattern) - ); -} - -/** - * Uses various heurisitics to determine if an error is a connection error. - */ -export function isConnectionError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Covers fetch in Deno as well - const isBrowserErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("failed to fetch"); - - const isNodeErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("fetch failed"); - - const isBunErr = "name" in err && err.name === "ConnectionError"; - - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnreset"; - - return isBrowserErr || isNodeErr || isGenericErr || isBunErr; -} - -/** - * Uses various heurisitics to determine if an error is a timeout error. - */ -export function isTimeoutError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "TimeoutError"; - const isLegacyNative = "code" in err && err.code === 23; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} - -/** - * Uses various heurisitics to determine if an error is a abort error. - */ -export function isAbortError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "AbortError"; - const isLegacyNative = "code" in err && err.code === 20; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} diff --git a/sync-for-payables/src/lib/is-plain-object.ts b/sync-for-payables/src/lib/is-plain-object.ts deleted file mode 100644 index 61070d3d7..000000000 --- a/sync-for-payables/src/lib/is-plain-object.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js - -export function isPlainObject(value: unknown): value is object { - if (typeof value !== "object" || value === null) { - return false; - } - - const prototype = Object.getPrototypeOf(value); - return ( - (prototype === null || - prototype === Object.prototype || - Object.getPrototypeOf(prototype) === null) && - !(Symbol.toStringTag in value) && - !(Symbol.iterator in value) - ); -} diff --git a/sync-for-payables/src/lib/logger.ts b/sync-for-payables/src/lib/logger.ts deleted file mode 100644 index d181f2937..000000000 --- a/sync-for-payables/src/lib/logger.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export interface Logger { - group(label?: string): void; - groupEnd(): void; - log(message: any, ...args: any[]): void; -} diff --git a/sync-for-payables/src/lib/matchers.ts b/sync-for-payables/src/lib/matchers.ts deleted file mode 100644 index b096d6f20..000000000 --- a/sync-for-payables/src/lib/matchers.ts +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export type Encoding = - | "jsonl" - | "json" - | "text" - | "bytes" - | "stream" - | "sse" - | "nil" - | "fail"; - -const DEFAULT_CONTENT_TYPES: Record = { - jsonl: "application/jsonl", - json: "application/json", - text: "text/plain", - bytes: "application/octet-stream", - stream: "application/octet-stream", - sse: "text/event-stream", - nil: "*", - fail: "*", -}; - -type Schema = { parse(raw: unknown): T }; - -type MatchOptions = { - ctype?: string; - hdrs?: boolean; - key?: string; - sseSentinel?: string; -}; - -export type ValueMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; -}; - -export type ErrorMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; - err: true; -}; - -export type FailMatcher = { - enc: "fail"; - codes: StatusCodePredicate; -}; - -export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; - -export function jsonErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "json", codes, schema }; -} -export function json( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "json", codes, schema }; -} - -export function jsonl( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "jsonl", codes, schema }; -} - -export function jsonlErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "jsonl", codes, schema }; -} -export function textErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "text", codes, schema }; -} -export function text( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "text", codes, schema }; -} - -export function bytesErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "bytes", codes, schema }; -} -export function bytes( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "bytes", codes, schema }; -} - -export function streamErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "stream", codes, schema }; -} -export function stream( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "stream", codes, schema }; -} - -export function sseErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "sse", codes, schema }; -} -export function sse( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "sse", codes, schema }; -} - -export function nilErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "nil", codes, schema }; -} -export function nil( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "nil", codes, schema }; -} - -export function fail(codes: StatusCodePredicate): FailMatcher { - return { enc: "fail", codes }; -} - -export type MatchedValue = Matchers extends Matcher[] - ? T - : never; -export type MatchedError = Matchers extends Matcher[] - ? E - : never; -export type MatchFunc = ( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, -) => Promise<[result: Result, raw: unknown]>; - -export function match( - ...matchers: Array> -): MatchFunc { - return async function matchFunc( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, - ): Promise< - [result: Result, raw: unknown] - > { - let raw: unknown; - let matcher: Matcher | undefined; - for (const match of matchers) { - const { codes } = match; - const ctpattern = "ctype" in match - ? match.ctype - : DEFAULT_CONTENT_TYPES[match.enc]; - if (ctpattern && matchResponse(response, codes, ctpattern)) { - matcher = match; - break; - } else if (!ctpattern && matchStatusCode(response, codes)) { - matcher = match; - break; - } - } - - if (!matcher) { - return [{ - ok: false, - error: new SDKError("Unexpected Status or Content-Type", { - response, - request, - body: await response.text().catch(() => ""), - }), - }, raw]; - } - - const encoding = matcher.enc; - let body = ""; - switch (encoding) { - case "json": - body = await response.text(); - raw = JSON.parse(body); - break; - case "jsonl": - raw = response.body; - break; - case "bytes": - raw = new Uint8Array(await response.arrayBuffer()); - break; - case "stream": - raw = response.body; - break; - case "text": - body = await response.text(); - raw = body; - break; - case "sse": - raw = response.body; - break; - case "nil": - body = await response.text(); - raw = undefined; - break; - case "fail": - body = await response.text(); - raw = body; - break; - default: - throw new Error( - `Unsupported response type: ${encoding satisfies never}`, - ); - } - - if (matcher.enc === "fail") { - return [{ - ok: false, - error: new SDKError("API error occurred", { request, response, body }), - }, raw]; - } - - const resultKey = matcher.key || options?.resultKey; - let data: unknown; - - if ("err" in matcher) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - request$: request, - response$: response, - body$: body, - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - [resultKey]: raw, - }; - } else if (matcher.hdrs) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - }; - } else { - data = raw; - } - - if ("err" in matcher) { - const result = safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ); - return [result.ok ? { ok: false, error: result.value } : result, raw]; - } else { - return [ - safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ), - raw, - ]; - } - }; -} - -const headerValRE = /, */; -/** - * Iterates over a Headers object and returns an object with all the header - * entries. Values are represented as an array to account for repeated headers. - */ -export function unpackHeaders(headers: Headers): Record { - const out: Record = {}; - - for (const [k, v] of headers.entries()) { - out[k] = v.split(headerValRE); - } - - return out; -} - -function safeParseResponse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, - httpMeta: { response: Response; request: Request; body: string }, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR( - new ResponseValidationError(errorMessage, { - cause: err, - rawValue, - rawMessage: errorMessage, - ...httpMeta, - }), - ); - } -} diff --git a/sync-for-payables/src/lib/primitives.ts b/sync-for-payables/src/lib/primitives.ts deleted file mode 100644 index d21f1dc49..000000000 --- a/sync-for-payables/src/lib/primitives.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -class InvariantError extends Error { - constructor(message: string) { - super(message); - this.name = "InvariantError"; - } -} - -export function invariant( - condition: unknown, - message: string, -): asserts condition { - if (!condition) { - throw new InvariantError(message); - } -} - -export type ExactPartial = { - [P in keyof T]?: T[P] | undefined; -}; - -export type Remap = { - [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ - ? Mapping[k] - : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ - ? never - : k /* otherwise keep the key as-is */]: Inp[k]; -}; - -/** - * Converts or omits an object's keys according to a mapping. - * - * @param inp An object whose keys will be remapped - * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. - * @returns A new object with keys remapped or omitted according to the mappings - */ -export function remap< - Inp extends Record, - const Mapping extends { [k in keyof Inp]?: string | null }, ->(inp: Inp, mappings: Mapping): Remap { - let out: any = {}; - - if (!Object.keys(mappings).length) { - out = inp; - return out; - } - - for (const [k, v] of Object.entries(inp)) { - const j = mappings[k]; - if (j === null) { - continue; - } - out[j ?? k] = v; - } - - return out; -} - -export function combineSignals( - ...signals: Array -): AbortSignal | null { - const filtered: AbortSignal[] = []; - for (const signal of signals) { - if (signal) { - filtered.push(signal); - } - } - - switch (filtered.length) { - case 0: - case 1: - return filtered[0] || null; - default: - if ("any" in AbortSignal && typeof AbortSignal.any === "function") { - return AbortSignal.any(filtered); - } - return abortSignalAny(filtered); - } -} - -export function abortSignalAny(signals: AbortSignal[]): AbortSignal { - const controller = new AbortController(); - const result = controller.signal; - if (!signals.length) { - return controller.signal; - } - - if (signals.length === 1) { - return signals[0] || controller.signal; - } - - for (const signal of signals) { - if (signal.aborted) { - return signal; - } - } - - function abort(this: AbortSignal) { - controller.abort(this.reason); - clean(); - } - - const signalRefs: WeakRef[] = []; - function clean() { - for (const signalRef of signalRefs) { - const signal = signalRef.deref(); - if (signal) { - signal.removeEventListener("abort", abort); - } - } - } - - for (const signal of signals) { - signalRefs.push(new WeakRef(signal)); - signal.addEventListener("abort", abort); - } - - return result; -} - -export function compactMap( - values: Record, -): Record { - const out: Record = {}; - - for (const [k, v] of Object.entries(values)) { - if (typeof v !== "undefined") { - out[k] = v; - } - } - - return out; -} - -export function allRequired>( - v: V, -): - | { - [K in keyof V]: NonNullable; - } - | undefined { - if (Object.values(v).every((x) => x == null)) { - return void 0; - } - - return v as ReturnType>; -} diff --git a/sync-for-payables/src/lib/retries.ts b/sync-for-payables/src/lib/retries.ts deleted file mode 100644 index e3ce9aba7..000000000 --- a/sync-for-payables/src/lib/retries.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { isConnectionError, isTimeoutError } from "./http.js"; - -export type BackoffStrategy = { - initialInterval: number; - maxInterval: number; - exponent: number; - maxElapsedTime: number; -}; - -const defaultBackoff: BackoffStrategy = { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, -}; - -export type RetryConfig = - | { strategy: "none" } - | { - strategy: "backoff"; - backoff?: BackoffStrategy; - retryConnectionErrors?: boolean; - }; - -/** - * PermanentError is an error that is not recoverable. Throwing this error will - * cause a retry loop to terminate. - */ -export class PermanentError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - - constructor(message: string, options?: { cause?: unknown }) { - let msg = message; - if (options?.cause) { - msg += `: ${options.cause}`; - } - - super(msg, options); - this.name = "PermanentError"; - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = options?.cause; - } - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -/** - * TemporaryError is an error is used to signal that an HTTP request can be - * retried as part of a retry loop. If retry attempts are exhausted and this - * error is thrown, the response will be returned to the caller. - */ -export class TemporaryError extends Error { - response: Response; - - constructor(message: string, response: Response) { - super(message); - this.response = response; - this.name = "TemporaryError"; - - Object.setPrototypeOf(this, TemporaryError.prototype); - } -} - -export async function retry( - fetchFn: () => Promise, - options: { - config: RetryConfig; - statusCodes: string[]; - }, -): Promise { - switch (options.config.strategy) { - case "backoff": - return retryBackoff( - wrapFetcher(fetchFn, { - statusCodes: options.statusCodes, - retryConnectionErrors: !!options.config.retryConnectionErrors, - }), - options.config.backoff ?? defaultBackoff, - ); - default: - return await fetchFn(); - } -} - -function wrapFetcher( - fn: () => Promise, - options: { - statusCodes: string[]; - retryConnectionErrors: boolean; - }, -): () => Promise { - return async () => { - try { - const res = await fn(); - if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError( - "Response failed with retryable status code", - res, - ); - } - - return res; - } catch (err: unknown) { - if (err instanceof TemporaryError) { - throw err; - } - - if ( - options.retryConnectionErrors && - (isTimeoutError(err) || isConnectionError(err)) - ) { - throw err; - } - - throw new PermanentError("Permanent error", { cause: err }); - } - }; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -function isRetryableResponse(res: Response, statusCodes: string[]): boolean { - const actual = `${res.status}`; - - return statusCodes.some((code) => { - if (!codeRangeRE.test(code)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -async function retryBackoff( - fn: () => Promise, - strategy: BackoffStrategy, -): Promise { - const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; - - const start = Date.now(); - let x = 0; - - while (true) { - try { - const res = await fn(); - return res; - } catch (err: unknown) { - if (err instanceof PermanentError) { - throw err.cause; - } - const elapsed = Date.now() - start; - if (elapsed > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.response; - } - - throw err; - } - - let retryInterval = 0; - if (err instanceof TemporaryError) { - retryInterval = retryIntervalFromResponse(err.response); - } - - if (retryInterval <= 0) { - retryInterval = - initialInterval * Math.pow(x, exponent) + Math.random() * 1000; - } - - const d = Math.min(retryInterval, maxInterval); - - await delay(d); - x++; - } - } -} - -function retryIntervalFromResponse(res: Response): number { - const retryVal = res.headers.get("retry-after") || ""; - if (!retryVal) { - return 0; - } - - const parsedNumber = Number(retryVal); - if (Number.isInteger(parsedNumber)) { - return parsedNumber * 1000; - } - - const parsedDate = Date.parse(retryVal); - if (Number.isInteger(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - return deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - - return 0; -} - -async function delay(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/sync-for-payables/src/lib/schemas.ts b/sync-for-payables/src/lib/schemas.ts deleted file mode 100644 index dc2510e33..000000000 --- a/sync-for-payables/src/lib/schemas.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { - output, - ZodEffects, - ZodError, - ZodObject, - ZodRawShape, - ZodTypeAny, -} from "zod/v3"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; - -/** - * Utility function that executes some code which may throw a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function parse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Out { - try { - return fn(rawValue); - } catch (err) { - if (err instanceof ZodError) { - throw new SDKValidationError(errorMessage, err, rawValue); - } - throw err; - } -} - -/** - * Utility function that executes some code which may result in a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function safeParse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR(new SDKValidationError(errorMessage, err, rawValue)); - } -} - -export function collectExtraKeys< - Shape extends ZodRawShape, - Catchall extends ZodTypeAny, - K extends string, ->( - obj: ZodObject, - extrasKey: K, - optional: boolean, -): ZodEffects< - typeof obj, - & output> - & { - [k in K]: Record>; - } -> { - return obj.transform((val) => { - const extras: Record> = {}; - const { shape } = obj; - for (const [key] of Object.entries(val)) { - if (key in shape) { - continue; - } - - const v = val[key]; - if (typeof v === "undefined") { - continue; - } - - extras[key] = v; - delete val[key]; - } - - if (optional && Object.keys(extras).length === 0) { - return val; - } - - return { ...val, [extrasKey]: extras }; - }); -} diff --git a/sync-for-payables/src/lib/sdkconfig.ts b/sync-for-payables/src/lib/sdkconfig.ts new file mode 100644 index 000000000..d6e4a87aa --- /dev/null +++ b/sync-for-payables/src/lib/sdkconfig.ts @@ -0,0 +1,473 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type { SDKHooks } from "../hooks/hooks"; +import type { HookContext } from "../hooks/types"; + +export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; + +export type RequestInput = { + url: URL; + options?: RequestInit | undefined; +}; + +export type Awaitable = T | Promise; + +export type BeforeRequestHook = (req: Request) => Awaitable; +export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +export type ResponseHook = (res: Response, req: Request) => Awaitable; + +const DEFAULT_FETCHER: Fetcher = (input, init) => (init == null ? fetch(input) : fetch(input, init)); + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const next = await hook(req); + if (next) { + req = next; + } + } + try { + const res = await this.fetcher(req); + for (const hook of this.responseHooks) { + await hook(res, req); + } + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + throw err; + } + } + + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + addHook(hook: "requestError", fn: RequestErrorHook): this; + addHook(hook: "response", fn: ResponseHook): this; + addHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + if (hook === "beforeRequest") { + this.requestHooks.push(fn as BeforeRequestHook); + } else if (hook === "requestError") { + this.requestErrorHooks.push(fn as RequestErrorHook); + } else if (hook === "response") { + this.responseHooks.push(fn as ResponseHook); + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + return this; + } + + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + removeHook(hook: "requestError", fn: RequestErrorHook): this; + removeHook(hook: "response", fn: ResponseHook): this; + removeHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + let target: unknown[]; + if (hook === "beforeRequest") { + target = this.requestHooks; + } else if (hook === "requestError") { + target = this.requestErrorHooks; + } else if (hook === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + const index = target.findIndex((v) => v === fn); + if (index >= 0) { + target.splice(index, 1); + } + return this; + } + + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + return child; + } +} + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +export interface Logger { + group(label?: string): void; + groupEnd(): void; + log(...args: unknown[]): void; +} + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +export interface SDKOptions { + authHeader?: string | (() => Promise) | undefined; + debugLogger?: Logger; + httpClient?: HTTPClient; + retryConfig?: RetryConfig; + serverIdx?: number | undefined; + serverURL?: string | undefined; + timeoutMs?: number; + userAgent?: string | undefined; +} + +export type Security = { + authHeader: string; +}; + +export const ServerList = ["https://api.codat.io"] as const; + +export const SDK_METADATA = { + language: "typescript", + genVersion: "codat-sdk-codegen-poc-0.1.0", + sdkVersion: "3.0.0", + openapiDocVersion: "3.0.0", + userAgent: "codat-sdk/typescript 3.0.0 codat-sdk-codegen-poc-0.1.0 3.0.0 @codat/sync-for-payables", +} as const; + +export function resolveServerURL(options: SDKOptions = {}): string { + const fromList = ServerList[options.serverIdx ?? 0] ?? ServerList[0]; + return (options.serverURL ?? fromList).replace(/\/+$/, ""); +} + +export function resolveAuthHeader( + authHeader: SDKOptions["authHeader"], +): string | ((name: string) => Promise) | undefined { + if (authHeader == null) { + return undefined; + } + if (typeof authHeader === "function") { + return () => authHeader(); + } + return authHeader; +} + +const DEFAULT_RETRY_CODES = ["408", "429", "5XX"]; + +const DEFAULT_RETRY_CONFIG: RetryConfig = { + strategy: "backoff", + backoff: { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + retryConnectionErrors: true, +}; + +class PermanentError extends Error { + readonly cause: unknown; + constructor(message: string, options?: { cause?: unknown }) { + super(message); + this.name = "PermanentError"; + this.cause = options?.cause; + } +} + +class TemporaryError extends Error { + readonly response: Response; + constructor(message: string, response: Response) { + super(message); + this.name = "TemporaryError"; + this.response = response; + } +} + +function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const msg = err instanceof TypeError ? err.message.toLowerCase() : ""; + const isFetchErr = msg.startsWith("failed to fetch") || msg.startsWith("fetch failed"); + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return isFetchErr || code === "econnreset"; +} + +function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const name = "name" in err ? (err as { name?: unknown }).name : ""; + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return name === "TimeoutError" || code === "econnaborted"; +} + +const codeRangeRE = /^[0-9]xx$/i; + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + return actual.charAt(0) === code.charAt(0); + }); +} + +function retryIntervalFromResponse(res: Response): number { + const retryVal = res.headers.get("retry-after") || ""; + if (!retryVal) { + return 0; + } + const asNumber = Number(retryVal); + if (Number.isInteger(asNumber)) { + return asNumber * 1000; + } + const asDate = Date.parse(retryVal); + if (Number.isInteger(asDate)) { + const deltaMs = asDate - Date.now(); + return deltaMs > 0 ? Math.ceil(deltaMs) : 0; + } + return 0; +} + +function delay(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +function wrapFetcher( + fn: () => Promise, + statusCodes: string[], + retryConnectionErrors: boolean, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, statusCodes)) { + throw new TemporaryError("Response failed with retryable status code", res); + } + return res; + } catch (err: unknown) { + if (err instanceof TemporaryError) { + throw err; + } + if (retryConnectionErrors && (isTimeoutError(err) || isConnectionError(err))) { + throw err; + } + throw new PermanentError("Permanent error", { cause: err }); + } + }; +} + +async function retryBackoff(fn: () => Promise, strategy: BackoffStrategy): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + const start = Date.now(); + let x = 0; + for (;;) { + try { + return await fn(); + } catch (err: unknown) { + if (err instanceof PermanentError) { + throw err.cause; + } + if (Date.now() - start > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.response; + } + throw err; + } + let retryInterval = err instanceof TemporaryError ? retryIntervalFromResponse(err.response) : 0; + if (retryInterval <= 0) { + retryInterval = initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + await delay(Math.min(retryInterval, maxInterval)); + x++; + } + } +} + +function retryRequest(fn: () => Promise, config: RetryConfig, statusCodes: string[]): Promise { + if (config.strategy === "backoff") { + return retryBackoff( + wrapFetcher(fn, statusCodes, !!config.retryConnectionErrors), + config.backoff ?? { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + ); + } + return fn(); +} + +export function resolveUserAgent(userAgent: string | undefined): Record { + const agent = userAgent ?? SDK_METADATA.userAgent; + if (!agent) { + return {}; + } + const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + return isBrowser ? {} : { "user-agent": agent }; +} + +function parseURL(input: RequestInfo | URL): URL | null { + try { + return new URL(String(input)); + } catch { + return null; + } +} + +export type SecurityState = { + basic: { username?: string; password?: string }; + headers: Record; + queryParams: Record; + cookies: Record; + oauth2: { type: "none" }; +}; + +function headerValue(headers: HeadersInit | undefined, name: string): string | undefined { + if (!headers) { + return undefined; + } + const lower = name.toLowerCase(); + if (typeof Headers !== "undefined" && headers instanceof Headers) { + return headers.get(name) ?? undefined; + } + if (Array.isArray(headers)) { + const found = headers.find(([k]) => k.toLowerCase() === lower); + return found ? found[1] : undefined; + } + for (const k of Object.keys(headers)) { + if (k.toLowerCase() === lower) { + return (headers as Record)[k]; + } + } + return undefined; +} + +function resolveSecurityState(authValue: string | undefined): SecurityState | null { + if (authValue == null) { + return null; + } + return { + basic: {}, + headers: { Authorization: authValue }, + queryParams: {}, + cookies: {}, + oauth2: { type: "none" }, + }; +} + +export function makeFetch(options: SDKOptions = {}, hooks?: SDKHooks): Fetcher { + const client = options.httpClient; + const logger = options.debugLogger; + return (input, init) => { + const reqInit: RequestInit = init ?? {}; + const stamped = reqInit as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + const operationId = stamped.__codatOperationId; + const config = stamped.__codatRetries ?? options.retryConfig ?? DEFAULT_RETRY_CONFIG; + const retryCodes = stamped.__codatRetryCodes ?? DEFAULT_RETRY_CODES; + for (const key of ["__codatOperationId", "__codatRetries", "__codatRetryCodes"] as const) { + if (key in stamped) { + delete stamped[key]; + } + } + const parsed = parseURL(input); + const ctx: HookContext = { + baseURL: resolveServerURL(options), + operationID: operationId ?? `${(reqInit.method ?? "GET").toUpperCase()} ${parsed ? parsed.pathname : String(input)}`, + oAuth2Scopes: null, + securitySource: options.authHeader, + retryConfig: config, + resolvedSecurity: resolveSecurityState(headerValue(reqInit.headers, "Authorization")), + options, + }; + + let url: RequestInfo | URL = input; + let finalInit: RequestInit = reqInit; + if (hooks && parsed) { + const created = hooks.beforeCreateRequest(ctx, { url: parsed, options: reqInit }); + url = created.url; + finalInit = created.options ?? reqInit; + } + if (!finalInit.signal && options.timeoutMs && options.timeoutMs > 0) { + finalInit = { ...finalInit, signal: AbortSignal.timeout(options.timeoutMs) }; + } + + const dispatch = async (): Promise => { + let request = new Request(url, finalInit); + if (hooks) { + request = await hooks.beforeRequest(ctx, request.clone()); + } + if (logger) { + logger.log(`request: ${request.method} ${request.url}`); + } + let res: Response; + try { + res = client ? await client.request(request) : await fetch(request); + } catch (err) { + if (hooks) { + const handled = await hooks.afterError(ctx, null, err); + if (handled.error) { + throw handled.error; + } + if (handled.response) { + return handled.response; + } + } + throw err; + } + if (logger) { + logger.log(`response: ${res.status}`); + } + if (hooks) { + if (res.status >= 400) { + const handled = await hooks.afterError(ctx, res, null); + if (handled.error) { + throw handled.error; + } + res = handled.response ?? res; + } else { + res = await hooks.afterSuccess(ctx, res); + } + } + return res; + }; + return retryRequest(dispatch, config, retryCodes); + }; +} + +export type StatusCodePredicate = number | string | (number | string)[]; + +export function matchStatusCode(response: Response, codes: StatusCodePredicate): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + return expectedCodes.some((ec) => { + const code = `${ec}`; + if (code === "default") { + return true; + } + if (!codeRangeRE.test(code)) { + return code === actual; + } + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + return actualFamily === expectFamily; + }); +} diff --git a/sync-for-payables/src/lib/sdks.ts b/sync-for-payables/src/lib/sdks.ts deleted file mode 100644 index 43fcf336e..000000000 --- a/sync-for-payables/src/lib/sdks.ts +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { HookContext } from "../hooks/types.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { stringToBase64 } from "./base64.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js"; -import { encodeForm } from "./encodings.js"; -import { - HTTPClient, - isAbortError, - isConnectionError, - isTimeoutError, - matchContentType, - matchStatusCode, -} from "./http.js"; -import { Logger } from "./logger.js"; -import { retry, RetryConfig } from "./retries.js"; -import { SecurityState } from "./security.js"; - -export type RequestOptions = { - /** - * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If - * `fetchOptions.signal` is set then it will take precedence over this option. - */ - timeoutMs?: number; - /** - * Set or override a retry policy on HTTP calls. - */ - retries?: RetryConfig; - /** - * Specifies the status codes which should be retried using the given retry policy. - */ - retryCodes?: string[]; - /** - * Overrides the base server URL that will be used by an operation. - */ - serverURL?: string | URL; - /** - * @deprecated `fetchOptions` has been flattened into `RequestOptions`. - * - * Sets various request options on the `fetch` call made by an SDK method. - * - * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} - */ - fetchOptions?: Omit; -} & Omit; - -type RequestConfig = { - method: string; - path: string; - baseURL?: string | URL | undefined; - query?: string; - body?: RequestInit["body"]; - headers?: HeadersInit; - security?: SecurityState | null; - uaHeader?: string; - userAgent?: string | undefined; - timeoutMs?: number; -}; - -const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; -const webWorkerLike = typeof gt === "object" - && gt != null - && "importScripts" in gt - && typeof gt["importScripts"] === "function"; -const isBrowserLike = webWorkerLike - || (typeof navigator !== "undefined" && "serviceWorker" in navigator) - || (typeof window === "object" && typeof window.document !== "undefined"); - -export class ClientSDK { - readonly #httpClient: HTTPClient; - readonly #hooks: SDKHooks; - readonly #logger?: Logger | undefined; - public readonly _baseURL: URL | null; - public readonly _options: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - if ( - typeof opt === "object" - && opt != null - && "hooks" in opt - && opt.hooks instanceof SDKHooks - ) { - this.#hooks = opt.hooks; - } else { - this.#hooks = new SDKHooks(); - } - const url = serverURLFromOptions(options); - if (url) { - url.pathname = url.pathname.replace(/\/+$/, "") + "/"; - } - - const { baseURL, client } = this.#hooks.sdkInit({ - baseURL: url, - client: options.httpClient || new HTTPClient(), - }); - this._baseURL = baseURL; - this.#httpClient = client; - - this._options = { ...options, hooks: this.#hooks }; - - this.#logger = this._options.debugLogger; - } - - public _createRequest( - context: HookContext, - conf: RequestConfig, - options?: RequestOptions, - ): Result { - const { method, path, query, headers: opHeaders, security } = conf; - - const base = conf.baseURL ?? this._baseURL; - if (!base) { - return ERR(new InvalidRequestError("No base URL provided for operation")); - } - const baseURL = new URL(base); - let reqURL: URL; - if (path) { - baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/"; - reqURL = new URL(path, baseURL); - } else { - reqURL = baseURL; - } - reqURL.hash = ""; - - let finalQuery = query || ""; - - const secQuery: string[] = []; - for (const [k, v] of Object.entries(security?.queryParams || {})) { - const q = encodeForm(k, v, { charEncoding: "percent" }); - if (typeof q !== "undefined") { - secQuery.push(q); - } - } - if (secQuery.length) { - finalQuery += `&${secQuery.join("&")}`; - } - - if (finalQuery) { - const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; - reqURL.search = `?${q}`; - } - - const headers = new Headers(opHeaders); - - const username = security?.basic.username; - const password = security?.basic.password; - if (username != null || password != null) { - const encoded = stringToBase64( - [username || "", password || ""].join(":"), - ); - headers.set("Authorization", `Basic ${encoded}`); - } - - const securityHeaders = new Headers(security?.headers || {}); - for (const [k, v] of securityHeaders) { - headers.set(k, v); - } - - let cookie = headers.get("cookie") || ""; - for (const [k, v] of Object.entries(security?.cookies || {})) { - cookie += `; ${k}=${v}`; - } - cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; - headers.set("cookie", cookie); - - const userHeaders = new Headers( - options?.headers ?? options?.fetchOptions?.headers, - ); - for (const [k, v] of userHeaders) { - headers.set(k, v); - } - - // Only set user agent header in non-browser-like environments since CORS - // policy disallows setting it in browsers e.g. Chrome throws an error. - if (!isBrowserLike) { - headers.set( - conf.uaHeader ?? "user-agent", - conf.userAgent ?? SDK_METADATA.userAgent, - ); - } - - const fetchOptions: Omit = { - ...options?.fetchOptions, - ...options, - }; - if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { - const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - fetchOptions.signal = timeoutSignal; - } - - if (conf.body instanceof ReadableStream) { - Object.assign(fetchOptions, { duplex: "half" }); - } - - let input; - try { - input = this.#hooks.beforeCreateRequest(context, { - url: reqURL, - options: { - ...fetchOptions, - body: conf.body ?? null, - headers, - method, - }, - }); - } catch (err: unknown) { - return ERR( - new UnexpectedClientError("Create request hook failed to execute", { - cause: err, - }), - ); - } - - return OK(new Request(input.url, input.options)); - } - - public async _do( - request: Request, - options: { - context: HookContext; - errorCodes: number | string | (number | string)[]; - retryConfig: RetryConfig; - retryCodes: string[]; - }, - ): Promise< - Result< - Response, - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - | UnexpectedClientError - > - > { - const { context, errorCodes } = options; - - return retry( - async () => { - const req = await this.#hooks.beforeRequest(context, request.clone()); - await logRequest(this.#logger, req).catch((e) => - this.#logger?.log("Failed to log request:", e) - ); - - let response = await this.#httpClient.request(req); - - try { - if (matchStatusCode(response, errorCodes)) { - const result = await this.#hooks.afterError( - context, - response, - null, - ); - if (result.error) { - throw result.error; - } - response = result.response || response; - } else { - response = await this.#hooks.afterSuccess(context, response); - } - } finally { - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - } - - return response; - }, - { config: options.retryConfig, statusCodes: options.retryCodes }, - ).then( - (r) => OK(r), - (err) => { - switch (true) { - case isAbortError(err): - return ERR( - new RequestAbortedError("Request aborted by client", { - cause: err, - }), - ); - case isTimeoutError(err): - return ERR( - new RequestTimeoutError("Request timed out", { cause: err }), - ); - case isConnectionError(err): - return ERR( - new ConnectionError("Unable to make request", { cause: err }), - ); - default: - return ERR( - new UnexpectedClientError("Unexpected HTTP client error", { - cause: err, - }), - ); - } - }, - ); - } -} - -const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; -const jsonlLikeContentTypeRE = - /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; -async function logRequest(logger: Logger | undefined, req: Request) { - if (!logger) { - return; - } - - const contentType = req.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`> Request: ${req.method} ${req.url}`); - - logger.group("Headers:"); - for (const [k, v] of req.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case jsonLikeContentTypeRE.test(ct): - logger.log(await req.clone().json()); - break; - case ct.startsWith("text/"): - logger.log(await req.clone().text()); - break; - case ct === "multipart/form-data": { - const body = await req.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} - -async function logResponse( - logger: Logger | undefined, - res: Response, - req: Request, -) { - if (!logger) { - return; - } - - const contentType = res.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`< Response: ${req.method} ${req.url}`); - logger.log("Status Code:", res.status, res.statusText); - - logger.group("Headers:"); - for (const [k, v] of res.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().json()); - break; - case matchContentType(res, "application/jsonl") - || jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "text/event-stream"): - logger.log(`<${contentType}>`); - break; - case matchContentType(res, "text/*"): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "multipart/form-data"): { - const body = await res.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} diff --git a/sync-for-payables/src/lib/security.ts b/sync-for-payables/src/lib/security.ts deleted file mode 100644 index 3da8e733b..000000000 --- a/sync-for-payables/src/lib/security.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as shared from "../sdk/models/shared/index.js"; - -type OAuth2PasswordFlow = { - username: string; - password: string; - clientID?: string | undefined; - clientSecret?: string | undefined; - tokenURL: string; -}; - -export enum SecurityErrorCode { - Incomplete = "incomplete", - UnrecognisedSecurityType = "unrecognized_security_type", -} - -export class SecurityError extends Error { - constructor( - public code: SecurityErrorCode, - message: string, - ) { - super(message); - this.name = "SecurityError"; - } - - static incomplete(): SecurityError { - return new SecurityError( - SecurityErrorCode.Incomplete, - "Security requirements not met in order to perform the operation", - ); - } - static unrecognizedType(type: string): SecurityError { - return new SecurityError( - SecurityErrorCode.UnrecognisedSecurityType, - `Unrecognised security type: ${type}`, - ); - } -} - -export type SecurityState = { - basic: { username?: string | undefined; password?: string | undefined }; - headers: Record; - queryParams: Record; - cookies: Record; - oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; -}; - -type SecurityInputBasic = { - type: "http:basic"; - value: - | { username?: string | undefined; password?: string | undefined } - | null - | undefined; -}; - -type SecurityInputBearer = { - type: "http:bearer"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputAPIKey = { - type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOIDC = { - type: "openIdConnect"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2 = { - type: "oauth2"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2ClientCredentials = { - type: "oauth2:client_credentials"; - value: - | { - clientID?: string | undefined; - clientSecret?: string | undefined; - } - | null - | string - | undefined; - fieldName?: string; -}; - -type SecurityInputOAuth2PasswordCredentials = { - type: "oauth2:password"; - value: - | string - | null - | undefined; - fieldName?: string; -}; - -type SecurityInputCustom = { - type: "http:custom"; - value: any | null | undefined; - fieldName?: string; -}; - -export type SecurityInput = - | SecurityInputBasic - | SecurityInputBearer - | SecurityInputAPIKey - | SecurityInputOAuth2 - | SecurityInputOAuth2ClientCredentials - | SecurityInputOAuth2PasswordCredentials - | SecurityInputOIDC - | SecurityInputCustom; - -export function resolveSecurity( - ...options: SecurityInput[][] -): SecurityState | null { - const state: SecurityState = { - basic: {}, - headers: {}, - queryParams: {}, - cookies: {}, - oauth2: { type: "none" }, - }; - - const option = options.find((opts) => { - return opts.every((o) => { - if (o.value == null) { - return false; - } else if (o.type === "http:basic") { - return o.value.username != null || o.value.password != null; - } else if (o.type === "http:custom") { - return null; - } else if (o.type === "oauth2:password") { - return ( - typeof o.value === "string" && !!o.value - ); - } else if (o.type === "oauth2:client_credentials") { - if (typeof o.value == "string") { - return !!o.value; - } - return o.value.clientID != null || o.value.clientSecret != null; - } else if (typeof o.value === "string") { - return !!o.value; - } else { - throw new Error( - `Unrecognized security type: ${o.type} (value type: ${typeof o - .value})`, - ); - } - }); - }); - if (option == null) { - return null; - } - - option.forEach((spec) => { - if (spec.value == null) { - return; - } - - const { type } = spec; - - switch (type) { - case "apiKey:header": - state.headers[spec.fieldName] = spec.value; - break; - case "apiKey:query": - state.queryParams[spec.fieldName] = spec.value; - break; - case "apiKey:cookie": - state.cookies[spec.fieldName] = spec.value; - break; - case "http:basic": - applyBasic(state, spec); - break; - case "http:custom": - break; - case "http:bearer": - applyBearer(state, spec); - break; - case "oauth2": - applyBearer(state, spec); - break; - case "oauth2:password": - applyBearer(state, spec); - break; - case "oauth2:client_credentials": - break; - case "openIdConnect": - applyBearer(state, spec); - break; - default: - throw SecurityError.unrecognizedType((spec satisfies never, type)); - } - }); - - return state; -} - -function applyBasic( - state: SecurityState, - spec: SecurityInputBasic, -) { - if (spec.value == null) { - return; - } - - state.basic = spec.value; -} - -function applyBearer( - state: SecurityState, - spec: - | SecurityInputBearer - | SecurityInputOAuth2 - | SecurityInputOIDC - | SecurityInputOAuth2PasswordCredentials, -) { - if (typeof spec.value !== "string" || !spec.value) { - return; - } - - let value = spec.value; - if (value.slice(0, 7).toLowerCase() !== "bearer ") { - value = `Bearer ${value}`; - } - - if (spec.fieldName !== undefined) { - state.headers[spec.fieldName] = value; - } -} - -export function resolveGlobalSecurity( - security: Partial | null | undefined, - allowedFields?: number[], -): SecurityState | null { - let inputs: SecurityInput[][] = [ - [ - { - fieldName: "Authorization", - type: "apiKey:header", - value: security?.authHeader, - }, - ], - ]; - - if (allowedFields) { - inputs = allowedFields.map((i) => { - if (i < 0 || i >= inputs.length) { - throw new RangeError(`invalid allowedFields index ${i}`); - } - return inputs[i]!; - }); - } - - return resolveSecurity(...inputs); -} - -export async function extractSecurity< - T extends string | Record, ->(sec: T | (() => Promise) | undefined): Promise { - if (sec == null) { - return; - } - - return typeof sec === "function" ? sec() : sec; -} diff --git a/sync-for-payables/src/lib/url.ts b/sync-for-payables/src/lib/url.ts deleted file mode 100644 index 79e7ce660..000000000 --- a/sync-for-payables/src/lib/url.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const hasOwn = Object.prototype.hasOwnProperty; - -export type Params = Partial>; - -export function pathToFunc( - pathPattern: string, - options?: { charEncoding?: "percent" | "none" }, -): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; - - return function buildURLPath(params: Record = {}): string { - return pathPattern - .replace(paramRE, function (_, placeholder) { - if (!hasOwn.call(params, placeholder)) { - throw new Error(`Parameter '${placeholder}' is required`); - } - - const value = params[placeholder]; - if (typeof value !== "string" && typeof value !== "number") { - throw new Error( - `Parameter '${placeholder}' must be a string or number`, - ); - } - - return options?.charEncoding === "percent" - ? encodeURIComponent(`${value}`) - : `${value}`; - }) - .replace(/^\/+/, ""); - }; -} diff --git a/sync-for-payables/src/runtime.ts b/sync-for-payables/src/runtime.ts new file mode 100644 index 000000000..dfd1cd7f3 --- /dev/null +++ b/sync-for-payables/src/runtime.ts @@ -0,0 +1,518 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { SDKError } from './sdk/models/errors/sdkerror'; +import { ErrorMessage } from './sdk/models/errors/errormessage'; +import type { RetryConfig } from './lib/sdkconfig'; + +export const BASE_PATH = "https://api.codat.io".replace(/\/+$/, ""); + +export type RequestOptions = { + timeoutMs?: number; + retries?: RetryConfig; + retryCodes?: string[]; + serverURL?: string | URL; + fetchOptions?: Omit; +} & Omit; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, options?: RequestOptions): Promise { + const { url, init } = await this.createFetchParams(context, options); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw await buildSpeakeasyError(url, init, response, context.errorStatuses); + } + + private async createFetchParams(context: RequestOpts, options?: RequestOptions) { + const opts: RequestOptions = options ?? {}; + const { + timeoutMs, + retries, + retryCodes, + serverURL, + fetchOptions, + headers: perCallHeaders, + ...restInit + } = opts; + + const base = (typeof serverURL === "string" || serverURL instanceof URL) + ? String(serverURL).replace(/\/+$/, "") + : this.configuration.basePath; + let url = base + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign( + {}, + this.configuration.headers, + context.headers, + toHeaderRecord(fetchOptions?.headers), + toHeaderRecord(perCallHeaders), + ); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + let body: any; + if (isFormData(context.body) + || (context.body instanceof URLSearchParams) + || isBlob(context.body)) { + body = context.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(context.body); + } else { + body = context.body; + } + + const init: RequestInit = { + ...fetchOptions, + ...restInit, + method: context.method, + headers, + body, + }; + if (init.credentials === undefined && this.configuration.credentials !== undefined) { + init.credentials = this.configuration.credentials; + } + if (!init.signal && timeoutMs && timeoutMs > 0) { + init.signal = AbortSignal.timeout(timeoutMs); + } + + const stamped = init as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + if (context.operationId !== undefined) { + stamped.__codatOperationId = context.operationId; + } + if (retries !== undefined) { + stamped.__codatRetries = retries; + } + if (retryCodes !== undefined) { + stamped.__codatRetryCodes = retryCodes; + } + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +function toHeaderRecord(headers: HeadersInit | undefined): HTTPHeaders { + if (!headers) { + return {}; + } + if (typeof Headers !== "undefined" && headers instanceof Headers) { + const out: HTTPHeaders = {}; + headers.forEach((value, key) => { out[key] = value; }); + return out; + } + if (Array.isArray(headers)) { + const out: HTTPHeaders = {}; + for (const [key, value] of headers) { + out[key] = value; + } + return out; + } + return { ...(headers as Record) }; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +async function buildSpeakeasyError(url: string, init: RequestInit, response: Response, errorStatuses?: number[]): Promise { + const httpResponse = response ?? new Response(null, { status: 500 }); + const body = response ? await response.clone().text() : ""; + const httpMeta = { response: httpResponse, request: new Request(url, { method: init.method }), body }; + let data: any; + try { + data = body ? JSON.parse(body) : undefined; + } catch { + data = undefined; + } + const documentsThisStatus = Array.isArray(errorStatuses) && errorStatuses.indexOf(httpResponse.status) !== -1; + if (documentsThisStatus && data && typeof data === "object" && !Array.isArray(data)) { + return new ErrorMessage(data, httpMeta); + } + return new SDKError("Response returned an error code", httpMeta); +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + operationId?: string; + errorStatuses?: number[]; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} + + +import { Decimal } from './sdk/types/decimal'; +export { Decimal }; + +export function toDecimal(value: any): any { + if (value == null) { return value; } + if (Array.isArray(value)) { return value.map(toDecimal); } + return value instanceof Decimal ? value : new Decimal(value); +} + +export function fromDecimal(value: any): any { + if (value == null) { return value; } + if (Array.isArray(value)) { return value.map(fromDecimal); } + return value instanceof Decimal ? value.toNumber() : value; +} diff --git a/sync-for-payables/src/sdk.ts b/sync-for-payables/src/sdk.ts new file mode 100644 index 000000000..45da89a87 --- /dev/null +++ b/sync-for-payables/src/sdk.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Configuration, ConfigurationParameters } from './runtime'; +import type * as shared from './sdk/models/index'; +import { SDKOptions, resolveServerURL, resolveAuthHeader, resolveUserAgent, makeFetch, HTTPClient } from './lib/sdkconfig'; +import { SDKHooks } from './hooks/hooks'; +import { validateWebhook as runValidateWebhook } from './funcs/validateWebhook'; +import { + BankAccounts, + BillPayments, + Bills, + Companies, + CompanyInformation, + Connections, + Suppliers, +} from './apis/index'; + +export class CodatSyncPayables { + private readonly _config: Configuration; + + constructor(options: SDKOptions | ConfigurationParameters | Configuration = {}) { + if (options instanceof Configuration) { + this._config = options; + return; + } + const opts = options as SDKOptions & ConfigurationParameters; + const hooks = new SDKHooks(); + const baseURL = opts.basePath ?? resolveServerURL(opts); + let parsedBaseURL: URL | null = null; + try { parsedBaseURL = new URL(baseURL); } catch { parsedBaseURL = null; } + const init = hooks.sdkInit({ baseURL: parsedBaseURL, client: opts.httpClient ?? new HTTPClient() }); + const resolvedBaseURL = init.baseURL ? init.baseURL.toString().replace(/\/+$/, '') : baseURL; + this._config = new Configuration({ + ...opts, + basePath: resolvedBaseURL, + apiKey: opts.apiKey ?? resolveAuthHeader(opts.authHeader), + fetchApi: opts.fetchApi ?? makeFetch({ ...opts, httpClient: init.client }, hooks), + headers: { ...(opts.headers ?? {}), ...resolveUserAgent(opts.userAgent) }, + }); + } + + private _bankAccounts?: BankAccounts; + get bankAccounts(): BankAccounts { + if (!this._bankAccounts) { this._bankAccounts = new BankAccounts(this._config); } + return this._bankAccounts; + } + + private _billPayments?: BillPayments; + get billPayments(): BillPayments { + if (!this._billPayments) { this._billPayments = new BillPayments(this._config); } + return this._billPayments; + } + + private _bills?: Bills; + get bills(): Bills { + if (!this._bills) { this._bills = new Bills(this._config); } + return this._bills; + } + + private _companies?: Companies; + get companies(): Companies { + if (!this._companies) { this._companies = new Companies(this._config); } + return this._companies; + } + + private _companyInformation?: CompanyInformation; + get companyInformation(): CompanyInformation { + if (!this._companyInformation) { this._companyInformation = new CompanyInformation(this._config); } + return this._companyInformation; + } + + private _connections?: Connections; + get connections(): Connections { + if (!this._connections) { this._connections = new Connections(this._config); } + return this._connections; + } + + private _suppliers?: Suppliers; + get suppliers(): Suppliers { + if (!this._suppliers) { this._suppliers = new Suppliers(this._config); } + return this._suppliers; + } + + async validateWebhook(args: { request: { body: string; headers: Record | Headers; url: string; method: string; } | Request; }): Promise { + const outcome = await runValidateWebhook(this as never, { request: args.request }); + if (!outcome.ok) { throw outcome.error; } + return outcome.value; + } +} diff --git a/sync-for-payables/src/sdk/bankaccounts.ts b/sync-for-payables/src/sdk/bankaccounts.ts index 1c99cfa1e..911d7ba40 100644 --- a/sync-for-payables/src/sdk/bankaccounts.ts +++ b/sync-for-payables/src/sdk/bankaccounts.ts @@ -1,30 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bankAccountsCreate } from "../funcs/bankAccountsCreate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class BankAccounts extends ClientSDK { - /** - * Create bank account - * - * @remarks - * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - */ - async create( - request: operations.CreateBankAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(bankAccountsCreate( - this, - request, - options, - )); - } -} +export { BankAccounts } from "../apis/BankAccounts"; diff --git a/sync-for-payables/src/sdk/billpayments.ts b/sync-for-payables/src/sdk/billpayments.ts index 63591a205..6f8461eb0 100644 --- a/sync-for-payables/src/sdk/billpayments.ts +++ b/sync-for-payables/src/sdk/billpayments.ts @@ -1,52 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { billPaymentsCreate } from "../funcs/billPaymentsCreate.js"; -import { billPaymentsGetPaymentOptions } from "../funcs/billPaymentsGetPaymentOptions.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class BillPayments extends ClientSDK { - /** - * Get payment mapping options - * - * @remarks - * Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID. - * - * By default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - * - * Mapping options are a set of bank accounts used to configure the SMB's payables integration. - */ - async getPaymentOptions( - request: operations.GetMappingOptionsPaymentsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billPaymentsGetPaymentOptions( - this, - request, - options, - )); - } - - /** - * Create bill payment - * - * @remarks - * The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. - * - * [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. - */ - async create( - request: operations.CreateBillPaymentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billPaymentsCreate( - this, - request, - options, - )); - } -} +export { BillPayments } from "../apis/BillPayments"; diff --git a/sync-for-payables/src/sdk/bills.ts b/sync-for-payables/src/sdk/bills.ts index 37c217d48..4a939484e 100644 --- a/sync-for-payables/src/sdk/bills.ts +++ b/sync-for-payables/src/sdk/bills.ts @@ -1,167 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { billsCreate } from "../funcs/billsCreate.js"; -import { billsDownloadAttachment } from "../funcs/billsDownloadAttachment.js"; -import { billsGetBillOptions } from "../funcs/billsGetBillOptions.js"; -import { billsList } from "../funcs/billsList.js"; -import { billsListAttachments } from "../funcs/billsListAttachments.js"; -import { billsUpdate } from "../funcs/billsUpdate.js"; -import { billsUploadAttachment } from "../funcs/billsUploadAttachment.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Bills extends ClientSDK { - /** - * Get bill mapping options - * - * @remarks - * Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company's connection ID. - * - * By default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - * - * Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. - */ - async getBillOptions( - request: operations.GetMappingOptionsBillsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billsGetBillOptions( - this, - request, - options, - )); - } - - /** - * List bills - * - * @remarks - * The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - * - * By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. - */ - async list( - request: operations.ListBillsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billsList( - this, - request, - options, - )); - } - - /** - * Create bill - * - * @remarks - * The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - */ - async create( - request: operations.CreateBillRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billsCreate( - this, - request, - options, - )); - } - - /** - * Update bill - * - * @remarks - * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | No | - * | Sage Intacct | No | - * | Zoho Books | No | - */ - async update( - request: operations.UpdateBillRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billsUpdate( - this, - request, - options, - )); - } - - /** - * Upload bill attachment - * - * @remarks - * The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - */ - async uploadAttachment( - request: operations.UploadBillAttachmentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(billsUploadAttachment( - this, - request, - options, - )); - } - - /** - * List bill attachments - * - * @remarks - * The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - */ - async listAttachments( - request: operations.ListBillAttachmentsRequest, - options?: RequestOptions, - ): Promise> { - return unwrapAsync(billsListAttachments( - this, - request, - options, - )); - } - - /** - * Download bill attachment - * - * @remarks - * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. - * - * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - * - * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. - */ - async downloadAttachment( - request: operations.DownloadBillAttachmentRequest, - options?: RequestOptions, - ): Promise> { - return unwrapAsync(billsDownloadAttachment( - this, - request, - options, - )); - } -} +export { Bills } from "../apis/Bills"; diff --git a/sync-for-payables/src/sdk/companies.ts b/sync-for-payables/src/sdk/companies.ts index 26d34a940..4b89b1e24 100644 --- a/sync-for-payables/src/sdk/companies.ts +++ b/sync-for-payables/src/sdk/companies.ts @@ -1,152 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companiesCreate } from "../funcs/companiesCreate.js"; -import { companiesDelete } from "../funcs/companiesDelete.js"; -import { companiesGet } from "../funcs/companiesGet.js"; -import { companiesList } from "../funcs/companiesList.js"; -import { companiesReplace } from "../funcs/companiesReplace.js"; -import { companiesUpdate } from "../funcs/companiesUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Companies extends ClientSDK { - /** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ - async list( - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesList( - this, - request, - options, - )); - } - - /** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * 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`. - */ - async create( - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesCreate( - this, - request, - options, - )); - } - - /** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async replace( - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesReplace( - this, - request, - options, - )); - } - - /** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - */ - async update( - request: operations.UpdateCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesUpdate( - this, - request, - options, - )); - } - - /** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async delete( - request: operations.DeleteCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesDelete( - this, - request, - options, - )); - } - - /** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async get( - request: operations.GetCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGet( - this, - request, - options, - )); - } -} +export { Companies } from "../apis/Companies"; diff --git a/sync-for-payables/src/sdk/companyinformation.ts b/sync-for-payables/src/sdk/companyinformation.ts index 969ddf368..621d21495 100644 --- a/sync-for-payables/src/sdk/companyinformation.ts +++ b/sync-for-payables/src/sdk/companyinformation.ts @@ -1,28 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companyInformationGet } from "../funcs/companyInformationGet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CompanyInformation extends ClientSDK { - /** - * Get company information - * - * @remarks - * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. - */ - async get( - request: operations.GetCompanyInformationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companyInformationGet( - this, - request, - options, - )); - } -} +export { CompanyInformation } from "../apis/CompanyInformation"; diff --git a/sync-for-payables/src/sdk/connections.ts b/sync-for-payables/src/sdk/connections.ts index 9253cd633..9abd92e59 100644 --- a/sync-for-payables/src/sdk/connections.ts +++ b/sync-for-payables/src/sdk/connections.ts @@ -1,103 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { connectionsCreate } from "../funcs/connectionsCreate.js"; -import { connectionsDelete } from "../funcs/connectionsDelete.js"; -import { connectionsGet } from "../funcs/connectionsGet.js"; -import { connectionsList } from "../funcs/connectionsList.js"; -import { connectionsUnlink } from "../funcs/connectionsUnlink.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Connections extends ClientSDK { - /** - * List connections - * - * @remarks - * List the connections for a company. - */ - async list( - request: operations.ListConnectionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsList( - this, - request, - options, - )); - } - - /** - * Create connection - * - * @remarks - * 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. - */ - async create( - request: operations.CreateConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsCreate( - this, - request, - options, - )); - } - - /** - * Get connection - * - * @remarks - * 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. - */ - async get( - request: operations.GetConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsGet( - this, - request, - options, - )); - } - - /** - * Delete connection - * - * @remarks - * 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. - */ - async delete( - request: operations.DeleteConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsDelete( - this, - request, - options, - )); - } - - /** - * Unlink connection - * - * @remarks - * 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. - */ - async unlink( - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsUnlink( - this, - request, - options, - )); - } -} +export { Connections } from "../apis/Connections"; diff --git a/sync-for-payables/src/sdk/index.ts b/sync-for-payables/src/sdk/index.ts index ecac22648..d28eeda9d 100644 --- a/sync-for-payables/src/sdk/index.ts +++ b/sync-for-payables/src/sdk/index.ts @@ -1,5 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./sdk.js"; +export * from "./sdk"; diff --git a/sync-for-payables/src/sdk/models/BillEventPayload.ts b/sync-for-payables/src/sdk/models/BillEventPayload.ts new file mode 100644 index 000000000..f0d961ec3 --- /dev/null +++ b/sync-for-payables/src/sdk/models/BillEventPayload.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { Bill } from './shared/bill'; +import { + BillFromJSON, + BillFromJSONTyped, + BillToJSON, + BillToJSONTyped, +} from './shared/bill'; + +/** + * + * @export + * @interface BillEventPayload + */ +export interface BillEventPayload { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof BillEventPayload + */ + companyId?: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof BillEventPayload + */ + connectionId?: string; + /** + * Unique identifier for the push operation. + * @type {string} + * @memberof BillEventPayload + */ + pushOperationKey?: string; + /** + * + * @type {Bill} + * @memberof BillEventPayload + */ + bill?: Bill; +} + +/** + * Check if a given object implements the BillEventPayload interface. + */ +export function instanceOfBillEventPayload(value: object): value is BillEventPayload { + return true; +} + +export function BillEventPayloadFromJSON(json: any): BillEventPayload { + return BillEventPayloadFromJSONTyped(json, false); +} + +export function BillEventPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillEventPayload { + if (json == null) { + return json; + } + return { + + 'companyId': json['companyId'] == null ? undefined : json['companyId'], + 'connectionId': json['connectionId'] == null ? undefined : json['connectionId'], + 'pushOperationKey': json['pushOperationKey'] == null ? undefined : json['pushOperationKey'], + 'bill': json['bill'] == null ? undefined : BillFromJSON(json['bill']), + }; +} + +export function BillEventPayloadToJSON(json: any): BillEventPayload { + return BillEventPayloadToJSONTyped(json, false); +} + +export function BillEventPayloadToJSONTyped(value?: BillEventPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyId': value['companyId'], + 'connectionId': value['connectionId'], + 'pushOperationKey': value['pushOperationKey'], + 'bill': BillToJSON(value['bill']), + }; +} + + +export interface BillEventWebhookBillEventPayload { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof BillEventPayload + */ + companyId?: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof BillEventPayload + */ + connectionId?: string; + /** + * Unique identifier for the push operation. + * @type {string} + * @memberof BillEventPayload + */ + pushOperationKey?: string; + /** + * + * @type {Bill} + * @memberof BillEventPayload + */ + bill?: Bill; +} diff --git a/sync-for-payables/src/sdk/models/BillEventWebhook.ts b/sync-for-payables/src/sdk/models/BillEventWebhook.ts new file mode 100644 index 000000000..8f1dd7e6d --- /dev/null +++ b/sync-for-payables/src/sdk/models/BillEventWebhook.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { BillEventPayload } from './BillEventPayload'; +import { + BillEventPayloadFromJSON, + BillEventPayloadFromJSONTyped, + BillEventPayloadToJSON, + BillEventPayloadToJSONTyped, +} from './BillEventPayload'; + +/** + * + * @export + * @interface BillEventWebhook + */ +export interface BillEventWebhook { + /** + * Unique identifier of the bill event. + * @type {string} + * @memberof BillEventWebhook + */ + id?: string; + /** + * Type of webhook event. + * @type {string} + * @memberof BillEventWebhook + */ + type?: string; + /** + * The datetime in UTC of when the webhook event was produced by Codat. + * @type {string} + * @memberof BillEventWebhook + */ + createdDate?: string; + /** + * + * @type {BillEventPayload} + * @memberof BillEventWebhook + */ + payload?: BillEventPayload; +} + +/** + * Check if a given object implements the BillEventWebhook interface. + */ +export function instanceOfBillEventWebhook(value: object): value is BillEventWebhook { + return true; +} + +export function BillEventWebhookFromJSON(json: any): BillEventWebhook { + return BillEventWebhookFromJSONTyped(json, false); +} + +export function BillEventWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillEventWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'type': json['type'] == null ? undefined : json['type'], + 'createdDate': json['createdDate'] == null ? undefined : json['createdDate'], + 'payload': json['payload'] == null ? undefined : BillEventPayloadFromJSON(json['payload']), + }; +} + +export function BillEventWebhookToJSON(json: any): BillEventWebhook { + return BillEventWebhookToJSONTyped(json, false); +} + +export function BillEventWebhookToJSONTyped(value?: BillEventWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'type': value['type'], + 'createdDate': value['createdDate'], + 'payload': BillEventPayloadToJSON(value['payload']), + }; +} + diff --git a/sync-for-payables/src/sdk/models/CompanyDetails.ts b/sync-for-payables/src/sdk/models/CompanyDetails.ts new file mode 100644 index 000000000..baadcf322 --- /dev/null +++ b/sync-for-payables/src/sdk/models/CompanyDetails.ts @@ -0,0 +1,1452 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { CompanyReference } from './shared/companyreference'; +import { + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './shared/companyreference'; + +/** + * + * @export + * @interface CompanyDetails + */ +export interface CompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +/** + * Check if a given object implements the CompanyDetails interface. + */ +export function instanceOfCompanyDetails(value: object): value is CompanyDetails { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyDetailsFromJSON(json: any): CompanyDetails { + return CompanyDetailsFromJSONTyped(json, false); +} + +export function CompanyDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + }; +} + +export function CompanyDetailsToJSON(json: any): CompanyDetails { + return CompanyDetailsToJSONTyped(json, false); +} + +export function CompanyDetailsToJSONTyped(value?: CompanyDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + }; +} + + +export interface CompaniesCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompaniesListResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCreateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyGetResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyReplaceResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyUpdateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CreateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface GetCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ListCompaniesResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ReplaceCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface UpdateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * 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 {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} diff --git a/sync-for-payables/src/sdk/models/CreateCompanyRequest.ts b/sync-for-payables/src/sdk/models/CreateCompanyRequest.ts new file mode 100644 index 000000000..ec06f2e2e --- /dev/null +++ b/sync-for-payables/src/sdk/models/CreateCompanyRequest.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ + +import type { CompanyRequestBody } from './shared/companyrequestbody'; +/* eslint-disable */ + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} + +export interface CompanyRequestBodyCreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} diff --git a/sync-for-payables/src/sdk/models/DataStatus.ts b/sync-for-payables/src/sdk/models/DataStatus.ts new file mode 100644 index 000000000..d62a344a4 --- /dev/null +++ b/sync-for-payables/src/sdk/models/DataStatus.ts @@ -0,0 +1,201 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { DataTypes } from './_speakeasy_enums'; +import type { Bills } from './shared/bills'; +import type { Company } from './shared/company'; +import type { Suppliers } from './shared/suppliers'; +import { mapValues } from '../../runtime'; +/** + * Describes the state of data in the Codat cache for a company and data type + * @export + * @interface DataStatus + */ +export interface DataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * 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 {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: DataStatusCurrentStatusEnum; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; +} + + +/** + * @export + */ +export const DataStatusDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type DataStatusDataTypeEnum = typeof DataStatusDataTypeEnum[keyof typeof DataStatusDataTypeEnum]; + +/** + * @export + */ +export const DataStatusCurrentStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type DataStatusCurrentStatusEnum = typeof DataStatusCurrentStatusEnum[keyof typeof DataStatusCurrentStatusEnum]; + + +/** + * Check if a given object implements the DataStatus interface. + */ +export function instanceOfDataStatus(value: object): value is DataStatus { + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('currentStatus' in value) || value['currentStatus'] === undefined) return false; + return true; +} + +export function DataStatusFromJSON(json: any): DataStatus { + return DataStatusFromJSONTyped(json, false); +} + +export function DataStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataStatus { + if (json == null) { + return json; + } + return { + + 'dataType': json['dataType'], + 'lastSuccessfulSync': json['lastSuccessfulSync'] == null ? undefined : json['lastSuccessfulSync'], + 'currentStatus': json['currentStatus'], + 'latestSyncId': json['latestSyncId'] == null ? undefined : json['latestSyncId'], + 'latestSuccessfulSyncId': json['latestSuccessfulSyncId'] == null ? undefined : json['latestSuccessfulSyncId'], + }; +} + +export function DataStatusToJSON(json: any): DataStatus { + return DataStatusToJSONTyped(json, false); +} + +export function DataStatusToJSONTyped(value?: DataStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataType': value['dataType'], + 'lastSuccessfulSync': value['lastSuccessfulSync'], + 'currentStatus': value['currentStatus'], + 'latestSyncId': value['latestSyncId'], + 'latestSuccessfulSyncId': value['latestSuccessfulSyncId'], + }; +} + diff --git a/sync-for-payables/src/sdk/models/ErrorMessage.ts b/sync-for-payables/src/sdk/models/ErrorMessage.ts new file mode 100644 index 000000000..f80aea48c --- /dev/null +++ b/sync-for-payables/src/sdk/models/ErrorMessage.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { ErrorValidation } from './shared/errorvalidation'; +import { + ErrorValidationFromJSON, + ErrorValidationFromJSONTyped, + ErrorValidationToJSON, + ErrorValidationToJSONTyped, +} from './shared/errorvalidation'; + +/** + * + * @export + * @interface ErrorMessage + */ +export interface ErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +/** + * Check if a given object implements the ErrorMessage interface. + */ +export function instanceOfErrorMessage(value: object): value is ErrorMessage { + return true; +} + +export function ErrorMessageFromJSON(json: any): ErrorMessage { + return ErrorMessageFromJSONTyped(json, false); +} + +export function ErrorMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorMessage { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'service': json['service'] == null ? undefined : json['service'], + 'error': json['error'] == null ? undefined : json['error'], + 'correlationId': json['correlationId'] == null ? undefined : json['correlationId'], + 'validation': json['validation'] == null ? undefined : ErrorValidationFromJSON(json['validation']), + 'canBeRetried': json['canBeRetried'] == null ? undefined : json['canBeRetried'], + 'detailedErrorCode': json['detailedErrorCode'] == null ? undefined : json['detailedErrorCode'], + }; +} + +export function ErrorMessageToJSON(json: any): ErrorMessage { + return ErrorMessageToJSONTyped(json, false); +} + +export function ErrorMessageToJSONTyped(value?: ErrorMessage | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'service': value['service'], + 'error': value['error'], + 'correlationId': value['correlationId'], + 'validation': ErrorValidationToJSON(value['validation']), + 'canBeRetried': value['canBeRetried'], + 'detailedErrorCode': value['detailedErrorCode'], + }; +} + + +export interface ErrorMessageData { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} diff --git a/sync-for-payables/src/sdk/models/PagingInfo.ts b/sync-for-payables/src/sdk/models/PagingInfo.ts new file mode 100644 index 000000000..763e49647 --- /dev/null +++ b/sync-for-payables/src/sdk/models/PagingInfo.ts @@ -0,0 +1,587 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; + +/** + * + * @export + * @interface PagingInfo + */ +export interface PagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +/** + * Check if a given object implements the PagingInfo interface. + */ +export function instanceOfPagingInfo(value: object): value is PagingInfo { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PagingInfoFromJSON(json: any): PagingInfo { + return PagingInfoFromJSONTyped(json, false); +} + +export function PagingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PagingInfo { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + }; +} + +export function PagingInfoToJSON(json: any): PagingInfo { + return PagingInfoToJSONTyped(json, false); +} + +export function PagingInfoToJSONTyped(value?: PagingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + }; +} + + +export interface CompaniesListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCompaniesResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCompaniesResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListConnectionsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListConnectionsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PagingInfoPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} diff --git a/sync-for-payables/src/sdk/models/PullOperation.ts b/sync-for-payables/src/sdk/models/PullOperation.ts new file mode 100644 index 000000000..d7ac9d29c --- /dev/null +++ b/sync-for-payables/src/sdk/models/PullOperation.ts @@ -0,0 +1,341 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { DatasetStatus } from './_speakeasy_enums'; +import { mapValues } from '../../runtime'; +/** + * Information about a queued, in progress or completed pull operation. + * *Formally called `dataset`* + * @export + * @interface PullOperation + */ +export interface PullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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 {string} + * @memberof PullOperation + */ + requested: string; + /** + * 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 {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + + +/** + * @export + */ +export const PullOperationStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type PullOperationStatusEnum = typeof PullOperationStatusEnum[keyof typeof PullOperationStatusEnum]; + + +/** + * Check if a given object implements the PullOperation interface. + */ +export function instanceOfPullOperation(value: object): value is PullOperation { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('connectionId' in value) || value['connectionId'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('requested' in value) || value['requested'] === undefined) return false; + if (!('progress' in value) || value['progress'] === undefined) return false; + if (!('isCompleted' in value) || value['isCompleted'] === undefined) return false; + if (!('isErrored' in value) || value['isErrored'] === undefined) return false; + return true; +} + +export function PullOperationFromJSON(json: any): PullOperation { + return PullOperationFromJSONTyped(json, false); +} + +export function PullOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperation { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'companyId': json['companyId'], + 'connectionId': json['connectionId'], + 'dataType': json['dataType'], + 'status': json['status'], + 'statusDescription': json['statusDescription'] == null ? undefined : json['statusDescription'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'requested': json['requested'], + 'completed': json['completed'] == null ? undefined : json['completed'], + 'progress': json['progress'], + 'isCompleted': json['isCompleted'], + 'isErrored': json['isErrored'], + }; +} + +export function PullOperationToJSON(json: any): PullOperation { + return PullOperationToJSONTyped(json, false); +} + +export function PullOperationToJSONTyped(value?: PullOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'companyId': value['companyId'], + 'connectionId': value['connectionId'], + 'dataType': value['dataType'], + 'status': value['status'], + 'statusDescription': value['statusDescription'], + 'errorMessage': value['errorMessage'], + 'requested': value['requested'], + 'completed': value['completed'], + 'progress': value['progress'], + 'isCompleted': value['isCompleted'], + 'isErrored': value['isErrored'], + }; +} + + +export interface PullOperationsPullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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 {string} + * @memberof PullOperation + */ + requested: string; + /** + * 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 {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} diff --git a/sync-for-payables/src/sdk/models/PullOperations.ts b/sync-for-payables/src/sdk/models/PullOperations.ts new file mode 100644 index 000000000..674b132b8 --- /dev/null +++ b/sync-for-payables/src/sdk/models/PullOperations.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { PullOperation } from './PullOperation'; +import { + PullOperationFromJSON, + PullOperationFromJSONTyped, + PullOperationToJSON, + PullOperationToJSONTyped, +} from './PullOperation'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; + +/** + * + * @export + * @interface PullOperations + */ +export interface PullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PullOperations interface. + */ +export function instanceOfPullOperations(value: object): value is PullOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PullOperationsFromJSON(json: any): PullOperations { + return PullOperationsFromJSONTyped(json, false); +} + +export function PullOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PullOperationFromJSON)), + }; +} + +export function PullOperationsToJSON(json: any): PullOperations { + return PullOperationsToJSONTyped(json, false); +} + +export function PullOperationsToJSONTyped(value?: PullOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PullOperationToJSON)), + }; +} + diff --git a/sync-for-payables/src/sdk/models/PushChangeType.ts b/sync-for-payables/src/sdk/models/PushChangeType.ts new file mode 100644 index 000000000..7c81ce05d --- /dev/null +++ b/sync-for-payables/src/sdk/models/PushChangeType.ts @@ -0,0 +1,56 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Type of change being applied to record in third party platform. + * @export + */ +export const PushChangeType = { + Unknown: 'Unknown', + Created: 'Created', + Modified: 'Modified', + Deleted: 'Deleted', + AttachmentUploaded: 'AttachmentUploaded' +} as const; +export type PushChangeType = typeof PushChangeType[keyof typeof PushChangeType]; + + +export function instanceOfPushChangeType(value: any): boolean { + for (const key in PushChangeType) { + if (Object.prototype.hasOwnProperty.call(PushChangeType, key)) { + if (PushChangeType[key as keyof typeof PushChangeType] === value) { + return true; + } + } + } + return false; +} + +export function PushChangeTypeFromJSON(json: any): PushChangeType { + return PushChangeTypeFromJSONTyped(json, false); +} + +export function PushChangeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushChangeType { + return json as PushChangeType; +} + +export function PushChangeTypeToJSON(value?: PushChangeType | null): any { + return value as any; +} + +export function PushChangeTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushChangeType { + return value as PushChangeType; +} + diff --git a/sync-for-payables/src/sdk/models/PushOperation.ts b/sync-for-payables/src/sdk/models/PushOperation.ts new file mode 100644 index 000000000..99207866f --- /dev/null +++ b/sync-for-payables/src/sdk/models/PushOperation.ts @@ -0,0 +1,399 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Bills } from './shared/bills'; +import type { Company } from './shared/company'; +import type { Suppliers } from './shared/suppliers'; +import { mapValues } from '../../runtime'; +import type { Validation } from './Validation'; +import { + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './Validation'; +import type { PushOperationStatus } from './PushOperationStatus'; +import { + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './PushOperationStatus'; +import type { PushOperationChange } from './PushOperationChange'; +import { + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './PushOperationChange'; + +/** + * + * @export + * @interface PushOperation + */ +export interface PushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * 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 {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * 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 {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + + +/** + * @export + */ +export const PushOperationDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type PushOperationDataTypeEnum = typeof PushOperationDataTypeEnum[keyof typeof PushOperationDataTypeEnum]; + + +/** + * Check if a given object implements the PushOperation interface. + */ +export function instanceOfPushOperation(value: object): value is PushOperation { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function PushOperationFromJSON(json: any): PushOperation { + return PushOperationFromJSONTyped(json, false); +} + +export function PushOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperation { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + }; +} + +export function PushOperationToJSON(json: any): PushOperation { + return PushOperationToJSONTyped(json, false); +} + +export function PushOperationToJSONTyped(value?: PushOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + }; +} + + +export interface PushOperationsPushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * 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 {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * 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 {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} diff --git a/sync-for-payables/src/sdk/models/PushOperationChange.ts b/sync-for-payables/src/sdk/models/PushOperationChange.ts new file mode 100644 index 000000000..7167b6e42 --- /dev/null +++ b/sync-for-payables/src/sdk/models/PushOperationChange.ts @@ -0,0 +1,119 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { PushChangeType } from './PushChangeType'; +import { + PushChangeTypeFromJSON, + PushChangeTypeFromJSONTyped, + PushChangeTypeToJSON, + PushChangeTypeToJSONTyped, +} from './PushChangeType'; +import type { PushOperationRef } from './PushOperationRef'; +import { + PushOperationRefFromJSON, + PushOperationRefFromJSONTyped, + PushOperationRefToJSON, + PushOperationRefToJSONTyped, +} from './PushOperationRef'; + +/** + * + * @export + * @interface PushOperationChange + */ +export interface PushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + + + +/** + * Check if a given object implements the PushOperationChange interface. + */ +export function instanceOfPushOperationChange(value: object): value is PushOperationChange { + return true; +} + +export function PushOperationChangeFromJSON(json: any): PushOperationChange { + return PushOperationChangeFromJSONTyped(json, false); +} + +export function PushOperationChangeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationChange { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : PushChangeTypeFromJSON(json['type']), + 'recordRef': json['recordRef'] == null ? undefined : PushOperationRefFromJSON(json['recordRef']), + 'attachmentId': json['attachmentId'] == null ? undefined : json['attachmentId'], + }; +} + +export function PushOperationChangeToJSON(json: any): PushOperationChange { + return PushOperationChangeToJSONTyped(json, false); +} + +export function PushOperationChangeToJSONTyped(value?: PushOperationChange | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushChangeTypeToJSON(value['type']), + 'recordRef': PushOperationRefToJSON(value['recordRef']), + 'attachmentId': value['attachmentId'], + }; +} + + +export interface PushOperationPushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} diff --git a/sync-for-payables/src/sdk/models/PushOperationRef.ts b/sync-for-payables/src/sdk/models/PushOperationRef.ts new file mode 100644 index 000000000..bb912b655 --- /dev/null +++ b/sync-for-payables/src/sdk/models/PushOperationRef.ts @@ -0,0 +1,147 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Bills } from './shared/bills'; +import type { Company } from './shared/company'; +import type { Suppliers } from './shared/suppliers'; +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface PushOperationRef + */ +export interface PushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PushOperationRefDataTypeEnum; +} + + +/** + * @export + */ +export const PushOperationRefDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type PushOperationRefDataTypeEnum = typeof PushOperationRefDataTypeEnum[keyof typeof PushOperationRefDataTypeEnum]; + + +/** + * Check if a given object implements the PushOperationRef interface. + */ +export function instanceOfPushOperationRef(value: object): value is PushOperationRef { + return true; +} + +export function PushOperationRefFromJSON(json: any): PushOperationRef { + return PushOperationRefFromJSONTyped(json, false); +} + +export function PushOperationRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationRef { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + }; +} + +export function PushOperationRefToJSON(json: any): PushOperationRef { + return PushOperationRefToJSONTyped(json, false); +} + +export function PushOperationRefToJSONTyped(value?: PushOperationRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'dataType': value['dataType'], + }; +} + + +export interface PushOperationPushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PushOperationRefDataTypeEnum; +} diff --git a/sync-for-payables/src/sdk/models/PushOperationStatus.ts b/sync-for-payables/src/sdk/models/PushOperationStatus.ts new file mode 100644 index 000000000..b019ca454 --- /dev/null +++ b/sync-for-payables/src/sdk/models/PushOperationStatus.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * The current status of the push operation. + * @export + */ +export const PushOperationStatus = { + Pending: 'Pending', + Failed: 'Failed', + Success: 'Success', + TimedOut: 'TimedOut' +} as const; +export type PushOperationStatus = typeof PushOperationStatus[keyof typeof PushOperationStatus]; + + +export function instanceOfPushOperationStatus(value: any): boolean { + for (const key in PushOperationStatus) { + if (Object.prototype.hasOwnProperty.call(PushOperationStatus, key)) { + if (PushOperationStatus[key as keyof typeof PushOperationStatus] === value) { + return true; + } + } + } + return false; +} + +export function PushOperationStatusFromJSON(json: any): PushOperationStatus { + return PushOperationStatusFromJSONTyped(json, false); +} + +export function PushOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationStatus { + return json as PushOperationStatus; +} + +export function PushOperationStatusToJSON(value?: PushOperationStatus | null): any { + return value as any; +} + +export function PushOperationStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOperationStatus { + return value as PushOperationStatus; +} + diff --git a/sync-for-payables/src/sdk/models/PushOperations.ts b/sync-for-payables/src/sdk/models/PushOperations.ts new file mode 100644 index 000000000..e195eb161 --- /dev/null +++ b/sync-for-payables/src/sdk/models/PushOperations.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; +import type { PushOperation } from './PushOperation'; +import { + PushOperationFromJSON, + PushOperationFromJSONTyped, + PushOperationToJSON, + PushOperationToJSONTyped, +} from './PushOperation'; + +/** + * + * @export + * @interface PushOperations + */ +export interface PushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PushOperations interface. + */ +export function instanceOfPushOperations(value: object): value is PushOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PushOperationsFromJSON(json: any): PushOperations { + return PushOperationsFromJSONTyped(json, false); +} + +export function PushOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PushOperationFromJSON)), + }; +} + +export function PushOperationsToJSON(json: any): PushOperations { + return PushOperationsToJSONTyped(json, false); +} + +export function PushOperationsToJSONTyped(value?: PushOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PushOperationToJSON)), + }; +} + diff --git a/sync-for-payables/src/sdk/models/SourceModifiedDate.ts b/sync-for-payables/src/sdk/models/SourceModifiedDate.ts new file mode 100644 index 000000000..b3f669954 --- /dev/null +++ b/sync-for-payables/src/sdk/models/SourceModifiedDate.ts @@ -0,0 +1,277 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface SourceModifiedDate + */ +export interface SourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +/** + * Check if a given object implements the SourceModifiedDate interface. + */ +export function instanceOfSourceModifiedDate(value: object): value is SourceModifiedDate { + return true; +} + +export function SourceModifiedDateFromJSON(json: any): SourceModifiedDate { + return SourceModifiedDateFromJSONTyped(json, false); +} + +export function SourceModifiedDateFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceModifiedDate { + if (json == null) { + return json; + } + return { + + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function SourceModifiedDateToJSON(json: any): SourceModifiedDate { + return SourceModifiedDateToJSONTyped(json, false); +} + +export function SourceModifiedDateToJSONTyped(value?: SourceModifiedDate | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface BankAccountCreateResponseSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface BankAccountSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface BankAccountsSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface BillMappingOptionsSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface CreateBankAccountResponseSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface GetMappingOptionsBillsResponseSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface GetMappingOptionsPaymentsResponseSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface MappingOptionsBillsGetResponseSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface MappingOptionsBillsSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface MappingOptionsPaymentsGetResponseSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface MappingOptionsPaymentsSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} + +export interface PaymentMappingOptionsSourceModifiedDate { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof SourceModifiedDate + */ + sourceModifiedDate?: string; +} diff --git a/sync-for-payables/src/sdk/models/Status.ts b/sync-for-payables/src/sdk/models/Status.ts new file mode 100644 index 000000000..8899d9995 --- /dev/null +++ b/sync-for-payables/src/sdk/models/Status.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * The current status of the dataset. + * @export + */ +export const Status = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type Status = typeof Status[keyof typeof Status]; + + +export function instanceOfStatus(value: any): boolean { + for (const key in Status) { + if (Object.prototype.hasOwnProperty.call(Status, key)) { + if (Status[key as keyof typeof Status] === value) { + return true; + } + } + } + return false; +} + +export function StatusFromJSON(json: any): Status { + return StatusFromJSONTyped(json, false); +} + +export function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status { + return json as Status; +} + +export function StatusToJSON(value?: Status | null): any { + return value as any; +} + +export function StatusToJSONTyped(value: any, ignoreDiscriminator: boolean): Status { + return value as Status; +} + diff --git a/sync-for-payables/src/sdk/models/UpdateConnection.ts b/sync-for-payables/src/sdk/models/UpdateConnection.ts new file mode 100644 index 000000000..7df4d6349 --- /dev/null +++ b/sync-for-payables/src/sdk/models/UpdateConnection.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { DataConnectionStatus } from './shared/dataconnectionstatus'; +import { + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './shared/dataconnectionstatus'; + +/** + * + * @export + * @interface UpdateConnection + */ +export interface UpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + + + +/** + * Check if a given object implements the UpdateConnection interface. + */ +export function instanceOfUpdateConnection(value: object): value is UpdateConnection { + return true; +} + +export function UpdateConnectionFromJSON(json: any): UpdateConnection { + return UpdateConnectionFromJSONTyped(json, false); +} + +export function UpdateConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateConnection { + if (json == null) { + return json; + } + return { + + ...json, + 'status': json['status'] == null ? undefined : DataConnectionStatusFromJSON(json['status']), + }; +} + +export function UpdateConnectionToJSON(json: any): UpdateConnection { + return UpdateConnectionToJSONTyped(json, false); +} + +export function UpdateConnectionToJSONTyped(value?: UpdateConnection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'status': DataConnectionStatusToJSON(value['status']), + }; +} + + +export interface ConnectionUnlinkRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionUpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} diff --git a/sync-for-payables/src/sdk/models/Validation.ts b/sync-for-payables/src/sdk/models/Validation.ts new file mode 100644 index 000000000..f3b01a177 --- /dev/null +++ b/sync-for-payables/src/sdk/models/Validation.ts @@ -0,0 +1,111 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { ValidationItem } from './ValidationItem'; +import { + ValidationItemFromJSON, + ValidationItemFromJSONTyped, + ValidationItemToJSON, + ValidationItemToJSONTyped, +} from './ValidationItem'; + +/** + * 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. + * @export + * @interface Validation + */ +export interface Validation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the Validation interface. + */ +export function instanceOfValidation(value: object): value is Validation { + return true; +} + +export function ValidationFromJSON(json: any): Validation { + return ValidationFromJSONTyped(json, false); +} + +export function ValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ValidationItemFromJSON)), + }; +} + +export function ValidationToJSON(json: any): Validation { + return ValidationToJSONTyped(json, false); +} + +export function ValidationToJSONTyped(value?: Validation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ValidationItemToJSON)), + }; +} + + +export interface PushOperationValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationsValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} diff --git a/sync-for-payables/src/sdk/models/ValidationItem.ts b/sync-for-payables/src/sdk/models/ValidationItem.ts new file mode 100644 index 000000000..183c596e7 --- /dev/null +++ b/sync-for-payables/src/sdk/models/ValidationItem.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface ValidationItem + */ +export interface ValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ValidationItem interface. + */ +export function instanceOfValidationItem(value: object): value is ValidationItem { + return true; +} + +export function ValidationItemFromJSON(json: any): ValidationItem { + return ValidationItemFromJSONTyped(json, false); +} + +export function ValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationItem { + if (json == null) { + return json; + } + return { + + ...json, + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ValidationItemToJSON(json: any): ValidationItem { + return ValidationItemToJSONTyped(json, false); +} + +export function ValidationItemToJSONTyped(value?: ValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface PushOperationValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} diff --git a/sync-for-payables/src/sdk/models/_speakeasy_enums.ts b/sync-for-payables/src/sdk/models/_speakeasy_enums.ts new file mode 100644 index 000000000..7c39f0e20 --- /dev/null +++ b/sync-for-payables/src/sdk/models/_speakeasy_enums.ts @@ -0,0 +1,3285 @@ +/* tslint:disable */ +/* eslint-disable */ + +export const AccountMappingOptionBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type AccountMappingOptionBankAccountStatus = (typeof AccountMappingOptionBankAccountStatus)[keyof typeof AccountMappingOptionBankAccountStatus]; +export const AccountMappingOptionStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type AccountMappingOptionStatusBankAccountStatus = (typeof AccountMappingOptionStatusBankAccountStatus)[keyof typeof AccountMappingOptionStatusBankAccountStatus]; +export const AccountStatusAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type AccountStatusAccountStatus = (typeof AccountStatusAccountStatus)[keyof typeof AccountStatusAccountStatus]; +export const AccountStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type AccountStatusBankAccountStatus = (typeof AccountStatusBankAccountStatus)[keyof typeof AccountStatusBankAccountStatus]; +export const AccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountTypeBankAccountType = (typeof AccountTypeBankAccountType)[keyof typeof AccountTypeBankAccountType]; +export const AddressAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type AddressAddressType = (typeof AddressAddressType)[keyof typeof AddressAddressType]; +export const AddressTypeAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type AddressTypeAddressType = (typeof AddressTypeAddressType)[keyof typeof AddressTypeAddressType]; +export const AddressesAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type AddressesAddressType = (typeof AddressesAddressType)[keyof typeof AddressesAddressType]; +export const BankAccountAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountAccountTypeBankAccountType = (typeof BankAccountAccountTypeBankAccountType)[keyof typeof BankAccountAccountTypeBankAccountType]; +export const BankAccountBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type BankAccountBankAccountStatus = (typeof BankAccountBankAccountStatus)[keyof typeof BankAccountBankAccountStatus]; +export const BankAccountBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountBankAccountType = (typeof BankAccountBankAccountType)[keyof typeof BankAccountBankAccountType]; +export const BankAccountMappingOptionAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountMappingOptionAccountTypeBankAccountType = (typeof BankAccountMappingOptionAccountTypeBankAccountType)[keyof typeof BankAccountMappingOptionAccountTypeBankAccountType]; +export const BankAccountMappingOptionBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type BankAccountMappingOptionBankAccountStatus = (typeof BankAccountMappingOptionBankAccountStatus)[keyof typeof BankAccountMappingOptionBankAccountStatus]; +export const BankAccountMappingOptionBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountMappingOptionBankAccountType = (typeof BankAccountMappingOptionBankAccountType)[keyof typeof BankAccountMappingOptionBankAccountType]; +export const BankAccountMappingOptionStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type BankAccountMappingOptionStatusBankAccountStatus = (typeof BankAccountMappingOptionStatusBankAccountStatus)[keyof typeof BankAccountMappingOptionStatusBankAccountStatus]; +export const BankAccountPrototypeAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeAccountTypeBankAccountType = (typeof BankAccountPrototypeAccountTypeBankAccountType)[keyof typeof BankAccountPrototypeAccountTypeBankAccountType]; +export const BankAccountPrototypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeBankAccountType = (typeof BankAccountPrototypeBankAccountType)[keyof typeof BankAccountPrototypeBankAccountType]; +export const BankAccountStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type BankAccountStatusBankAccountStatus = (typeof BankAccountStatusBankAccountStatus)[keyof typeof BankAccountStatusBankAccountStatus]; +export const BankAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountTypeBankAccountType = (typeof BankAccountTypeBankAccountType)[keyof typeof BankAccountTypeBankAccountType]; +export const BillBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillBillStatus = (typeof BillBillStatus)[keyof typeof BillBillStatus]; +export const BillDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillDataType = (typeof BillDataType)[keyof typeof BillDataType]; +export const BillEventPayloadBillBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillEventPayloadBillBillStatus = (typeof BillEventPayloadBillBillStatus)[keyof typeof BillEventPayloadBillBillStatus]; +export const BillEventPayloadBillDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillEventPayloadBillDataType = (typeof BillEventPayloadBillDataType)[keyof typeof BillEventPayloadBillDataType]; +export const BillEventPayloadBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillEventPayloadBillStatus = (typeof BillEventPayloadBillStatus)[keyof typeof BillEventPayloadBillStatus]; +export const BillEventPayloadDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillEventPayloadDataType = (typeof BillEventPayloadDataType)[keyof typeof BillEventPayloadDataType]; +export const BillEventPayloadStatusBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillEventPayloadStatusBillStatus = (typeof BillEventPayloadStatusBillStatus)[keyof typeof BillEventPayloadStatusBillStatus]; +export const BillEventPayloadTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillEventPayloadTrackingRefsDataType = (typeof BillEventPayloadTrackingRefsDataType)[keyof typeof BillEventPayloadTrackingRefsDataType]; +export const BillEventWebhookBillBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillEventWebhookBillBillStatus = (typeof BillEventWebhookBillBillStatus)[keyof typeof BillEventWebhookBillBillStatus]; +export const BillEventWebhookBillDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillEventWebhookBillDataType = (typeof BillEventWebhookBillDataType)[keyof typeof BillEventWebhookBillDataType]; +export const BillEventWebhookBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillEventWebhookBillStatus = (typeof BillEventWebhookBillStatus)[keyof typeof BillEventWebhookBillStatus]; +export const BillEventWebhookDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillEventWebhookDataType = (typeof BillEventWebhookDataType)[keyof typeof BillEventWebhookDataType]; +export const BillEventWebhookStatusBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillEventWebhookStatusBillStatus = (typeof BillEventWebhookStatusBillStatus)[keyof typeof BillEventWebhookStatusBillStatus]; +export const BillEventWebhookTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillEventWebhookTrackingRefsDataType = (typeof BillEventWebhookTrackingRefsDataType)[keyof typeof BillEventWebhookTrackingRefsDataType]; +export const BillLineItemDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillLineItemDataType = (typeof BillLineItemDataType)[keyof typeof BillLineItemDataType]; +export const BillLineItemTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillLineItemTrackingRefsDataType = (typeof BillLineItemTrackingRefsDataType)[keyof typeof BillLineItemTrackingRefsDataType]; +export const BillMappingOptionsBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type BillMappingOptionsBankAccountStatus = (typeof BillMappingOptionsBankAccountStatus)[keyof typeof BillMappingOptionsBankAccountStatus]; +export const BillMappingOptionsStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type BillMappingOptionsStatusBankAccountStatus = (typeof BillMappingOptionsStatusBankAccountStatus)[keyof typeof BillMappingOptionsStatusBankAccountStatus]; +export const BillPrototypeBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillPrototypeBillStatus = (typeof BillPrototypeBillStatus)[keyof typeof BillPrototypeBillStatus]; +export const BillPrototypeDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillPrototypeDataType = (typeof BillPrototypeDataType)[keyof typeof BillPrototypeDataType]; +export const BillPrototypeStatusBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillPrototypeStatusBillStatus = (typeof BillPrototypeStatusBillStatus)[keyof typeof BillPrototypeStatusBillStatus]; +export const BillPrototypeTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillPrototypeTrackingRefsDataType = (typeof BillPrototypeTrackingRefsDataType)[keyof typeof BillPrototypeTrackingRefsDataType]; +export const BillResultsBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillResultsBillStatus = (typeof BillResultsBillStatus)[keyof typeof BillResultsBillStatus]; +export const BillResultsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillResultsDataType = (typeof BillResultsDataType)[keyof typeof BillResultsDataType]; +export const BillStatusBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillStatusBillStatus = (typeof BillStatusBillStatus)[keyof typeof BillStatusBillStatus]; +export const BillTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillTrackingRefsDataType = (typeof BillTrackingRefsDataType)[keyof typeof BillTrackingRefsDataType]; +export const BillsBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillsBillStatus = (typeof BillsBillStatus)[keyof typeof BillsBillStatus]; +export const BillsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillsDataType = (typeof BillsDataType)[keyof typeof BillsDataType]; +export const BillsResultsBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillsResultsBillStatus = (typeof BillsResultsBillStatus)[keyof typeof BillsResultsBillStatus]; +export const BillsResultsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillsResultsDataType = (typeof BillsResultsDataType)[keyof typeof BillsResultsDataType]; +export const BillsStatusBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type BillsStatusBillStatus = (typeof BillsStatusBillStatus)[keyof typeof BillsStatusBillStatus]; +export const BillsTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type BillsTrackingRefsDataType = (typeof BillsTrackingRefsDataType)[keyof typeof BillsTrackingRefsDataType]; +export const CompaniesDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionSourceType = (typeof CompaniesDataConnectionSourceType)[keyof typeof CompaniesDataConnectionSourceType]; +export const CompaniesDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionStatus = (typeof CompaniesDataConnectionStatus)[keyof typeof CompaniesDataConnectionStatus]; +export const CompaniesDataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionsDataConnectionSourceType = (typeof CompaniesDataConnectionsDataConnectionSourceType)[keyof typeof CompaniesDataConnectionsDataConnectionSourceType]; +export const CompaniesDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionsDataConnectionStatus = (typeof CompaniesDataConnectionsDataConnectionStatus)[keyof typeof CompaniesDataConnectionsDataConnectionStatus]; +export const CompaniesErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesErrorStatus = (typeof CompaniesErrorStatus)[keyof typeof CompaniesErrorStatus]; +export const CompaniesSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesSourceTypeDataConnectionSourceType = (typeof CompaniesSourceTypeDataConnectionSourceType)[keyof typeof CompaniesSourceTypeDataConnectionSourceType]; +export const CompaniesStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesStatusDataConnectionStatus = (typeof CompaniesStatusDataConnectionStatus)[keyof typeof CompaniesStatusDataConnectionStatus]; +export const CompaniesStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesStatusErrorStatus = (typeof CompaniesStatusErrorStatus)[keyof typeof CompaniesStatusErrorStatus]; +export const CompanyDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionSourceType = (typeof CompanyDataConnectionSourceType)[keyof typeof CompanyDataConnectionSourceType]; +export const CompanyDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionStatus = (typeof CompanyDataConnectionStatus)[keyof typeof CompanyDataConnectionStatus]; +export const CompanyDataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionsDataConnectionSourceType = (typeof CompanyDataConnectionsDataConnectionSourceType)[keyof typeof CompanyDataConnectionsDataConnectionSourceType]; +export const CompanyDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionsDataConnectionStatus = (typeof CompanyDataConnectionsDataConnectionStatus)[keyof typeof CompanyDataConnectionsDataConnectionStatus]; +export const CompanyErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyErrorStatus = (typeof CompanyErrorStatus)[keyof typeof CompanyErrorStatus]; +export const CompanySourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanySourceTypeDataConnectionSourceType = (typeof CompanySourceTypeDataConnectionSourceType)[keyof typeof CompanySourceTypeDataConnectionSourceType]; +export const CompanyStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyStatusDataConnectionStatus = (typeof CompanyStatusDataConnectionStatus)[keyof typeof CompanyStatusDataConnectionStatus]; +export const CompanyStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyStatusErrorStatus = (typeof CompanyStatusErrorStatus)[keyof typeof CompanyStatusErrorStatus]; +export const ConnectionDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionDataConnectionSourceType = (typeof ConnectionDataConnectionSourceType)[keyof typeof ConnectionDataConnectionSourceType]; +export const ConnectionDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionDataConnectionStatus = (typeof ConnectionDataConnectionStatus)[keyof typeof ConnectionDataConnectionStatus]; +export const ConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionErrorStatus = (typeof ConnectionErrorStatus)[keyof typeof ConnectionErrorStatus]; +export const ConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceType = (typeof ConnectionSourceType)[keyof typeof ConnectionSourceType]; +export const ConnectionSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceTypeDataConnectionSourceType = (typeof ConnectionSourceTypeDataConnectionSourceType)[keyof typeof ConnectionSourceTypeDataConnectionSourceType]; +export const ConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionStatusDataConnectionStatus = (typeof ConnectionStatusDataConnectionStatus)[keyof typeof ConnectionStatusDataConnectionStatus]; +export const ConnectionStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionStatusErrorStatus = (typeof ConnectionStatusErrorStatus)[keyof typeof ConnectionStatusErrorStatus]; +export const ConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsDataConnectionSourceType = (typeof ConnectionsDataConnectionSourceType)[keyof typeof ConnectionsDataConnectionSourceType]; +export const ConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsDataConnectionStatus = (typeof ConnectionsDataConnectionStatus)[keyof typeof ConnectionsDataConnectionStatus]; +export const ConnectionsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsErrorStatus = (typeof ConnectionsErrorStatus)[keyof typeof ConnectionsErrorStatus]; +export const ConnectionsResultsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsResultsDataConnectionSourceType = (typeof ConnectionsResultsDataConnectionSourceType)[keyof typeof ConnectionsResultsDataConnectionSourceType]; +export const ConnectionsResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsResultsDataConnectionStatus = (typeof ConnectionsResultsDataConnectionStatus)[keyof typeof ConnectionsResultsDataConnectionStatus]; +export const ConnectionsSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsSourceTypeDataConnectionSourceType = (typeof ConnectionsSourceTypeDataConnectionSourceType)[keyof typeof ConnectionsSourceTypeDataConnectionSourceType]; +export const ConnectionsStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsStatusDataConnectionStatus = (typeof ConnectionsStatusDataConnectionStatus)[keyof typeof ConnectionsStatusDataConnectionStatus]; +export const ConnectionsStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsStatusErrorStatus = (typeof ConnectionsStatusErrorStatus)[keyof typeof ConnectionsStatusErrorStatus]; +export const CurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CurrentStatus = (typeof CurrentStatus)[keyof typeof CurrentStatus]; +export const CurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CurrentStatusDatasetStatus = (typeof CurrentStatusDatasetStatus)[keyof typeof CurrentStatusDatasetStatus]; +export const DataConnectionErrorErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorErrorStatus = (typeof DataConnectionErrorErrorStatus)[keyof typeof DataConnectionErrorErrorStatus]; +export const DataConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatus = (typeof DataConnectionErrorStatus)[keyof typeof DataConnectionErrorStatus]; +export const DataConnectionErrorStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatusErrorStatus = (typeof DataConnectionErrorStatusErrorStatus)[keyof typeof DataConnectionErrorStatusErrorStatus]; +export const DataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionSourceType = (typeof DataConnectionSourceType)[keyof typeof DataConnectionSourceType]; +export const DataConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionStatusDataConnectionStatus = (typeof DataConnectionStatusDataConnectionStatus)[keyof typeof DataConnectionStatusDataConnectionStatus]; +export const DataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionsDataConnectionSourceType = (typeof DataConnectionsDataConnectionSourceType)[keyof typeof DataConnectionsDataConnectionSourceType]; +export const DataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionsDataConnectionStatus = (typeof DataConnectionsDataConnectionStatus)[keyof typeof DataConnectionsDataConnectionStatus]; +export const DataStatusCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusCurrentStatus = (typeof DataStatusCurrentStatus)[keyof typeof DataStatusCurrentStatus]; +export const DataStatusCurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusCurrentStatusDatasetStatus = (typeof DataStatusCurrentStatusDatasetStatus)[keyof typeof DataStatusCurrentStatusDatasetStatus]; +export const DataStatusDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataType = (typeof DataStatusDataType)[keyof typeof DataStatusDataType]; +export const DataStatusDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataTypeDataTypes = (typeof DataStatusDataTypeDataTypes)[keyof typeof DataStatusDataTypeDataTypes]; +export const DataStatusDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataTypes = (typeof DataStatusDataTypes)[keyof typeof DataStatusDataTypes]; +export const DataStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusDatasetStatus = (typeof DataStatusDatasetStatus)[keyof typeof DataStatusDatasetStatus]; +export const DataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type DataType = (typeof DataType)[keyof typeof DataType]; +export const DataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataType1 = (typeof DataType1)[keyof typeof DataType1]; +export const DataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataType2 = (typeof DataType2)[keyof typeof DataType2]; +export const DataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeDataTypes = (typeof DataTypeDataTypes)[keyof typeof DataTypeDataTypes]; +export const DataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypes = (typeof DataTypes)[keyof typeof DataTypes]; +export const DatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DatasetStatus = (typeof DatasetStatus)[keyof typeof DatasetStatus]; +export const ErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ErrorStatus = (typeof ErrorStatus)[keyof typeof ErrorStatus]; +export const ItemsAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type ItemsAddressType = (typeof ItemsAddressType)[keyof typeof ItemsAddressType]; +export const ItemsBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type ItemsBankAccountStatus = (typeof ItemsBankAccountStatus)[keyof typeof ItemsBankAccountStatus]; +export const ItemsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type ItemsBankAccountType = (typeof ItemsBankAccountType)[keyof typeof ItemsBankAccountType]; +export const ItemsBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type ItemsBillStatus = (typeof ItemsBillStatus)[keyof typeof ItemsBillStatus]; +export const ItemsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ItemsDataConnectionSourceType = (typeof ItemsDataConnectionSourceType)[keyof typeof ItemsDataConnectionSourceType]; +export const ItemsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ItemsDataConnectionStatus = (typeof ItemsDataConnectionStatus)[keyof typeof ItemsDataConnectionStatus]; +export const ItemsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ItemsDataType = (typeof ItemsDataType)[keyof typeof ItemsDataType]; +export const ItemsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ItemsDataTypes = (typeof ItemsDataTypes)[keyof typeof ItemsDataTypes]; +export const ItemsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ItemsDatasetStatus = (typeof ItemsDatasetStatus)[keyof typeof ItemsDatasetStatus]; +export const ItemsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ItemsErrorStatus = (typeof ItemsErrorStatus)[keyof typeof ItemsErrorStatus]; +export const ItemsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ItemsPushChangeType = (typeof ItemsPushChangeType)[keyof typeof ItemsPushChangeType]; +export const ItemsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ItemsPushOperationStatus = (typeof ItemsPushOperationStatus)[keyof typeof ItemsPushOperationStatus]; +export const ItemsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ItemsSupplierStatus = (typeof ItemsSupplierStatus)[keyof typeof ItemsSupplierStatus]; +export const OneDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type OneDataConnectionSourceType = (typeof OneDataConnectionSourceType)[keyof typeof OneDataConnectionSourceType]; +export const OneDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type OneDataConnectionStatus = (typeof OneDataConnectionStatus)[keyof typeof OneDataConnectionStatus]; +export const OneErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type OneErrorStatus = (typeof OneErrorStatus)[keyof typeof OneErrorStatus]; +export const PaymentMappingOptionsAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type PaymentMappingOptionsAccountTypeBankAccountType = (typeof PaymentMappingOptionsAccountTypeBankAccountType)[keyof typeof PaymentMappingOptionsAccountTypeBankAccountType]; +export const PaymentMappingOptionsBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type PaymentMappingOptionsBankAccountStatus = (typeof PaymentMappingOptionsBankAccountStatus)[keyof typeof PaymentMappingOptionsBankAccountStatus]; +export const PaymentMappingOptionsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type PaymentMappingOptionsBankAccountType = (typeof PaymentMappingOptionsBankAccountType)[keyof typeof PaymentMappingOptionsBankAccountType]; +export const PaymentMappingOptionsStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type PaymentMappingOptionsStatusBankAccountStatus = (typeof PaymentMappingOptionsStatusBankAccountStatus)[keyof typeof PaymentMappingOptionsStatusBankAccountStatus]; +export const PropertieBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type PropertieBankAccountStatus = (typeof PropertieBankAccountStatus)[keyof typeof PropertieBankAccountStatus]; +export const PropertieBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type PropertieBankAccountType = (typeof PropertieBankAccountType)[keyof typeof PropertieBankAccountType]; +export const PropertieCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieCurrentStatus = (typeof PropertieCurrentStatus)[keyof typeof PropertieCurrentStatus]; +export const PropertieDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieDataConnectionSourceType = (typeof PropertieDataConnectionSourceType)[keyof typeof PropertieDataConnectionSourceType]; +export const PropertieDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type PropertieDataConnectionStatus = (typeof PropertieDataConnectionStatus)[keyof typeof PropertieDataConnectionStatus]; +export const PropertieDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType = (typeof PropertieDataType)[keyof typeof PropertieDataType]; +export const PropertieDataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType1 = (typeof PropertieDataType1)[keyof typeof PropertieDataType1]; +export const PropertieDataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType2 = (typeof PropertieDataType2)[keyof typeof PropertieDataType2]; +export const PropertieDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataTypes = (typeof PropertieDataTypes)[keyof typeof PropertieDataTypes]; +export const PropertieDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieDatasetStatus = (typeof PropertieDatasetStatus)[keyof typeof PropertieDatasetStatus]; +export const PropertieErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type PropertieErrorStatus = (typeof PropertieErrorStatus)[keyof typeof PropertieErrorStatus]; +export const PropertiePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PropertiePushChangeType = (typeof PropertiePushChangeType)[keyof typeof PropertiePushChangeType]; +export const PropertiePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PropertiePushOperationStatus = (typeof PropertiePushOperationStatus)[keyof typeof PropertiePushOperationStatus]; +export const PropertieSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieSourceType = (typeof PropertieSourceType)[keyof typeof PropertieSourceType]; +export const PropertieStatus = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus = (typeof PropertieStatus)[keyof typeof PropertieStatus]; +export const PropertieStatus1 = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus1 = (typeof PropertieStatus1)[keyof typeof PropertieStatus1]; +export const PropertieStatus2 = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus2 = (typeof PropertieStatus2)[keyof typeof PropertieStatus2]; +export const PropertieTaxRateStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type PropertieTaxRateStatus = (typeof PropertieTaxRateStatus)[keyof typeof PropertieTaxRateStatus]; +export const PullOperationDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationDatasetStatus = (typeof PullOperationDatasetStatus)[keyof typeof PullOperationDatasetStatus]; +export const PullOperationStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatus = (typeof PullOperationStatus)[keyof typeof PullOperationStatus]; +export const PullOperationStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatusDatasetStatus = (typeof PullOperationStatusDatasetStatus)[keyof typeof PullOperationStatusDatasetStatus]; +export const PullOperationsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsDatasetStatus = (typeof PullOperationsDatasetStatus)[keyof typeof PullOperationsDatasetStatus]; +export const PullOperationsStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsStatusDatasetStatus = (typeof PullOperationsStatusDatasetStatus)[keyof typeof PullOperationsStatusDatasetStatus]; +export const PushChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushChangeTypePushChangeType = (typeof PushChangeTypePushChangeType)[keyof typeof PushChangeTypePushChangeType]; +export const PushOperationChangeDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataTypeDataTypes = (typeof PushOperationChangeDataTypeDataTypes)[keyof typeof PushOperationChangeDataTypeDataTypes]; +export const PushOperationChangeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataTypes = (typeof PushOperationChangeDataTypes)[keyof typeof PushOperationChangeDataTypes]; +export const PushOperationChangePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangePushChangeType = (typeof PushOperationChangePushChangeType)[keyof typeof PushOperationChangePushChangeType]; +export const PushOperationChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangeTypePushChangeType = (typeof PushOperationChangeTypePushChangeType)[keyof typeof PushOperationChangeTypePushChangeType]; +export const PushOperationDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataType = (typeof PushOperationDataType)[keyof typeof PushOperationDataType]; +export const PushOperationDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataTypeDataTypes = (typeof PushOperationDataTypeDataTypes)[keyof typeof PushOperationDataTypeDataTypes]; +export const PushOperationDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataTypes = (typeof PushOperationDataTypes)[keyof typeof PushOperationDataTypes]; +export const PushOperationPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationPushChangeType = (typeof PushOperationPushChangeType)[keyof typeof PushOperationPushChangeType]; +export const PushOperationPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationPushOperationStatus = (typeof PushOperationPushOperationStatus)[keyof typeof PushOperationPushOperationStatus]; +export const PushOperationRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataType = (typeof PushOperationRefDataType)[keyof typeof PushOperationRefDataType]; +export const PushOperationRefDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataTypeDataTypes = (typeof PushOperationRefDataTypeDataTypes)[keyof typeof PushOperationRefDataTypeDataTypes]; +export const PushOperationRefDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataTypes = (typeof PushOperationRefDataTypes)[keyof typeof PushOperationRefDataTypes]; +export const PushOperationReferenceDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataTypeDataTypes = (typeof PushOperationReferenceDataTypeDataTypes)[keyof typeof PushOperationReferenceDataTypeDataTypes]; +export const PushOperationReferenceDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataTypes = (typeof PushOperationReferenceDataTypes)[keyof typeof PushOperationReferenceDataTypes]; +export const PushOperationStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationStatusPushOperationStatus = (typeof PushOperationStatusPushOperationStatus)[keyof typeof PushOperationStatusPushOperationStatus]; +export const PushOperationTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationTypePushChangeType = (typeof PushOperationTypePushChangeType)[keyof typeof PushOperationTypePushChangeType]; +export const PushOperationsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataTypeDataTypes = (typeof PushOperationsDataTypeDataTypes)[keyof typeof PushOperationsDataTypeDataTypes]; +export const PushOperationsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataTypes = (typeof PushOperationsDataTypes)[keyof typeof PushOperationsDataTypes]; +export const PushOperationsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsPushChangeType = (typeof PushOperationsPushChangeType)[keyof typeof PushOperationsPushChangeType]; +export const PushOperationsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsPushOperationStatus = (typeof PushOperationsPushOperationStatus)[keyof typeof PushOperationsPushOperationStatus]; +export const PushOperationsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsResultsPushChangeType = (typeof PushOperationsResultsPushChangeType)[keyof typeof PushOperationsResultsPushChangeType]; +export const PushOperationsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsResultsPushOperationStatus = (typeof PushOperationsResultsPushOperationStatus)[keyof typeof PushOperationsResultsPushOperationStatus]; +export const PushOperationsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsStatusPushOperationStatus = (typeof PushOperationsStatusPushOperationStatus)[keyof typeof PushOperationsStatusPushOperationStatus]; +export const PushOperationsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsTypePushChangeType = (typeof PushOperationsTypePushChangeType)[keyof typeof PushOperationsTypePushChangeType]; +export const ResultsBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type ResultsBillStatus = (typeof ResultsBillStatus)[keyof typeof ResultsBillStatus]; +export const ResultsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ResultsDataConnectionSourceType = (typeof ResultsDataConnectionSourceType)[keyof typeof ResultsDataConnectionSourceType]; +export const ResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ResultsDataConnectionStatus = (typeof ResultsDataConnectionStatus)[keyof typeof ResultsDataConnectionStatus]; +export const ResultsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ResultsDataType = (typeof ResultsDataType)[keyof typeof ResultsDataType]; +export const ResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ResultsPushChangeType = (typeof ResultsPushChangeType)[keyof typeof ResultsPushChangeType]; +export const ResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ResultsPushOperationStatus = (typeof ResultsPushOperationStatus)[keyof typeof ResultsPushOperationStatus]; +export const ResultsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ResultsSupplierStatus = (typeof ResultsSupplierStatus)[keyof typeof ResultsSupplierStatus]; +export const SchemaBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type SchemaBankAccountStatus = (typeof SchemaBankAccountStatus)[keyof typeof SchemaBankAccountStatus]; +export const SchemaBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type SchemaBankAccountType = (typeof SchemaBankAccountType)[keyof typeof SchemaBankAccountType]; +export const SchemaCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaCurrentStatus = (typeof SchemaCurrentStatus)[keyof typeof SchemaCurrentStatus]; +export const SchemaDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaDataConnectionSourceType = (typeof SchemaDataConnectionSourceType)[keyof typeof SchemaDataConnectionSourceType]; +export const SchemaDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type SchemaDataConnectionStatus = (typeof SchemaDataConnectionStatus)[keyof typeof SchemaDataConnectionStatus]; +export const SchemaDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType = (typeof SchemaDataType)[keyof typeof SchemaDataType]; +export const SchemaDataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType1 = (typeof SchemaDataType1)[keyof typeof SchemaDataType1]; +export const SchemaDataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType2 = (typeof SchemaDataType2)[keyof typeof SchemaDataType2]; +export const SchemaDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataTypes = (typeof SchemaDataTypes)[keyof typeof SchemaDataTypes]; +export const SchemaDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaDatasetStatus = (typeof SchemaDatasetStatus)[keyof typeof SchemaDatasetStatus]; +export const SchemaErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type SchemaErrorStatus = (typeof SchemaErrorStatus)[keyof typeof SchemaErrorStatus]; +export const SchemaPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type SchemaPushChangeType = (typeof SchemaPushChangeType)[keyof typeof SchemaPushChangeType]; +export const SchemaPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type SchemaPushOperationStatus = (typeof SchemaPushOperationStatus)[keyof typeof SchemaPushOperationStatus]; +export const SchemaSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaSourceType = (typeof SchemaSourceType)[keyof typeof SchemaSourceType]; +export const SchemaStatus = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus = (typeof SchemaStatus)[keyof typeof SchemaStatus]; +export const SchemaStatus1 = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus1 = (typeof SchemaStatus1)[keyof typeof SchemaStatus1]; +export const SchemaStatus2 = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus2 = (typeof SchemaStatus2)[keyof typeof SchemaStatus2]; +export const SchemaTaxRateStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type SchemaTaxRateStatus = (typeof SchemaTaxRateStatus)[keyof typeof SchemaTaxRateStatus]; +export const SourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceType = (typeof SourceType)[keyof typeof SourceType]; +export const SourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceTypeDataConnectionSourceType = (typeof SourceTypeDataConnectionSourceType)[keyof typeof SourceTypeDataConnectionSourceType]; +export const Status1 = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type Status1 = (typeof Status1)[keyof typeof Status1]; +export const Status2 = { + Active: "Active", + Archived: "Archived", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type Status2 = (typeof Status2)[keyof typeof Status2]; +export const StatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type StatusBankAccountStatus = (typeof StatusBankAccountStatus)[keyof typeof StatusBankAccountStatus]; +export const StatusBillStatus = { + Draft: "Draft", + Open: "Open", + Paid: "Paid", + PartiallyPaid: "PartiallyPaid", + Unknown: "Unknown", + Void: "Void", +} as const; +export type StatusBillStatus = (typeof StatusBillStatus)[keyof typeof StatusBillStatus]; +export const StatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type StatusDataConnectionStatus = (typeof StatusDataConnectionStatus)[keyof typeof StatusDataConnectionStatus]; +export const StatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusDatasetStatus = (typeof StatusDatasetStatus)[keyof typeof StatusDatasetStatus]; +export const StatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type StatusErrorStatus = (typeof StatusErrorStatus)[keyof typeof StatusErrorStatus]; +export const StatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type StatusPushOperationStatus = (typeof StatusPushOperationStatus)[keyof typeof StatusPushOperationStatus]; +export const StatusStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusStatus = (typeof StatusStatus)[keyof typeof StatusStatus]; +export const StatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type StatusSupplierStatus = (typeof StatusSupplierStatus)[keyof typeof StatusSupplierStatus]; +export const SupplierAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierAddressType = (typeof SupplierAddressType)[keyof typeof SupplierAddressType]; +export const SupplierAddressesAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierAddressesAddressType = (typeof SupplierAddressesAddressType)[keyof typeof SupplierAddressesAddressType]; +export const SupplierPrototypeAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierPrototypeAddressType = (typeof SupplierPrototypeAddressType)[keyof typeof SupplierPrototypeAddressType]; +export const SupplierPrototypeAddressesAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierPrototypeAddressesAddressType = (typeof SupplierPrototypeAddressesAddressType)[keyof typeof SupplierPrototypeAddressesAddressType]; +export const SupplierPrototypeStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierPrototypeStatusSupplierStatus = (typeof SupplierPrototypeStatusSupplierStatus)[keyof typeof SupplierPrototypeStatusSupplierStatus]; +export const SupplierPrototypeSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierPrototypeSupplierStatus = (typeof SupplierPrototypeSupplierStatus)[keyof typeof SupplierPrototypeSupplierStatus]; +export const SupplierPrototypeTypeAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierPrototypeTypeAddressType = (typeof SupplierPrototypeTypeAddressType)[keyof typeof SupplierPrototypeTypeAddressType]; +export const SupplierResultsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierResultsSupplierStatus = (typeof SupplierResultsSupplierStatus)[keyof typeof SupplierResultsSupplierStatus]; +export const SupplierStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierStatusSupplierStatus = (typeof SupplierStatusSupplierStatus)[keyof typeof SupplierStatusSupplierStatus]; +export const SupplierSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierSupplierStatus = (typeof SupplierSupplierStatus)[keyof typeof SupplierSupplierStatus]; +export const SupplierTypeAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierTypeAddressType = (typeof SupplierTypeAddressType)[keyof typeof SupplierTypeAddressType]; +export const SuppliersAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SuppliersAddressType = (typeof SuppliersAddressType)[keyof typeof SuppliersAddressType]; +export const SuppliersAddressesAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SuppliersAddressesAddressType = (typeof SuppliersAddressesAddressType)[keyof typeof SuppliersAddressesAddressType]; +export const SuppliersResultsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SuppliersResultsSupplierStatus = (typeof SuppliersResultsSupplierStatus)[keyof typeof SuppliersResultsSupplierStatus]; +export const SuppliersStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SuppliersStatusSupplierStatus = (typeof SuppliersStatusSupplierStatus)[keyof typeof SuppliersStatusSupplierStatus]; +export const SuppliersSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SuppliersSupplierStatus = (typeof SuppliersSupplierStatus)[keyof typeof SuppliersSupplierStatus]; +export const SuppliersTypeAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SuppliersTypeAddressType = (typeof SuppliersTypeAddressType)[keyof typeof SuppliersTypeAddressType]; +export const TaxRateMappingOptionBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type TaxRateMappingOptionBankAccountStatus = (typeof TaxRateMappingOptionBankAccountStatus)[keyof typeof TaxRateMappingOptionBankAccountStatus]; +export const TaxRateMappingOptionStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type TaxRateMappingOptionStatus = (typeof TaxRateMappingOptionStatus)[keyof typeof TaxRateMappingOptionStatus]; +export const TaxRateMappingOptionStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type TaxRateMappingOptionStatusBankAccountStatus = (typeof TaxRateMappingOptionStatusBankAccountStatus)[keyof typeof TaxRateMappingOptionStatusBankAccountStatus]; +export const TaxRateMappingOptionTaxRateStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type TaxRateMappingOptionTaxRateStatus = (typeof TaxRateMappingOptionTaxRateStatus)[keyof typeof TaxRateMappingOptionTaxRateStatus]; +export const TaxRateStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type TaxRateStatus = (typeof TaxRateStatus)[keyof typeof TaxRateStatus]; +export const TrackingRefDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefDataType = (typeof TrackingRefDataType)[keyof typeof TrackingRefDataType]; +export const TrackingReferenceDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingReferenceDataType = (typeof TrackingReferenceDataType)[keyof typeof TrackingReferenceDataType]; +export const TrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefsDataType = (typeof TrackingRefsDataType)[keyof typeof TrackingRefsDataType]; +export const TypeAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type TypeAddressType = (typeof TypeAddressType)[keyof typeof TypeAddressType]; +export const TypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type TypePushChangeType = (typeof TypePushChangeType)[keyof typeof TypePushChangeType]; +export const ZeroBankAccountStatus = { + Active: "Active", + Archived: "Archived", +} as const; +export type ZeroBankAccountStatus = (typeof ZeroBankAccountStatus)[keyof typeof ZeroBankAccountStatus]; +export const ZeroBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type ZeroBankAccountType = (typeof ZeroBankAccountType)[keyof typeof ZeroBankAccountType]; +export const ZeroDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ZeroDataConnectionSourceType = (typeof ZeroDataConnectionSourceType)[keyof typeof ZeroDataConnectionSourceType]; +export const ZeroDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ZeroDataConnectionStatus = (typeof ZeroDataConnectionStatus)[keyof typeof ZeroDataConnectionStatus]; +export const ZeroDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ZeroDataTypes = (typeof ZeroDataTypes)[keyof typeof ZeroDataTypes]; +export const ZeroDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ZeroDatasetStatus = (typeof ZeroDatasetStatus)[keyof typeof ZeroDatasetStatus]; +export const ZeroErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ZeroErrorStatus = (typeof ZeroErrorStatus)[keyof typeof ZeroErrorStatus]; +export const ZeroPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ZeroPushChangeType = (typeof ZeroPushChangeType)[keyof typeof ZeroPushChangeType]; +export const ZeroPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ZeroPushOperationStatus = (typeof ZeroPushOperationStatus)[keyof typeof ZeroPushOperationStatus]; diff --git a/sync-for-payables/src/sdk/models/_speakeasy_hoisted.ts b/sync-for-payables/src/sdk/models/_speakeasy_hoisted.ts new file mode 100644 index 000000000..58477435b --- /dev/null +++ b/sync-for-payables/src/sdk/models/_speakeasy_hoisted.ts @@ -0,0 +1,9 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type * as shared from './index'; + + +export interface ConnectionInfo {} + +export interface Tags {} diff --git a/sync-for-payables/src/sdk/models/errors/codatsyncpayableserror.ts b/sync-for-payables/src/sdk/models/errors/codatsyncpayableserror.ts index 476e94ceb..902a749b4 100644 --- a/sync-for-payables/src/sdk/models/errors/codatsyncpayableserror.ts +++ b/sync-for-payables/src/sdk/models/errors/codatsyncpayableserror.ts @@ -1,35 +1,20 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** The base class for all HTTP error responses */ export class CodatSyncPayablesError extends Error { - /** HTTP status code */ - public readonly statusCode: number; - /** HTTP body */ - public readonly body: string; - /** HTTP headers */ - public readonly headers: Headers; - /** HTTP content type */ - public readonly contentType: string; - /** Raw response */ - public readonly rawResponse: Response; + readonly body: string; + readonly statusCode: number; + readonly contentType: string; + readonly headers: Headers; + readonly rawResponse: Response; - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - super(message); - this.statusCode = httpMeta.response.status; - this.body = httpMeta.body; - this.headers = httpMeta.response.headers; - this.contentType = httpMeta.response.headers.get("content-type") || ""; - this.rawResponse = httpMeta.response; - - this.name = "CodatSyncPayablesError"; - } + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message); + this.name = "CodatSyncPayablesError"; + this.body = httpMeta.body; + this.statusCode = httpMeta.response.status; + this.contentType = httpMeta.response.headers.get("content-type") ?? ""; + this.headers = httpMeta.response.headers; + this.rawResponse = httpMeta.response; + } } diff --git a/sync-for-payables/src/sdk/models/errors/errormessage.ts b/sync-for-payables/src/sdk/models/errors/errormessage.ts index bba810b86..3f77a219e 100644 --- a/sync-for-payables/src/sdk/models/errors/errormessage.ts +++ b/sync-for-payables/src/sdk/models/errors/errormessage.ts @@ -1,120 +1,38 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; -import { CodatSyncPayablesError } from "./codatsyncpayableserror.js"; +import { CodatSyncPayablesError } from "./codatsyncpayableserror"; +import type { ErrorMessageData } from "../ErrorMessage"; +import type { ErrorValidation } from "../shared/errorvalidation"; -/** - * Your `query` parameter was not correctly formed - */ -export type ErrorMessageData = { - /** - * The HTTP status code returned by the error. - */ - statusCode?: number | undefined; - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; -}; +export type { ErrorMessageData }; -/** - * Your `query` parameter was not correctly formed - */ export class ErrorMessage extends CodatSyncPayablesError { - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; + service?: string | undefined; + error?: string | undefined; + correlationId?: string | undefined; + validation?: ErrorValidation | null | undefined; + canBeRetried?: string | undefined; + detailedErrorCode?: number | undefined; - /** The original data that was passed to this error instance. */ - data$: ErrorMessageData; + data$: ErrorMessageData; - constructor( - err: ErrorMessageData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - if (err.service != null) this.service = err.service; - if (err.error != null) this.error = err.error; - if (err.correlationId != null) this.correlationId = err.correlationId; - if (err.validation != null) this.validation = err.validation; - if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; - if (err.detailedErrorCode != null) { - this.detailedErrorCode = err.detailedErrorCode; + constructor( + err: ErrorMessageData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const data = err as ErrorMessageData & { message?: unknown }; + const message = typeof data.message === "string" + ? data.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + if (err.service != null) this.service = err.service; + if (err.error != null) this.error = err.error; + if (err.correlationId != null) this.correlationId = err.correlationId; + if (err.validation != null) this.validation = err.validation; + if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; + if (err.detailedErrorCode != null) this.detailedErrorCode = err.detailedErrorCode; + this.name = "ErrorMessage"; } - - this.name = "ErrorMessage"; - } } - -/** @internal */ -export const ErrorMessage$inboundSchema: z.ZodType< - ErrorMessage, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - service: z.string().optional(), - error: z.string().optional(), - correlationId: z.string().optional(), - validation: z.nullable(shared.ErrorValidation$inboundSchema).optional(), - canBeRetried: z.string().optional(), - detailedErrorCode: z.number().int().optional(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new ErrorMessage(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); diff --git a/sync-for-payables/src/sdk/models/errors/httpclienterrors.ts b/sync-for-payables/src/sdk/models/errors/httpclienterrors.ts index b34f61212..0bfc5af09 100644 --- a/sync-for-payables/src/sdk/models/errors/httpclienterrors.ts +++ b/sync-for-payables/src/sdk/models/errors/httpclienterrors.ts @@ -1,62 +1,47 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Base class for all HTTP errors. - */ export class HTTPClientError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - override name = "HTTPClientError"; - constructor(message: string, opts?: { cause?: unknown }) { - let msg = message; - if (opts?.cause) { - msg += `: ${opts.cause}`; - } + readonly cause: unknown; - super(msg, opts); - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = opts?.cause; + constructor(message: string, opts?: { cause?: unknown }) { + super(message); + this.name = "HTTPClientError"; + this.cause = opts?.cause; } - } } -/** - * An error to capture unrecognised or unexpected errors when making HTTP calls. - */ export class UnexpectedClientError extends HTTPClientError { - override name = "UnexpectedClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "UnexpectedClientError"; + } } -/** - * An error that is raised when any inputs used to create a request are invalid. - */ export class InvalidRequestError extends HTTPClientError { - override name = "InvalidRequestError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "InvalidRequestError"; + } } -/** - * An error that is raised when a HTTP request was aborted by the client error. - */ export class RequestAbortedError extends HTTPClientError { - override readonly name = "RequestAbortedError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestAbortedError"; + } } -/** - * An error that is raised when a HTTP request timed out due to an AbortSignal - * signal timeout. - */ export class RequestTimeoutError extends HTTPClientError { - override readonly name = "RequestTimeoutError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestTimeoutError"; + } } -/** - * An error that is raised when a HTTP client is unable to make a request to - * a server. - */ export class ConnectionError extends HTTPClientError { - override readonly name = "ConnectionError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "ConnectionError"; + } } diff --git a/sync-for-payables/src/sdk/models/errors/index.ts b/sync-for-payables/src/sdk/models/errors/index.ts index 907f0f2a9..1cd1b5910 100644 --- a/sync-for-payables/src/sdk/models/errors/index.ts +++ b/sync-for-payables/src/sdk/models/errors/index.ts @@ -1,10 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./codatsyncpayableserror.js"; -export * from "./errormessage.js"; -export * from "./httpclienterrors.js"; -export * from "./responsevalidationerror.js"; -export * from "./sdkerror.js"; -export * from "./sdkvalidationerror.js"; +export * from './codatsyncpayableserror'; +export * from './errormessage'; +export * from './httpclienterrors'; +export * from './responsevalidationerror'; +export * from './sdkerror'; +export * from './sdkvalidationerror'; diff --git a/sync-for-payables/src/sdk/models/errors/responsevalidationerror.ts b/sync-for-payables/src/sdk/models/errors/responsevalidationerror.ts index 45a94e33e..f7902425c 100644 --- a/sync-for-payables/src/sdk/models/errors/responsevalidationerror.ts +++ b/sync-for-payables/src/sdk/models/errors/responsevalidationerror.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncPayablesError } from "./codatsyncpayableserror.js"; -import { formatZodError } from "./sdkvalidationerror.js"; +import { CodatSyncPayablesError } from "./codatsyncpayableserror"; export class ResponseValidationError extends CodatSyncPayablesError { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; + readonly cause: unknown; + readonly rawMessage: unknown; + readonly rawValue: unknown; - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - constructor( - message: string, - extra: { - response: Response; - request: Request; - body: string; - cause: unknown; - rawValue: unknown; - rawMessage: unknown; - }, - ) { - super(message, extra); - this.name = "ResponseValidationError"; - this.cause = extra.cause; - this.rawValue = extra.rawValue; - this.rawMessage = extra.rawMessage; - } + constructor( + message: string, + extra: { response: Response; request: Request; body: string; cause: unknown; rawValue: unknown; rawMessage: unknown }, + ) { + super(message, extra); + this.name = "ResponseValidationError"; + this.cause = extra.cause; + this.rawMessage = extra.rawMessage; + this.rawValue = extra.rawValue; + } - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + pretty(): string { + return this.message; } - } } diff --git a/sync-for-payables/src/sdk/models/errors/sdkerror.ts b/sync-for-payables/src/sdk/models/errors/sdkerror.ts index 2d987849b..f6b9e4db5 100644 --- a/sync-for-payables/src/sdk/models/errors/sdkerror.ts +++ b/sync-for-payables/src/sdk/models/errors/sdkerror.ts @@ -1,40 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncPayablesError } from "./codatsyncpayableserror.js"; +import { CodatSyncPayablesError } from "./codatsyncpayableserror"; -/** The fallback error class if no more specific error class is matched */ export class SDKError extends CodatSyncPayablesError { - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - if (message) { - message += `: `; + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message, httpMeta); + this.name = "SDKError"; } - message += `Status ${httpMeta.response.status}`; - const contentType = httpMeta.response.headers.get("content-type") || `""`; - if (contentType !== "application/json") { - message += ` Content-Type ${ - contentType.includes(" ") ? `"${contentType}"` : contentType - }`; - } - const body = httpMeta.body || `""`; - message += body.length > 100 ? "\n" : ". "; - let bodyDisplay = body; - if (body.length > 10000) { - const truncated = body.substring(0, 10000); - const remaining = body.length - 10000; - bodyDisplay = `${truncated}...and ${remaining} more chars`; - } - message += `Body: ${bodyDisplay}`; - message = message.trim(); - super(message, httpMeta); - this.name = "SDKError"; - } } diff --git a/sync-for-payables/src/sdk/models/errors/sdkvalidationerror.ts b/sync-for-payables/src/sdk/models/errors/sdkvalidationerror.ts index 6826e1208..23a011c8c 100644 --- a/sync-for-payables/src/sdk/models/errors/sdkvalidationerror.ts +++ b/sync-for-payables/src/sdk/models/errors/sdkvalidationerror.ts @@ -1,109 +1,26 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; +/* tslint:disable */ +/* eslint-disable */ export class SDKValidationError extends Error { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; - - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` - static override [Symbol.hasInstance]( - instance: unknown, - ): instance is SDKValidationError { - if (!(instance instanceof Error)) return false; - if (!("rawValue" in instance)) return false; - if (!("rawMessage" in instance)) return false; - if (!("pretty" in instance)) return false; - if (typeof instance.pretty !== "function") return false; - return true; - } - - constructor(message: string, cause: unknown, rawValue: unknown) { - super(`${message}: ${cause}`); - this.name = "SDKValidationError"; - this.cause = cause; - this.rawValue = rawValue; - this.rawMessage = message; - } - - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + readonly cause: unknown; + readonly rawValue: unknown; + readonly rawMessage: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(message); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + this.rawMessage = message; } - } -} -export function formatZodError(err: z.ZodError, level = 0): string { - let pre = " ".repeat(level); - pre = level > 0 ? `│${pre}` : pre; - pre += " ".repeat(level); - - let message = ""; - const append = (str: string) => (message += `\n${pre}${str}`); - - const len = err.issues.length; - const headline = len === 1 ? `${len} issue found` : `${len} issues found`; - - if (len) { - append(`┌ ${headline}:`); - } - - for (const issue of err.issues) { - let path = issue.path.join("."); - path = path ? `.${path}` : ""; - append(`│ • [${path}]: ${issue.message} (${issue.code})`); - switch (issue.code) { - case "invalid_literal": - case "invalid_type": { - append(`│ Want: ${issue.expected}`); - append(`│ Got: ${issue.received}`); - break; - } - case "unrecognized_keys": { - append(`│ Keys: ${issue.keys.join(", ")}`); - break; - } - case "invalid_enum_value": { - append(`│ Allowed: ${issue.options.join(", ")}`); - append(`│ Got: ${issue.received}`); - break; - } - case "invalid_union_discriminator": { - append(`│ Allowed: ${issue.options.join(", ")}`); - break; - } - case "invalid_union": { - const len = issue.unionErrors.length; - append( - `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, - ); - issue.unionErrors.forEach((err, i) => { - append(`│ ✖︎ Member ${i + 1} of ${len}`); - append(`${formatZodError(err, level + 1)}`); - }); - } + pretty(): string { + return this.message; } - } - - if (err.issues.length) { - append(`└─*`); - } +} - return message.slice(1); +export function formatZodError(err: unknown, level?: number): string { + void err; + void level; + return ""; } diff --git a/sync-for-payables/src/sdk/models/index.ts b/sync-for-payables/src/sdk/models/index.ts new file mode 100644 index 000000000..6911828e3 --- /dev/null +++ b/sync-for-payables/src/sdk/models/index.ts @@ -0,0 +1,102 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './shared/accountmappingoption'; +export * from './shared/accountstatus'; +export * from './shared/address'; +export * from './shared/addresstype'; +export * from './shared/attachment'; +export * from './shared/bankaccount'; +export * from './shared/bankaccountmappingoption'; +export * from './shared/bankaccountprototype'; +export * from './shared/bankaccountstatus'; +export * from './shared/bankaccounttype'; +export * from './shared/bill'; +export * from './shared/billaccountref'; +export * from './BillEventPayload'; +export * from './BillEventWebhook'; +export * from './shared/billlineitem'; +export * from './shared/billmappingoptions'; +export * from './shared/billpayment'; +export * from './shared/billpaymentaccountref'; +export * from './shared/billpaymentprototype'; +export * from './shared/billprototype'; +export * from './shared/billstatus'; +export * from './shared/billtaxrateref'; +export * from './shared/bills'; +export * from './shared/clientratelimitwebhook'; +export * from './shared/clientratelimitwebhookpayload'; +export * from './shared/companies'; +export * from './shared/company'; +export * from './CompanyDetails'; +export * from './shared/companyinformation'; +export * from './shared/companyreference'; +export * from './shared/companyreferencelinks'; +export * from './shared/companyrequestbody'; +export * from './shared/companyupdaterequest'; +export * from './shared/connection'; +export * from './shared/connections'; +export * from './operations/createconnectionrequestbody'; +export * from './shared/dataconnectionerror'; +export * from './shared/dataconnectionstatus'; +export * from './DataStatus'; +export * from './ErrorMessage'; +export * from './shared/errorvalidation'; +export * from './shared/errorvalidationitem'; +export * from './shared/halref'; +export * from './shared/links'; +export * from './shared/pagination'; +export * from './PagingInfo'; +export * from './shared/paymentmappingoptions'; +export * from './PullOperation'; +export * from './PullOperations'; +export * from './PushChangeType'; +export * from './PushOperation'; +export * from './PushOperationChange'; +export * from './PushOperationRef'; +export * from './PushOperationStatus'; +export * from './PushOperations'; +export * from './SourceModifiedDate'; +export * from './Status'; +export * from './shared/supplier'; +export * from './shared/supplierprototype'; +export * from './shared/supplierref'; +export * from './shared/supplierstatus'; +export * from './shared/suppliers'; +export * from './shared/taxratemappingoption'; +export * from './shared/trackingref'; +export * from './UpdateConnection'; +export * from './Validation'; +export * from './ValidationItem'; +export * from './shared/codatfile'; +export * from './shared/attachmentupload'; +export * from './_speakeasy_enums'; +export * from './_speakeasy_hoisted'; +export type { Security } from '../../lib/sdkconfig'; + +export type { ListCompaniesRequest } from './operations/listcompanies'; +export type { GetCompanyRequest } from './operations/getcompany'; +export type { ReplaceCompanyRequest } from './operations/replacecompany'; +export type { UpdateCompanyRequest } from './operations/updatecompany'; +export type { DeleteCompanyRequest } from './operations/deletecompany'; +export type { ListConnectionsRequest } from './operations/listconnections'; +export type { CreateConnectionRequest } from './operations/createconnection'; +export type { GetConnectionRequest } from './operations/getconnection'; +export type { UnlinkConnectionRequest } from './operations/unlinkconnection'; +export type { DeleteConnectionRequest } from './operations/deleteconnection'; +export type { GetCompanyInformationRequest } from './operations/getcompanyinformation'; +export type { GetMappingOptionsBillsRequest } from './operations/getmappingoptionsbills'; +export type { GetMappingOptionsPaymentsRequest } from './operations/getmappingoptionspayments'; +export type { ListBillsRequest } from './operations/listbills'; +export type { CreateBillRequest } from './operations/createbill'; +export type { UpdateBillRequest } from './operations/updatebill'; +export type { ListBillAttachmentsRequest } from './operations/listbillattachments'; +export type { UploadBillAttachmentRequest } from './operations/uploadbillattachment'; +export type { DownloadBillAttachmentRequest } from './operations/downloadbillattachment'; +export type { CreateBillPaymentRequest } from './operations/createbillpayment'; +export type { ListSuppliersRequest } from './operations/listsuppliers'; +export type { CreateSupplierRequest } from './operations/createsupplier'; +export type { UpdateSupplierRequest } from './operations/updatesupplier'; +export type { CreateBankAccountRequest } from './operations/createbankaccount'; + +export * as operations from './operations'; +export * as shared from './shared'; diff --git a/sync-for-payables/src/sdk/models/operations/createbankaccount.ts b/sync-for-payables/src/sdk/models/operations/createbankaccount.ts index 975923860..4df903557 100644 --- a/sync-for-payables/src/sdk/models/operations/createbankaccount.ts +++ b/sync-for-payables/src/sdk/models/operations/createbankaccount.ts @@ -1,55 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { BankAccountPrototype } from '../shared/bankaccountprototype'; +/* eslint-disable */ -export type CreateBankAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * A unique identifier to ensure idempotent behaviour for subsequent requests. - */ - idempotencyKey?: string | undefined; - bankAccountPrototype?: shared.BankAccountPrototype | undefined; -}; - -/** @internal */ -export type CreateBankAccountRequest$Outbound = { - companyId: string; - connectionId: string; - "Idempotency-Key"?: string | undefined; - bankAccountPrototype?: shared.BankAccountPrototype$Outbound | undefined; -}; - -/** @internal */ -export const CreateBankAccountRequest$outboundSchema: z.ZodType< - CreateBankAccountRequest$Outbound, - z.ZodTypeDef, - CreateBankAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - idempotencyKey: z.string().optional(), - bankAccountPrototype: shared.BankAccountPrototype$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - idempotencyKey: "Idempotency-Key", - }); -}); - -export function createBankAccountRequestToJSON( - createBankAccountRequest: CreateBankAccountRequest, -): string { - return JSON.stringify( - CreateBankAccountRequest$outboundSchema.parse(createBankAccountRequest), - ); +export interface CreateBankAccountRequest { + companyId: string; + connectionId: string; + idempotencyKey?: string; + bankAccountPrototype?: BankAccountPrototype | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/createbill.ts b/sync-for-payables/src/sdk/models/operations/createbill.ts index f39957fec..51d2e5074 100644 --- a/sync-for-payables/src/sdk/models/operations/createbill.ts +++ b/sync-for-payables/src/sdk/models/operations/createbill.ts @@ -1,55 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { BillPrototype } from '../shared/billprototype'; +/* eslint-disable */ -export type CreateBillRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * A unique identifier to ensure idempotent behaviour for subsequent requests. - */ - idempotencyKey?: string | undefined; - billPrototype?: shared.BillPrototype | undefined; -}; - -/** @internal */ -export type CreateBillRequest$Outbound = { - companyId: string; - connectionId: string; - "Idempotency-Key"?: string | undefined; - billPrototype?: shared.BillPrototype$Outbound | undefined; -}; - -/** @internal */ -export const CreateBillRequest$outboundSchema: z.ZodType< - CreateBillRequest$Outbound, - z.ZodTypeDef, - CreateBillRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - idempotencyKey: z.string().optional(), - billPrototype: shared.BillPrototype$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - idempotencyKey: "Idempotency-Key", - }); -}); - -export function createBillRequestToJSON( - createBillRequest: CreateBillRequest, -): string { - return JSON.stringify( - CreateBillRequest$outboundSchema.parse(createBillRequest), - ); +export interface CreateBillRequest { + companyId: string; + connectionId: string; + idempotencyKey?: string; + billPrototype?: BillPrototype | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/createbillpayment.ts b/sync-for-payables/src/sdk/models/operations/createbillpayment.ts index faa4b6a35..607abcd48 100644 --- a/sync-for-payables/src/sdk/models/operations/createbillpayment.ts +++ b/sync-for-payables/src/sdk/models/operations/createbillpayment.ts @@ -1,61 +1,12 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { BillPaymentPrototype } from '../shared/billpaymentprototype'; +/* eslint-disable */ -export type CreateBillPaymentRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a bill. - */ - billId: string; - /** - * A unique identifier to ensure idempotent behaviour for subsequent requests. - */ - idempotencyKey?: string | undefined; - billPaymentPrototype?: shared.BillPaymentPrototype | undefined; -}; - -/** @internal */ -export type CreateBillPaymentRequest$Outbound = { - companyId: string; - connectionId: string; - billId: string; - "Idempotency-Key"?: string | undefined; - billPaymentPrototype?: shared.BillPaymentPrototype$Outbound | undefined; -}; - -/** @internal */ -export const CreateBillPaymentRequest$outboundSchema: z.ZodType< - CreateBillPaymentRequest$Outbound, - z.ZodTypeDef, - CreateBillPaymentRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - billId: z.string(), - idempotencyKey: z.string().optional(), - billPaymentPrototype: shared.BillPaymentPrototype$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - idempotencyKey: "Idempotency-Key", - }); -}); - -export function createBillPaymentRequestToJSON( - createBillPaymentRequest: CreateBillPaymentRequest, -): string { - return JSON.stringify( - CreateBillPaymentRequest$outboundSchema.parse(createBillPaymentRequest), - ); +export interface CreateBillPaymentRequest { + companyId: string; + connectionId: string; + billId: string; + idempotencyKey?: string; + billPaymentPrototype?: BillPaymentPrototype | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/createconnection.ts b/sync-for-payables/src/sdk/models/operations/createconnection.ts index dc5bcac12..99117b45a 100644 --- a/sync-for-payables/src/sdk/models/operations/createconnection.ts +++ b/sync-for-payables/src/sdk/models/operations/createconnection.ts @@ -1,74 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; +import type { CreateConnectionRequestBody } from './createconnectionrequestbody'; +/* eslint-disable */ -export type CreateConnectionRequestBody = { - /** - * 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. - */ - platformKey?: string | undefined; -}; - -export type CreateConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: CreateConnectionRequestBody | undefined; -}; - -/** @internal */ -export type CreateConnectionRequestBody$Outbound = { - platformKey?: string | undefined; -}; - -/** @internal */ -export const CreateConnectionRequestBody$outboundSchema: z.ZodType< - CreateConnectionRequestBody$Outbound, - z.ZodTypeDef, - CreateConnectionRequestBody -> = z.object({ - platformKey: z.string().optional(), -}); - -export function createConnectionRequestBodyToJSON( - createConnectionRequestBody: CreateConnectionRequestBody, -): string { - return JSON.stringify( - CreateConnectionRequestBody$outboundSchema.parse( - createConnectionRequestBody, - ), - ); -} - -/** @internal */ -export type CreateConnectionRequest$Outbound = { - companyId: string; - RequestBody?: CreateConnectionRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const CreateConnectionRequest$outboundSchema: z.ZodType< - CreateConnectionRequest$Outbound, - z.ZodTypeDef, - CreateConnectionRequest -> = z.object({ - companyId: z.string(), - requestBody: z.lazy(() => CreateConnectionRequestBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function createConnectionRequestToJSON( - createConnectionRequest: CreateConnectionRequest, -): string { - return JSON.stringify( - CreateConnectionRequest$outboundSchema.parse(createConnectionRequest), - ); +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/createconnectionrequestbody.ts b/sync-for-payables/src/sdk/models/operations/createconnectionrequestbody.ts new file mode 100644 index 000000000..050982d02 --- /dev/null +++ b/sync-for-payables/src/sdk/models/operations/createconnectionrequestbody.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CreateConnectionRequestBody + */ +export interface CreateConnectionRequestBody { + /** + * 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. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +/** + * Check if a given object implements the CreateConnectionRequestBody interface. + */ +export function instanceOfCreateConnectionRequestBody(value: object): value is CreateConnectionRequestBody { + return true; +} + +export function CreateConnectionRequestBodyFromJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyFromJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateConnectionRequestBody { + if (json == null) { + return json; + } + return { + + 'platformKey': json['platformKey'] == null ? undefined : json['platformKey'], + }; +} + +export function CreateConnectionRequestBodyToJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyToJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyToJSONTyped(value?: CreateConnectionRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'platformKey': value['platformKey'], + }; +} + + +export interface ConnectionCreateRequestBody { + /** + * 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. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +export interface CreateConnectionCreateConnectionRequestBody { + /** + * 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. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} diff --git a/sync-for-payables/src/sdk/models/operations/createsupplier.ts b/sync-for-payables/src/sdk/models/operations/createsupplier.ts index 12d262ab1..bf7816cb1 100644 --- a/sync-for-payables/src/sdk/models/operations/createsupplier.ts +++ b/sync-for-payables/src/sdk/models/operations/createsupplier.ts @@ -1,55 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { SupplierPrototype } from '../shared/supplierprototype'; +/* eslint-disable */ -export type CreateSupplierRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * A unique identifier to ensure idempotent behaviour for subsequent requests. - */ - idempotencyKey?: string | undefined; - supplierPrototype?: shared.SupplierPrototype | undefined; -}; - -/** @internal */ -export type CreateSupplierRequest$Outbound = { - companyId: string; - connectionId: string; - "Idempotency-Key"?: string | undefined; - supplierPrototype?: shared.SupplierPrototype$Outbound | undefined; -}; - -/** @internal */ -export const CreateSupplierRequest$outboundSchema: z.ZodType< - CreateSupplierRequest$Outbound, - z.ZodTypeDef, - CreateSupplierRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - idempotencyKey: z.string().optional(), - supplierPrototype: shared.SupplierPrototype$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - idempotencyKey: "Idempotency-Key", - }); -}); - -export function createSupplierRequestToJSON( - createSupplierRequest: CreateSupplierRequest, -): string { - return JSON.stringify( - CreateSupplierRequest$outboundSchema.parse(createSupplierRequest), - ); +export interface CreateSupplierRequest { + companyId: string; + connectionId: string; + idempotencyKey?: string; + supplierPrototype?: SupplierPrototype | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/deletecompany.ts b/sync-for-payables/src/sdk/models/operations/deletecompany.ts index dbe555534..84680d5e6 100644 --- a/sync-for-payables/src/sdk/models/operations/deletecompany.ts +++ b/sync-for-payables/src/sdk/models/operations/deletecompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type DeleteCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const DeleteCompanyRequest$outboundSchema: z.ZodType< - DeleteCompanyRequest$Outbound, - z.ZodTypeDef, - DeleteCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function deleteCompanyRequestToJSON( - deleteCompanyRequest: DeleteCompanyRequest, -): string { - return JSON.stringify( - DeleteCompanyRequest$outboundSchema.parse(deleteCompanyRequest), - ); +export interface DeleteCompanyRequest { + companyId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/deleteconnection.ts b/sync-for-payables/src/sdk/models/operations/deleteconnection.ts index 83f759970..9a9aeb05b 100644 --- a/sync-for-payables/src/sdk/models/operations/deleteconnection.ts +++ b/sync-for-payables/src/sdk/models/operations/deleteconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type DeleteConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const DeleteConnectionRequest$outboundSchema: z.ZodType< - DeleteConnectionRequest$Outbound, - z.ZodTypeDef, - DeleteConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function deleteConnectionRequestToJSON( - deleteConnectionRequest: DeleteConnectionRequest, -): string { - return JSON.stringify( - DeleteConnectionRequest$outboundSchema.parse(deleteConnectionRequest), - ); +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/downloadbillattachment.ts b/sync-for-payables/src/sdk/models/operations/downloadbillattachment.ts index 6adf19d90..dcae45eee 100644 --- a/sync-for-payables/src/sdk/models/operations/downloadbillattachment.ts +++ b/sync-for-payables/src/sdk/models/operations/downloadbillattachment.ts @@ -1,54 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type DownloadBillAttachmentRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a bill. - */ - billId: string; - /** - * Unique identifier for an attachment. - */ - attachmentId: string; -}; - -/** @internal */ -export type DownloadBillAttachmentRequest$Outbound = { - companyId: string; - connectionId: string; - billId: string; - attachmentId: string; -}; - -/** @internal */ -export const DownloadBillAttachmentRequest$outboundSchema: z.ZodType< - DownloadBillAttachmentRequest$Outbound, - z.ZodTypeDef, - DownloadBillAttachmentRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - billId: z.string(), - attachmentId: z.string(), -}); - -export function downloadBillAttachmentRequestToJSON( - downloadBillAttachmentRequest: DownloadBillAttachmentRequest, -): string { - return JSON.stringify( - DownloadBillAttachmentRequest$outboundSchema.parse( - downloadBillAttachmentRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface DownloadBillAttachmentRequest { + companyId: string; + connectionId: string; + billId: string; + attachmentId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/getcompany.ts b/sync-for-payables/src/sdk/models/operations/getcompany.ts index 77734decc..fc2a6e4a5 100644 --- a/sync-for-payables/src/sdk/models/operations/getcompany.ts +++ b/sync-for-payables/src/sdk/models/operations/getcompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyRequest$outboundSchema: z.ZodType< - GetCompanyRequest$Outbound, - z.ZodTypeDef, - GetCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyRequestToJSON( - getCompanyRequest: GetCompanyRequest, -): string { - return JSON.stringify( - GetCompanyRequest$outboundSchema.parse(getCompanyRequest), - ); +export interface GetCompanyRequest { + companyId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/getcompanyinformation.ts b/sync-for-payables/src/sdk/models/operations/getcompanyinformation.ts index bcfcdff0a..2857fd6c8 100644 --- a/sync-for-payables/src/sdk/models/operations/getcompanyinformation.ts +++ b/sync-for-payables/src/sdk/models/operations/getcompanyinformation.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyInformationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetCompanyInformationRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetCompanyInformationRequest$outboundSchema: z.ZodType< - GetCompanyInformationRequest$Outbound, - z.ZodTypeDef, - GetCompanyInformationRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getCompanyInformationRequestToJSON( - getCompanyInformationRequest: GetCompanyInformationRequest, -): string { - return JSON.stringify( - GetCompanyInformationRequest$outboundSchema.parse( - getCompanyInformationRequest, - ), - ); +export interface GetCompanyInformationRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/getconnection.ts b/sync-for-payables/src/sdk/models/operations/getconnection.ts index 126d23b85..0c787e45b 100644 --- a/sync-for-payables/src/sdk/models/operations/getconnection.ts +++ b/sync-for-payables/src/sdk/models/operations/getconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetConnectionRequest$outboundSchema: z.ZodType< - GetConnectionRequest$Outbound, - z.ZodTypeDef, - GetConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getConnectionRequestToJSON( - getConnectionRequest: GetConnectionRequest, -): string { - return JSON.stringify( - GetConnectionRequest$outboundSchema.parse(getConnectionRequest), - ); +export interface GetConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/getmappingoptionsbills.ts b/sync-for-payables/src/sdk/models/operations/getmappingoptionsbills.ts index f088daae0..a370d0c84 100644 --- a/sync-for-payables/src/sdk/models/operations/getmappingoptionsbills.ts +++ b/sync-for-payables/src/sdk/models/operations/getmappingoptionsbills.ts @@ -1,54 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type GetMappingOptionsBillsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Retrieve the next page of results using the continuation token from the previous response. - */ - continuationToken?: string | undefined; - /** - * Codat query string allows you to filter by `status` (`status=Active||status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat's query string. - */ - statusQuery?: string | undefined; -}; - -/** @internal */ -export type GetMappingOptionsBillsRequest$Outbound = { - companyId: string; - connectionId: string; - continuationToken?: string | undefined; - statusQuery?: string | undefined; -}; - -/** @internal */ -export const GetMappingOptionsBillsRequest$outboundSchema: z.ZodType< - GetMappingOptionsBillsRequest$Outbound, - z.ZodTypeDef, - GetMappingOptionsBillsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - continuationToken: z.string().optional(), - statusQuery: z.string().optional(), -}); - -export function getMappingOptionsBillsRequestToJSON( - getMappingOptionsBillsRequest: GetMappingOptionsBillsRequest, -): string { - return JSON.stringify( - GetMappingOptionsBillsRequest$outboundSchema.parse( - getMappingOptionsBillsRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface GetMappingOptionsBillsRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + statusQuery?: string; } diff --git a/sync-for-payables/src/sdk/models/operations/getmappingoptionspayments.ts b/sync-for-payables/src/sdk/models/operations/getmappingoptionspayments.ts index e3abe91dc..cf0fddabb 100644 --- a/sync-for-payables/src/sdk/models/operations/getmappingoptionspayments.ts +++ b/sync-for-payables/src/sdk/models/operations/getmappingoptionspayments.ts @@ -1,54 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type GetMappingOptionsPaymentsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Retrieve the next page of results using the continuation token from the previous response. - */ - continuationToken?: string | undefined; - /** - * Codat query string allows you to filter by `status` (`status=Active||status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat's query string. - */ - statusQuery?: string | undefined; -}; - -/** @internal */ -export type GetMappingOptionsPaymentsRequest$Outbound = { - companyId: string; - connectionId: string; - continuationToken?: string | undefined; - statusQuery?: string | undefined; -}; - -/** @internal */ -export const GetMappingOptionsPaymentsRequest$outboundSchema: z.ZodType< - GetMappingOptionsPaymentsRequest$Outbound, - z.ZodTypeDef, - GetMappingOptionsPaymentsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - continuationToken: z.string().optional(), - statusQuery: z.string().optional(), -}); - -export function getMappingOptionsPaymentsRequestToJSON( - getMappingOptionsPaymentsRequest: GetMappingOptionsPaymentsRequest, -): string { - return JSON.stringify( - GetMappingOptionsPaymentsRequest$outboundSchema.parse( - getMappingOptionsPaymentsRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface GetMappingOptionsPaymentsRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + statusQuery?: string; } diff --git a/sync-for-payables/src/sdk/models/operations/index.ts b/sync-for-payables/src/sdk/models/operations/index.ts index 278d9d3bd..da2fee832 100644 --- a/sync-for-payables/src/sdk/models/operations/index.ts +++ b/sync-for-payables/src/sdk/models/operations/index.ts @@ -1,28 +1,29 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./createbankaccount.js"; -export * from "./createbill.js"; -export * from "./createbillpayment.js"; -export * from "./createconnection.js"; -export * from "./createsupplier.js"; -export * from "./deletecompany.js"; -export * from "./deleteconnection.js"; -export * from "./downloadbillattachment.js"; -export * from "./getcompany.js"; -export * from "./getcompanyinformation.js"; -export * from "./getconnection.js"; -export * from "./getmappingoptionsbills.js"; -export * from "./getmappingoptionspayments.js"; -export * from "./listbillattachments.js"; -export * from "./listbills.js"; -export * from "./listcompanies.js"; -export * from "./listconnections.js"; -export * from "./listsuppliers.js"; -export * from "./replacecompany.js"; -export * from "./unlinkconnection.js"; -export * from "./updatebill.js"; -export * from "./updatecompany.js"; -export * from "./updatesupplier.js"; -export * from "./uploadbillattachment.js"; +export * from './createbankaccount'; +export * from './createbillpayment'; +export * from './createbill'; +export * from './createconnection'; +export * from './createconnectionrequestbody'; +export * from './createsupplier'; +export * from './deletecompany'; +export * from './deleteconnection'; +export * from './downloadbillattachment'; +export * from './getcompanyinformation'; +export * from './getcompany'; +export * from './getconnection'; +export * from './getmappingoptionsbills'; +export * from './getmappingoptionspayments'; +export * from './listbillattachments'; +export * from './listbills'; +export * from './listcompanies'; +export * from './listconnections'; +export * from './listsuppliers'; +export * from './replacecompany'; +export * from './unlinkconnection'; +export * from './updatebill'; +export * from './updatecompany'; +export * from './updatesupplier'; +export * from './uploadbillattachment'; +export { UnlinkConnectionUpdateConnection } from '../UpdateConnection'; diff --git a/sync-for-payables/src/sdk/models/operations/listbillattachments.ts b/sync-for-payables/src/sdk/models/operations/listbillattachments.ts index 6262e27ea..99c712bde 100644 --- a/sync-for-payables/src/sdk/models/operations/listbillattachments.ts +++ b/sync-for-payables/src/sdk/models/operations/listbillattachments.ts @@ -1,46 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type ListBillAttachmentsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a bill. - */ - billId: string; -}; - -/** @internal */ -export type ListBillAttachmentsRequest$Outbound = { - companyId: string; - connectionId: string; - billId: string; -}; - -/** @internal */ -export const ListBillAttachmentsRequest$outboundSchema: z.ZodType< - ListBillAttachmentsRequest$Outbound, - z.ZodTypeDef, - ListBillAttachmentsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - billId: z.string(), -}); - -export function listBillAttachmentsRequestToJSON( - listBillAttachmentsRequest: ListBillAttachmentsRequest, -): string { - return JSON.stringify( - ListBillAttachmentsRequest$outboundSchema.parse(listBillAttachmentsRequest), - ); +export interface ListBillAttachmentsRequest { + companyId: string; + connectionId: string; + billId: string; } diff --git a/sync-for-payables/src/sdk/models/operations/listbills.ts b/sync-for-payables/src/sdk/models/operations/listbills.ts index 47d5bb0ab..a592c94e5 100644 --- a/sync-for-payables/src/sdk/models/operations/listbills.ts +++ b/sync-for-payables/src/sdk/models/operations/listbills.ts @@ -1,52 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListBillsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Retrieve the next page of results using the continuation token from the previous response. - */ - continuationToken?: string | undefined; - /** - * Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat's query string [here](https://docs.codat.io/using-the-api/querying). Platfrom specfic statuses: Xero supports Open | PartiallyPaid | Paid | Void | Draft. Qbo supports Open | PartiallyPaid | Paid. FreeAgent supports Open | PartiallyPaid | Paid. - */ - query?: string | undefined; -}; - -/** @internal */ -export type ListBillsRequest$Outbound = { - companyId: string; - connectionId: string; - continuationToken?: string | undefined; - query?: string | undefined; -}; - -/** @internal */ -export const ListBillsRequest$outboundSchema: z.ZodType< - ListBillsRequest$Outbound, - z.ZodTypeDef, - ListBillsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - continuationToken: z.string().optional(), - query: z.string().optional(), -}); - -export function listBillsRequestToJSON( - listBillsRequest: ListBillsRequest, -): string { - return JSON.stringify( - ListBillsRequest$outboundSchema.parse(listBillsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListBillsRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + query?: string; } diff --git a/sync-for-payables/src/sdk/models/operations/listcompanies.ts b/sync-for-payables/src/sdk/models/operations/listcompanies.ts index 837a6aae5..939f42b3f 100644 --- a/sync-for-payables/src/sdk/models/operations/listcompanies.ts +++ b/sync-for-payables/src/sdk/models/operations/listcompanies.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCompaniesRequest = { - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; - /** - * Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). - */ - tags?: string | undefined; -}; - -/** @internal */ -export type ListCompaniesRequest$Outbound = { - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; - tags?: string | undefined; -}; - -/** @internal */ -export const ListCompaniesRequest$outboundSchema: z.ZodType< - ListCompaniesRequest$Outbound, - z.ZodTypeDef, - ListCompaniesRequest -> = z.object({ - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), - tags: z.string().optional(), -}); - -export function listCompaniesRequestToJSON( - listCompaniesRequest: ListCompaniesRequest, -): string { - return JSON.stringify( - ListCompaniesRequest$outboundSchema.parse(listCompaniesRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; } diff --git a/sync-for-payables/src/sdk/models/operations/listconnections.ts b/sync-for-payables/src/sdk/models/operations/listconnections.ts index d1be0d942..47d6ac043 100644 --- a/sync-for-payables/src/sdk/models/operations/listconnections.ts +++ b/sync-for-payables/src/sdk/models/operations/listconnections.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListConnectionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListConnectionsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListConnectionsRequest$outboundSchema: z.ZodType< - ListConnectionsRequest$Outbound, - z.ZodTypeDef, - ListConnectionsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listConnectionsRequestToJSON( - listConnectionsRequest: ListConnectionsRequest, -): string { - return JSON.stringify( - ListConnectionsRequest$outboundSchema.parse(listConnectionsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/sync-for-payables/src/sdk/models/operations/listsuppliers.ts b/sync-for-payables/src/sdk/models/operations/listsuppliers.ts index 3fa159b5f..8cf0f7254 100644 --- a/sync-for-payables/src/sdk/models/operations/listsuppliers.ts +++ b/sync-for-payables/src/sdk/models/operations/listsuppliers.ts @@ -1,52 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListSuppliersRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Retrieve the next page of results using the continuation token from the previous response. - */ - continuationToken?: string | undefined; - /** - * Codat query string allows you to filter by `sourceModifiedDate` or if a supplier is `Active` or `Archived` in the accounting software. Learn more about Codat's query string [here](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; -}; - -/** @internal */ -export type ListSuppliersRequest$Outbound = { - companyId: string; - connectionId: string; - continuationToken?: string | undefined; - query?: string | undefined; -}; - -/** @internal */ -export const ListSuppliersRequest$outboundSchema: z.ZodType< - ListSuppliersRequest$Outbound, - z.ZodTypeDef, - ListSuppliersRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - continuationToken: z.string().optional(), - query: z.string().optional(), -}); - -export function listSuppliersRequestToJSON( - listSuppliersRequest: ListSuppliersRequest, -): string { - return JSON.stringify( - ListSuppliersRequest$outboundSchema.parse(listSuppliersRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListSuppliersRequest { + companyId: string; + connectionId: string; + continuationToken?: string; + query?: string; } diff --git a/sync-for-payables/src/sdk/models/operations/replacecompany.ts b/sync-for-payables/src/sdk/models/operations/replacecompany.ts index 5ee35551d..6add5d7c2 100644 --- a/sync-for-payables/src/sdk/models/operations/replacecompany.ts +++ b/sync-for-payables/src/sdk/models/operations/replacecompany.ts @@ -1,43 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyRequestBody } from '../shared/companyrequestbody'; +/* eslint-disable */ -export type ReplaceCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyRequestBody?: shared.CompanyRequestBody | undefined; -}; - -/** @internal */ -export type ReplaceCompanyRequest$Outbound = { - companyId: string; - CompanyRequestBody?: shared.CompanyRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const ReplaceCompanyRequest$outboundSchema: z.ZodType< - ReplaceCompanyRequest$Outbound, - z.ZodTypeDef, - ReplaceCompanyRequest -> = z.object({ - companyId: z.string(), - companyRequestBody: shared.CompanyRequestBody$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyRequestBody: "CompanyRequestBody", - }); -}); - -export function replaceCompanyRequestToJSON( - replaceCompanyRequest: ReplaceCompanyRequest, -): string { - return JSON.stringify( - ReplaceCompanyRequest$outboundSchema.parse(replaceCompanyRequest), - ); +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/unlinkconnection.ts b/sync-for-payables/src/sdk/models/operations/unlinkconnection.ts index dbdba4a38..6bd02ed51 100644 --- a/sync-for-payables/src/sdk/models/operations/unlinkconnection.ts +++ b/sync-for-payables/src/sdk/models/operations/unlinkconnection.ts @@ -1,81 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { UnlinkConnectionUpdateConnection } from '../UpdateConnection'; +/* eslint-disable */ -export type UnlinkConnectionUpdateConnection = { - /** - * The current authorization status of the data connection. - */ - status?: shared.DataConnectionStatus | undefined; -}; - -export type UnlinkConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody?: UnlinkConnectionUpdateConnection | undefined; -}; - -/** @internal */ -export type UnlinkConnectionUpdateConnection$Outbound = { - status?: string | undefined; -}; - -/** @internal */ -export const UnlinkConnectionUpdateConnection$outboundSchema: z.ZodType< - UnlinkConnectionUpdateConnection$Outbound, - z.ZodTypeDef, - UnlinkConnectionUpdateConnection -> = z.object({ - status: shared.DataConnectionStatus$outboundSchema.optional(), -}); - -export function unlinkConnectionUpdateConnectionToJSON( - unlinkConnectionUpdateConnection: UnlinkConnectionUpdateConnection, -): string { - return JSON.stringify( - UnlinkConnectionUpdateConnection$outboundSchema.parse( - unlinkConnectionUpdateConnection, - ), - ); -} - -/** @internal */ -export type UnlinkConnectionRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody?: UnlinkConnectionUpdateConnection$Outbound | undefined; -}; - -/** @internal */ -export const UnlinkConnectionRequest$outboundSchema: z.ZodType< - UnlinkConnectionRequest$Outbound, - z.ZodTypeDef, - UnlinkConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.lazy(() => UnlinkConnectionUpdateConnection$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function unlinkConnectionRequestToJSON( - unlinkConnectionRequest: UnlinkConnectionRequest, -): string { - return JSON.stringify( - UnlinkConnectionRequest$outboundSchema.parse(unlinkConnectionRequest), - ); +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + requestBody?: UnlinkConnectionUpdateConnection; } diff --git a/sync-for-payables/src/sdk/models/operations/updatebill.ts b/sync-for-payables/src/sdk/models/operations/updatebill.ts index 2ccc0c5a8..941299cb1 100644 --- a/sync-for-payables/src/sdk/models/operations/updatebill.ts +++ b/sync-for-payables/src/sdk/models/operations/updatebill.ts @@ -1,61 +1,12 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { BillPrototype } from '../shared/billprototype'; +/* eslint-disable */ -export type UpdateBillRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a bill. - */ - billId: string; - /** - * A unique identifier to ensure idempotent behaviour for subsequent requests. - */ - idempotencyKey?: string | undefined; - billPrototype?: shared.BillPrototype | undefined; -}; - -/** @internal */ -export type UpdateBillRequest$Outbound = { - companyId: string; - connectionId: string; - billId: string; - "Idempotency-Key"?: string | undefined; - billPrototype?: shared.BillPrototype$Outbound | undefined; -}; - -/** @internal */ -export const UpdateBillRequest$outboundSchema: z.ZodType< - UpdateBillRequest$Outbound, - z.ZodTypeDef, - UpdateBillRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - billId: z.string(), - idempotencyKey: z.string().optional(), - billPrototype: shared.BillPrototype$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - idempotencyKey: "Idempotency-Key", - }); -}); - -export function updateBillRequestToJSON( - updateBillRequest: UpdateBillRequest, -): string { - return JSON.stringify( - UpdateBillRequest$outboundSchema.parse(updateBillRequest), - ); +export interface UpdateBillRequest { + companyId: string; + connectionId: string; + billId: string; + idempotencyKey?: string; + billPrototype?: BillPrototype | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/updatecompany.ts b/sync-for-payables/src/sdk/models/operations/updatecompany.ts index 37ead4428..618928d50 100644 --- a/sync-for-payables/src/sdk/models/operations/updatecompany.ts +++ b/sync-for-payables/src/sdk/models/operations/updatecompany.ts @@ -1,43 +1,14 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyUpdateRequest } from '../shared/companyupdaterequest'; +/* eslint-disable */ -export type UpdateCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyUpdateRequest?: shared.CompanyUpdateRequest | undefined; -}; - -/** @internal */ -export type UpdateCompanyRequest$Outbound = { - companyId: string; - CompanyUpdateRequest?: shared.CompanyUpdateRequest$Outbound | undefined; -}; - -/** @internal */ -export const UpdateCompanyRequest$outboundSchema: z.ZodType< - UpdateCompanyRequest$Outbound, - z.ZodTypeDef, - UpdateCompanyRequest -> = z.object({ - companyId: z.string(), - companyUpdateRequest: shared.CompanyUpdateRequest$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyUpdateRequest: "CompanyUpdateRequest", - }); -}); +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; +} -export function updateCompanyRequestToJSON( - updateCompanyRequest: UpdateCompanyRequest, -): string { - return JSON.stringify( - UpdateCompanyRequest$outboundSchema.parse(updateCompanyRequest), - ); +export interface CompanyUpdateRequestUpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/updatesupplier.ts b/sync-for-payables/src/sdk/models/operations/updatesupplier.ts index 69cdde755..23e53d777 100644 --- a/sync-for-payables/src/sdk/models/operations/updatesupplier.ts +++ b/sync-for-payables/src/sdk/models/operations/updatesupplier.ts @@ -1,50 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import type { SupplierPrototype } from '../shared/supplierprototype'; +/* eslint-disable */ -export type UpdateSupplierRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a supplier. - */ - supplierId: string; - supplierPrototype?: shared.SupplierPrototype | undefined; -}; - -/** @internal */ -export type UpdateSupplierRequest$Outbound = { - companyId: string; - connectionId: string; - supplierId: string; - supplierPrototype?: shared.SupplierPrototype$Outbound | undefined; -}; - -/** @internal */ -export const UpdateSupplierRequest$outboundSchema: z.ZodType< - UpdateSupplierRequest$Outbound, - z.ZodTypeDef, - UpdateSupplierRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - supplierId: z.string(), - supplierPrototype: shared.SupplierPrototype$outboundSchema.optional(), -}); - -export function updateSupplierRequestToJSON( - updateSupplierRequest: UpdateSupplierRequest, -): string { - return JSON.stringify( - UpdateSupplierRequest$outboundSchema.parse(updateSupplierRequest), - ); +export interface UpdateSupplierRequest { + companyId: string; + connectionId: string; + supplierId: string; + supplierPrototype?: SupplierPrototype | undefined; } diff --git a/sync-for-payables/src/sdk/models/operations/uploadbillattachment.ts b/sync-for-payables/src/sdk/models/operations/uploadbillattachment.ts index bdfec6b12..0114163cb 100644 --- a/sync-for-payables/src/sdk/models/operations/uploadbillattachment.ts +++ b/sync-for-payables/src/sdk/models/operations/uploadbillattachment.ts @@ -1,57 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { AttachmentUpload } from '../shared/attachmentupload'; +/* eslint-disable */ -export type UploadBillAttachmentRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a bill. - */ - billId: string; - attachmentUpload?: shared.AttachmentUpload | undefined; -}; - -/** @internal */ -export type UploadBillAttachmentRequest$Outbound = { - companyId: string; - connectionId: string; - billId: string; - AttachmentUpload?: shared.AttachmentUpload$Outbound | undefined; -}; +export interface UploadBillAttachmentRequest { + companyId: string; + connectionId: string; + billId: string; + attachmentUpload?: AttachmentUpload | undefined; +} -/** @internal */ -export const UploadBillAttachmentRequest$outboundSchema: z.ZodType< - UploadBillAttachmentRequest$Outbound, - z.ZodTypeDef, - UploadBillAttachmentRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - billId: z.string(), - attachmentUpload: shared.AttachmentUpload$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - attachmentUpload: "AttachmentUpload", - }); -}); +export interface BillAttachmentUploadRequestBody { + companyId: string; + connectionId: string; + billId: string; + attachmentUpload?: AttachmentUpload | undefined; +} -export function uploadBillAttachmentRequestToJSON( - uploadBillAttachmentRequest: UploadBillAttachmentRequest, -): string { - return JSON.stringify( - UploadBillAttachmentRequest$outboundSchema.parse( - uploadBillAttachmentRequest, - ), - ); +export interface UploadBillAttachmentRequestBody { + companyId: string; + connectionId: string; + billId: string; + attachmentUpload?: AttachmentUpload | undefined; } diff --git a/sync-for-payables/src/sdk/models/shared/accountmappingoption.ts b/sync-for-payables/src/sdk/models/shared/accountmappingoption.ts index 7b003079c..964fa579e 100644 --- a/sync-for-payables/src/sdk/models/shared/accountmappingoption.ts +++ b/sync-for-payables/src/sdk/models/shared/accountmappingoption.ts @@ -1,70 +1,373 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { AccountStatus, AccountStatus$inboundSchema } from "./accountstatus.js"; +import { mapValues } from '../../../runtime'; +import type { AccountStatus } from './accountstatus'; +import { + AccountStatusFromJSON, + AccountStatusFromJSONTyped, + AccountStatusToJSON, + AccountStatusToJSONTyped, +} from './accountstatus'; -export type AccountMappingOption = { - /** - * Identifier for the account, unique for the company. - */ - id?: string | undefined; - /** - * 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. - */ - nominalCode?: string | null | undefined; - /** - * Name of the account. - */ - name?: string | null | undefined; - /** - * Type of account. - */ - type?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - currency?: string | undefined; - /** - * The current status of the account. - */ - status?: AccountStatus | undefined; - sourceModifiedDate?: string | undefined; -}; +/** + * + * @export + * @interface AccountMappingOption + */ +export interface AccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof AccountMappingOption + */ + id?: string; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountMappingOption + */ + name?: string | null; + /** + * Type of account. + * @type {string} + * @memberof AccountMappingOption + */ + type?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + currency?: string; + /** + * + * @type {AccountStatus} + * @memberof AccountMappingOption + */ + status?: AccountStatus; +} + + + +/** + * Check if a given object implements the AccountMappingOption interface. + */ +export function instanceOfAccountMappingOption(value: object): value is AccountMappingOption { + return true; +} + +export function AccountMappingOptionFromJSON(json: any): AccountMappingOption { + return AccountMappingOptionFromJSONTyped(json, false); +} + +export function AccountMappingOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMappingOption { + if (json == null) { + return json; + } + return { + + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + 'id': json['id'] == null ? undefined : json['id'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'] == null ? undefined : json['name'], + 'type': json['type'] == null ? undefined : json['type'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'status': json['status'] == null ? undefined : AccountStatusFromJSON(json['status']), + }; +} -/** @internal */ -export const AccountMappingOption$inboundSchema: z.ZodType< - AccountMappingOption, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - nominalCode: z.nullable(z.string()).optional(), - name: z.nullable(z.string()).optional(), - type: z.nullable(z.string()).optional(), - currency: z.string().optional(), - status: AccountStatus$inboundSchema.optional(), - sourceModifiedDate: z.string().optional(), -}); +export function AccountMappingOptionToJSON(json: any): AccountMappingOption { + return AccountMappingOptionToJSONTyped(json, false); +} + +export function AccountMappingOptionToJSONTyped(value?: AccountMappingOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceModifiedDate': value['sourceModifiedDate'], + 'id': value['id'], + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'type': value['type'], + 'currency': value['currency'], + 'status': AccountStatusToJSON(value['status']), + }; +} + + +export interface BillMappingOptionsAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof AccountMappingOption + */ + id?: string; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountMappingOption + */ + name?: string | null; + /** + * Type of account. + * @type {string} + * @memberof AccountMappingOption + */ + type?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + currency?: string; + /** + * + * @type {AccountStatus} + * @memberof AccountMappingOption + */ + status?: AccountStatus; +} + +export interface GetMappingOptionsBillsResponseAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof AccountMappingOption + */ + id?: string; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountMappingOption + */ + name?: string | null; + /** + * Type of account. + * @type {string} + * @memberof AccountMappingOption + */ + type?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + currency?: string; + /** + * + * @type {AccountStatus} + * @memberof AccountMappingOption + */ + status?: AccountStatus; +} + +export interface MappingOptionsBillsAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof AccountMappingOption + */ + id?: string; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountMappingOption + */ + name?: string | null; + /** + * Type of account. + * @type {string} + * @memberof AccountMappingOption + */ + type?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + currency?: string; + /** + * + * @type {AccountStatus} + * @memberof AccountMappingOption + */ + status?: AccountStatus; +} -export function accountMappingOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountMappingOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountMappingOption' from JSON`, - ); +export interface MappingOptionsBillsGetResponseAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof AccountMappingOption + */ + id?: string; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountMappingOption + */ + name?: string | null; + /** + * Type of account. + * @type {string} + * @memberof AccountMappingOption + */ + type?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountMappingOption + */ + currency?: string; + /** + * + * @type {AccountStatus} + * @memberof AccountMappingOption + */ + status?: AccountStatus; } diff --git a/sync-for-payables/src/sdk/models/shared/accountstatus.ts b/sync-for-payables/src/sdk/models/shared/accountstatus.ts index 8f89f1c6f..75af9a4fb 100644 --- a/sync-for-payables/src/sdk/models/shared/accountstatus.ts +++ b/sync-for-payables/src/sdk/models/shared/accountstatus.ts @@ -1,23 +1,53 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the account. + * @export */ export const AccountStatus = { - Active: "Active", - Archived: "Archived", + Active: 'Active', + Archived: 'Archived' } as const; -/** - * The current status of the account. - */ -export type AccountStatus = ClosedEnum; +export type AccountStatus = typeof AccountStatus[keyof typeof AccountStatus]; + + +export function instanceOfAccountStatus(value: any): boolean { + for (const key in AccountStatus) { + if (Object.prototype.hasOwnProperty.call(AccountStatus, key)) { + if (AccountStatus[key as keyof typeof AccountStatus] === value) { + return true; + } + } + } + return false; +} + +export function AccountStatusFromJSON(json: any): AccountStatus { + return AccountStatusFromJSONTyped(json, false); +} + +export function AccountStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStatus { + return json as AccountStatus; +} + +export function AccountStatusToJSON(value?: AccountStatus | null): any { + return value as any; +} + +export function AccountStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): AccountStatus { + return value as AccountStatus; +} -/** @internal */ -export const AccountStatus$inboundSchema: z.ZodNativeEnum< - typeof AccountStatus -> = z.nativeEnum(AccountStatus); diff --git a/sync-for-payables/src/sdk/models/shared/address.ts b/sync-for-payables/src/sdk/models/shared/address.ts index d40d6e69a..a7d7f4f04 100644 --- a/sync-for-payables/src/sdk/models/shared/address.ts +++ b/sync-for-payables/src/sdk/models/shared/address.ts @@ -1,94 +1,348 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { AddressType } from './addresstype'; import { - AddressType, - AddressType$inboundSchema, - AddressType$outboundSchema, -} from "./addresstype.js"; - -export type Address = { - /** - * The type of the address - */ - type?: AddressType | undefined; - /** - * Line 1 of the customer address. - */ - line1?: string | null | undefined; - /** - * Line 2 of the customer address. - */ - line2?: string | null | undefined; - /** - * City of the customer address. - */ - city?: string | null | undefined; - /** - * Region of the customer address. - */ - region?: string | null | undefined; - /** - * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. - */ - country?: string | null | undefined; - /** - * Postal code or zip code. - */ - postalCode?: string | null | undefined; -}; - -/** @internal */ -export const Address$inboundSchema: z.ZodType = - z.object({ - type: AddressType$inboundSchema.optional(), - line1: z.nullable(z.string()).optional(), - line2: z.nullable(z.string()).optional(), - city: z.nullable(z.string()).optional(), - region: z.nullable(z.string()).optional(), - country: z.nullable(z.string()).optional(), - postalCode: z.nullable(z.string()).optional(), - }); -/** @internal */ -export type Address$Outbound = { - type?: string | undefined; - line1?: string | null | undefined; - line2?: string | null | undefined; - city?: string | null | undefined; - region?: string | null | undefined; - country?: string | null | undefined; - postalCode?: string | null | undefined; -}; - -/** @internal */ -export const Address$outboundSchema: z.ZodType< - Address$Outbound, - z.ZodTypeDef, - Address -> = z.object({ - type: AddressType$outboundSchema.optional(), - line1: z.nullable(z.string()).optional(), - line2: z.nullable(z.string()).optional(), - city: z.nullable(z.string()).optional(), - region: z.nullable(z.string()).optional(), - country: z.nullable(z.string()).optional(), - postalCode: z.nullable(z.string()).optional(), -}); - -export function addressToJSON(address: Address): string { - return JSON.stringify(Address$outboundSchema.parse(address)); + AddressTypeFromJSON, + AddressTypeFromJSONTyped, + AddressTypeToJSON, + AddressTypeToJSONTyped, +} from './addresstype'; + +/** + * + * @export + * @interface Address + */ +export interface Address { + /** + * + * @type {AddressType} + * @memberof Address + */ + type?: AddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Address + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Address + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof Address + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof Address + */ + region?: string | null; + /** + * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. + * @type {string} + * @memberof Address + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof Address + */ + postalCode?: string | null; +} + + + +/** + * Check if a given object implements the Address interface. + */ +export function instanceOfAddress(value: object): value is Address { + return true; +} + +export function AddressFromJSON(json: any): Address { + return AddressFromJSONTyped(json, false); +} + +export function AddressFromJSONTyped(json: any, ignoreDiscriminator: boolean): Address { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : AddressTypeFromJSON(json['type']), + 'line1': json['line1'] == null ? undefined : json['line1'], + 'line2': json['line2'] == null ? undefined : json['line2'], + 'city': json['city'] == null ? undefined : json['city'], + 'region': json['region'] == null ? undefined : json['region'], + 'country': json['country'] == null ? undefined : json['country'], + 'postalCode': json['postalCode'] == null ? undefined : json['postalCode'], + }; +} + +export function AddressToJSON(json: any): Address { + return AddressToJSONTyped(json, false); } -export function addressFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Address$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Address' from JSON`, - ); + +export function AddressToJSONTyped(value?: Address | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': AddressTypeToJSON(value['type']), + 'line1': value['line1'], + 'line2': value['line2'], + 'city': value['city'], + 'region': value['region'], + 'country': value['country'], + 'postalCode': value['postalCode'], + }; +} + + +export interface CreateSupplierResponseAddress { + /** + * + * @type {AddressType} + * @memberof Address + */ + type?: AddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Address + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Address + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof Address + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof Address + */ + region?: string | null; + /** + * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. + * @type {string} + * @memberof Address + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof Address + */ + postalCode?: string | null; +} + +export interface SupplierAddress { + /** + * + * @type {AddressType} + * @memberof Address + */ + type?: AddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Address + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Address + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof Address + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof Address + */ + region?: string | null; + /** + * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. + * @type {string} + * @memberof Address + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof Address + */ + postalCode?: string | null; +} + +export interface SupplierCreateResponseAddress { + /** + * + * @type {AddressType} + * @memberof Address + */ + type?: AddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Address + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Address + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof Address + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof Address + */ + region?: string | null; + /** + * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. + * @type {string} + * @memberof Address + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof Address + */ + postalCode?: string | null; +} + +export interface SupplierUpdateResponseAddress { + /** + * + * @type {AddressType} + * @memberof Address + */ + type?: AddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Address + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Address + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof Address + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof Address + */ + region?: string | null; + /** + * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. + * @type {string} + * @memberof Address + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof Address + */ + postalCode?: string | null; +} + +export interface UpdateSupplierResponseAddress { + /** + * + * @type {AddressType} + * @memberof Address + */ + type?: AddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Address + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Address + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof Address + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof Address + */ + region?: string | null; + /** + * Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms. + * @type {string} + * @memberof Address + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof Address + */ + postalCode?: string | null; } diff --git a/sync-for-payables/src/sdk/models/shared/addresstype.ts b/sync-for-payables/src/sdk/models/shared/addresstype.ts index 79122e862..1bdb72c67 100644 --- a/sync-for-payables/src/sdk/models/shared/addresstype.ts +++ b/sync-for-payables/src/sdk/models/shared/addresstype.ts @@ -1,26 +1,54 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The type of the address + * @export */ export const AddressType = { - Unknown: "Unknown", - Billing: "Billing", - Delivery: "Delivery", + Unknown: 'Unknown', + Billing: 'Billing', + Delivery: 'Delivery' } as const; -/** - * The type of the address - */ -export type AddressType = ClosedEnum; - -/** @internal */ -export const AddressType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(AddressType); -/** @internal */ -export const AddressType$outboundSchema: z.ZodNativeEnum = - AddressType$inboundSchema; +export type AddressType = typeof AddressType[keyof typeof AddressType]; + + +export function instanceOfAddressType(value: any): boolean { + for (const key in AddressType) { + if (Object.prototype.hasOwnProperty.call(AddressType, key)) { + if (AddressType[key as keyof typeof AddressType] === value) { + return true; + } + } + } + return false; +} + +export function AddressTypeFromJSON(json: any): AddressType { + return AddressTypeFromJSONTyped(json, false); +} + +export function AddressTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressType { + return json as AddressType; +} + +export function AddressTypeToJSON(value?: AddressType | null): any { + return value as any; +} + +export function AddressTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): AddressType { + return value as AddressType; +} + diff --git a/sync-for-payables/src/sdk/models/shared/attachment.ts b/sync-for-payables/src/sdk/models/shared/attachment.ts index 56c7e61fb..f62aea8a1 100644 --- a/sync-for-payables/src/sdk/models/shared/attachment.ts +++ b/sync-for-payables/src/sdk/models/shared/attachment.ts @@ -1,103 +1,886 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. - * - * @remarks - * + * * > **Retrieving attachments** - * > + * > * > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. - * + * * Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. - * + * * Note that different integrations have different requirements for file size and extension of attachments. - * + * * | Integration | File size | File extension | * |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| * | Xero | 4 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 | * | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | * | NetSuite | 100 MB | 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". | + * @export + * @interface Attachment + */ +export interface Attachment { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +/** + * Check if a given object implements the Attachment interface. */ -export type Attachment = { - /** - * Identifier for the attachment, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the attachment file. - */ - name?: string | null | undefined; - /** - * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. - * - * @remarks - * - * Supported file types vary per platform. - */ - contentType?: string | null | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - dateCreated?: string | undefined; - /** - * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. - */ - fileSize?: number | null | undefined; - /** - * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. - */ - includeWhenSent?: boolean | undefined; - sourceModifiedDate?: string | undefined; -}; - -/** @internal */ -export const Attachment$inboundSchema: z.ZodType< - Attachment, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.nullable(z.string()).optional(), - contentType: z.nullable(z.string()).optional(), - dateCreated: z.string().optional(), - fileSize: z.nullable(z.number().int()).optional(), - includeWhenSent: z.boolean().optional(), - sourceModifiedDate: z.string().optional(), -}); - -export function attachmentFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Attachment$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Attachment' from JSON`, - ); +export function instanceOfAttachment(value: object): value is Attachment { + return true; +} + +export function AttachmentFromJSON(json: any): Attachment { + return AttachmentFromJSONTyped(json, false); +} + +export function AttachmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachment { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'contentType': json['contentType'] == null ? undefined : json['contentType'], + 'dateCreated': json['dateCreated'] == null ? undefined : json['dateCreated'], + 'fileSize': json['fileSize'] == null ? undefined : json['fileSize'], + 'includeWhenSent': json['includeWhenSent'] == null ? undefined : json['includeWhenSent'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function AttachmentToJSON(json: any): Attachment { + return AttachmentToJSONTyped(json, false); +} + +export function AttachmentToJSONTyped(value?: Attachment | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'contentType': value['contentType'], + 'dateCreated': value['dateCreated'], + 'fileSize': value['fileSize'], + 'includeWhenSent': value['includeWhenSent'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface AttachmentAttachmentMetadata { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface AttachmentMetadata { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface BillAttachmentUploadResponseAttachment { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface BillAttachmentUploadResponseAttachmentMetadata { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface BillAttachmentsListResponseAttachment { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface BillAttachmentsListResponseAttachmentMetadata { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface ListBillAttachmentsResponseAttachment { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface ListBillAttachmentsResponseAttachmentMetadata { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface UploadBillAttachmentResponseAttachment { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; +} + +export interface UploadBillAttachmentResponseAttachmentMetadata { + /** + * Identifier for the attachment, unique for the company in the accounting software. + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Name of the attachment file. + * @type {string} + * @memberof Attachment + */ + name?: string | null; + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + * @type {string} + * @memberof Attachment + */ + contentType?: string | null; + /** + * 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 {string} + * @memberof Attachment + */ + dateCreated?: string; + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + * @type {number} + * @memberof Attachment + */ + fileSize?: number | null; + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. + * @type {boolean} + * @memberof Attachment + */ + includeWhenSent?: boolean; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Attachment + */ + sourceModifiedDate?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/attachmentupload.ts b/sync-for-payables/src/sdk/models/shared/attachmentupload.ts index 9d175ab21..1ef43649c 100644 --- a/sync-for-payables/src/sdk/models/shared/attachmentupload.ts +++ b/sync-for-payables/src/sdk/models/shared/attachmentupload.ts @@ -1,40 +1,16 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { blobLikeSchema } from "../../types/blobs.js"; -import { - CodatFile, - CodatFile$Outbound, - CodatFile$outboundSchema, -} from "./codatfile.js"; +import type { CodatFile } from './codatfile'; export type AttachmentUpload = { - /** - * The file to be uploaded as an attachment. - */ - file: CodatFile | Blob; + file: CodatFile | Blob; }; -/** @internal */ -export type AttachmentUpload$Outbound = { - file: CodatFile$Outbound | Blob; -}; - -/** @internal */ -export const AttachmentUpload$outboundSchema: z.ZodType< - AttachmentUpload$Outbound, - z.ZodTypeDef, - AttachmentUpload -> = z.object({ - file: CodatFile$outboundSchema.or(blobLikeSchema), -}); +export function AttachmentUploadFromJSON(json: any): AttachmentUpload { + return json; +} -export function attachmentUploadToJSON( - attachmentUpload: AttachmentUpload, -): string { - return JSON.stringify( - AttachmentUpload$outboundSchema.parse(attachmentUpload), - ); +export function AttachmentUploadToJSON(value?: AttachmentUpload | null): any { + return value; } diff --git a/sync-for-payables/src/sdk/models/shared/bankaccount.ts b/sync-for-payables/src/sdk/models/shared/bankaccount.ts index 0f758d595..f5e552e02 100644 --- a/sync-for-payables/src/sdk/models/shared/bankaccount.ts +++ b/sync-for-payables/src/sdk/models/shared/bankaccount.ts @@ -1,101 +1,628 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { BankAccountType } from './bankaccounttype'; import { - BankAccountStatus, - BankAccountStatus$inboundSchema, -} from "./bankaccountstatus.js"; + BankAccountTypeFromJSON, + BankAccountTypeFromJSONTyped, + BankAccountTypeToJSON, + BankAccountTypeToJSONTyped, +} from './bankaccounttype'; +import type { BankAccountStatus } from './bankaccountstatus'; import { - BankAccountType, - BankAccountType$inboundSchema, -} from "./bankaccounttype.js"; - -export type BankAccount = { - /** - * Identifier for the bank account, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Name of the bank account in the accounting software. - */ - name?: string | null | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: BankAccountType | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * 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. - */ - accountNumber?: string | null | undefined; - /** - * Sort code for the bank account. This is relevant to UK bank accounts. - * - * @remarks - * - * 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. - */ - sortCode?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - currency?: string | undefined; - /** - * The current status of the bank account. - */ - status?: BankAccountStatus | undefined; - sourceModifiedDate?: string | undefined; -}; - -/** @internal */ -export const BankAccount$inboundSchema: z.ZodType< - BankAccount, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - nominalCode: z.nullable(z.string()).optional(), - name: z.nullable(z.string()).optional(), - accountType: BankAccountType$inboundSchema.optional(), - accountNumber: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - currency: z.string().optional(), - status: BankAccountStatus$inboundSchema.optional(), - sourceModifiedDate: z.string().optional(), -}); - -export function bankAccountFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccount$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccount' from JSON`, - ); + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './bankaccountstatus'; + +/** + * + * @export + * @interface BankAccount + */ +export interface BankAccount { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; +} + + + +/** + * Check if a given object implements the BankAccount interface. + */ +export function instanceOfBankAccount(value: object): value is BankAccount { + return true; +} + +export function BankAccountFromJSON(json: any): BankAccount { + return BankAccountFromJSONTyped(json, false); +} + +export function BankAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccount { + if (json == null) { + return json; + } + return { + + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + 'id': json['id'] == null ? undefined : json['id'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'] == null ? undefined : json['name'], + 'accountType': json['accountType'] == null ? undefined : BankAccountTypeFromJSON(json['accountType']), + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + }; +} + +export function BankAccountToJSON(json: any): BankAccount { + return BankAccountToJSONTyped(json, false); +} + +export function BankAccountToJSONTyped(value?: BankAccount | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceModifiedDate': value['sourceModifiedDate'], + 'id': value['id'], + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'accountType': BankAccountTypeToJSON(value['accountType']), + 'accountNumber': value['accountNumber'], + 'sortCode': value['sortCode'], + 'currency': value['currency'], + 'status': BankAccountStatusToJSON(value['status']), + }; +} + + +export interface BankAccountBankAccounts { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; +} + +export interface BankAccountCreateResponseBankAccount { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; +} + +export interface BankAccountCreateResponseBankAccounts { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; +} + +export interface BankAccounts { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; +} + +export interface CreateBankAccountResponseBankAccount { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; +} + +export interface CreateBankAccountResponseBankAccounts { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the bank account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + name?: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; } diff --git a/sync-for-payables/src/sdk/models/shared/bankaccountmappingoption.ts b/sync-for-payables/src/sdk/models/shared/bankaccountmappingoption.ts index 71fb1473e..3ecc18c6d 100644 --- a/sync-for-payables/src/sdk/models/shared/bankaccountmappingoption.ts +++ b/sync-for-payables/src/sdk/models/shared/bankaccountmappingoption.ts @@ -1,93 +1,444 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { BankAccountType } from './bankaccounttype'; import { - BankAccountStatus, - BankAccountStatus$inboundSchema, -} from "./bankaccountstatus.js"; + BankAccountTypeFromJSON, + BankAccountTypeFromJSONTyped, + BankAccountTypeToJSON, + BankAccountTypeToJSONTyped, +} from './bankaccounttype'; +import type { BankAccountStatus } from './bankaccountstatus'; import { - BankAccountType, - BankAccountType$inboundSchema, -} from "./bankaccounttype.js"; + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './bankaccountstatus'; -export type BankAccountMappingOption = { - /** - * Identifier for the account, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the bank account in the accounting software. - */ - name?: string | null | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * 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. - */ - accountNumber?: string | null | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Sort code for the bank account. - * - * @remarks - * - * 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. - */ - sortCode?: string | null | undefined; - /** - * The bank account's base currency. - */ - currency?: string | null | undefined; - /** - * The current status of the bank account. - */ - status?: BankAccountStatus | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: BankAccountType | undefined; - sourceModifiedDate?: string | undefined; -}; +/** + * + * @export + * @interface BankAccountMappingOption + */ +export interface BankAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + name?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + accountNumber?: string | null; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountMappingOption + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + sortCode?: string | null; + /** + * The bank account's base currency. + * @type {string} + * @memberof BankAccountMappingOption + */ + currency?: string | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountMappingOption + */ + status?: BankAccountStatus; + /** + * + * @type {BankAccountType} + * @memberof BankAccountMappingOption + */ + accountType?: BankAccountType; +} + + + +/** + * Check if a given object implements the BankAccountMappingOption interface. + */ +export function instanceOfBankAccountMappingOption(value: object): value is BankAccountMappingOption { + return true; +} + +export function BankAccountMappingOptionFromJSON(json: any): BankAccountMappingOption { + return BankAccountMappingOptionFromJSONTyped(json, false); +} + +export function BankAccountMappingOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountMappingOption { + if (json == null) { + return json; + } + return { + + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + 'accountType': json['accountType'] == null ? undefined : BankAccountTypeFromJSON(json['accountType']), + }; +} -/** @internal */ -export const BankAccountMappingOption$inboundSchema: z.ZodType< - BankAccountMappingOption, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - nominalCode: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - currency: z.nullable(z.string()).optional(), - status: BankAccountStatus$inboundSchema.optional(), - accountType: BankAccountType$inboundSchema.optional(), - sourceModifiedDate: z.string().optional(), -}); +export function BankAccountMappingOptionToJSON(json: any): BankAccountMappingOption { + return BankAccountMappingOptionToJSONTyped(json, false); +} + +export function BankAccountMappingOptionToJSONTyped(value?: BankAccountMappingOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceModifiedDate': value['sourceModifiedDate'], + 'id': value['id'], + 'name': value['name'], + 'accountNumber': value['accountNumber'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'currency': value['currency'], + 'status': BankAccountStatusToJSON(value['status']), + 'accountType': BankAccountTypeToJSON(value['accountType']), + }; +} + + +export interface GetMappingOptionsPaymentsResponseBankAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + name?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + accountNumber?: string | null; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountMappingOption + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + sortCode?: string | null; + /** + * The bank account's base currency. + * @type {string} + * @memberof BankAccountMappingOption + */ + currency?: string | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountMappingOption + */ + status?: BankAccountStatus; + /** + * + * @type {BankAccountType} + * @memberof BankAccountMappingOption + */ + accountType?: BankAccountType; +} + +export interface MappingOptionsPaymentsBankAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + name?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + accountNumber?: string | null; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountMappingOption + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + sortCode?: string | null; + /** + * The bank account's base currency. + * @type {string} + * @memberof BankAccountMappingOption + */ + currency?: string | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountMappingOption + */ + status?: BankAccountStatus; + /** + * + * @type {BankAccountType} + * @memberof BankAccountMappingOption + */ + accountType?: BankAccountType; +} + +export interface MappingOptionsPaymentsGetResponseBankAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + name?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + accountNumber?: string | null; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountMappingOption + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + sortCode?: string | null; + /** + * The bank account's base currency. + * @type {string} + * @memberof BankAccountMappingOption + */ + currency?: string | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountMappingOption + */ + status?: BankAccountStatus; + /** + * + * @type {BankAccountType} + * @memberof BankAccountMappingOption + */ + accountType?: BankAccountType; +} -export function bankAccountMappingOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccountMappingOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccountMappingOption' from JSON`, - ); +export interface PaymentMappingOptionsBankAccountMappingOption { + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountMappingOption + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountMappingOption + */ + name?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + accountNumber?: string | null; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountMappingOption + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountMappingOption + */ + sortCode?: string | null; + /** + * The bank account's base currency. + * @type {string} + * @memberof BankAccountMappingOption + */ + currency?: string | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountMappingOption + */ + status?: BankAccountStatus; + /** + * + * @type {BankAccountType} + * @memberof BankAccountMappingOption + */ + accountType?: BankAccountType; } diff --git a/sync-for-payables/src/sdk/models/shared/bankaccountprototype.ts b/sync-for-payables/src/sdk/models/shared/bankaccountprototype.ts index f1a8f2f59..b8f8e7e3c 100644 --- a/sync-for-payables/src/sdk/models/shared/bankaccountprototype.ts +++ b/sync-for-payables/src/sdk/models/shared/bankaccountprototype.ts @@ -1,90 +1,284 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; +import { mapValues } from '../../../runtime'; +import type { BankAccountType } from './bankaccounttype'; import { - BankAccountType, - BankAccountType$outboundSchema, -} from "./bankaccounttype.js"; + BankAccountTypeFromJSON, + BankAccountTypeFromJSONTyped, + BankAccountTypeToJSON, + BankAccountTypeToJSONTyped, +} from './bankaccounttype'; -export type BankAccountPrototype = { - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Name of the bank account in the accounting software. - */ - name: string | null; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType: BankAccountType; - /** - * Account number for the bank account. - * - * @remarks - * - * 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. - */ - accountNumber: string | null; - /** - * Sort code for the bank account. This is relevant to UK bank accounts. - * - * @remarks - * - * 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. - */ - sortCode?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - currency: string; -}; +/** + * + * @export + * @interface BankAccountPrototype + */ +export interface BankAccountPrototype { + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + name: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccountPrototype + */ + accountType: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency: string; +} + + + +/** + * Check if a given object implements the BankAccountPrototype interface. + */ +export function instanceOfBankAccountPrototype(value: object): value is BankAccountPrototype { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('accountType' in value) || value['accountType'] === undefined) return false; + if (!('accountNumber' in value) || value['accountNumber'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + return true; +} -/** @internal */ -export type BankAccountPrototype$Outbound = { - nominalCode?: string | null | undefined; - name: string | null; - accountType: string; - accountNumber: string | null; - sortCode?: string | null | undefined; - currency: string; -}; +export function BankAccountPrototypeFromJSON(json: any): BankAccountPrototype { + return BankAccountPrototypeFromJSONTyped(json, false); +} + +export function BankAccountPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountPrototype { + if (json == null) { + return json; + } + return { + + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'], + 'accountType': BankAccountTypeFromJSON(json['accountType']), + 'accountNumber': json['accountNumber'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'currency': json['currency'], + }; +} -/** @internal */ -export const BankAccountPrototype$outboundSchema: z.ZodType< - BankAccountPrototype$Outbound, - z.ZodTypeDef, - BankAccountPrototype -> = z.object({ - nominalCode: z.nullable(z.string()).optional(), - name: z.nullable(z.string()), - accountType: BankAccountType$outboundSchema, - accountNumber: z.nullable(z.string()), - sortCode: z.nullable(z.string()).optional(), - currency: z.string(), -}); +export function BankAccountPrototypeToJSON(json: any): BankAccountPrototype { + return BankAccountPrototypeToJSONTyped(json, false); +} + +export function BankAccountPrototypeToJSONTyped(value?: BankAccountPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'accountType': BankAccountTypeToJSON(value['accountType']), + 'accountNumber': value['accountNumber'], + 'sortCode': value['sortCode'], + 'currency': value['currency'], + }; +} + + +export interface BankAccountCreateRequestBody { + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + name: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccountPrototype + */ + accountType: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency: string; +} + +export interface CreateBankAccountBankAccountPrototype { + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + name: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccountPrototype + */ + accountType: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency: string; +} -export function bankAccountPrototypeToJSON( - bankAccountPrototype: BankAccountPrototype, -): string { - return JSON.stringify( - BankAccountPrototype$outboundSchema.parse(bankAccountPrototype), - ); +export interface CreateBankAccountRequestBody { + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + name: string | null; + /** + * + * @type {BankAccountType} + * @memberof BankAccountPrototype + */ + accountType: BankAccountType; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber: string | null; + /** + * Sort code for the bank account. This is relevant to UK bank accounts. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency: string; } diff --git a/sync-for-payables/src/sdk/models/shared/bankaccountstatus.ts b/sync-for-payables/src/sdk/models/shared/bankaccountstatus.ts index 5d54f42b7..480ef0d06 100644 --- a/sync-for-payables/src/sdk/models/shared/bankaccountstatus.ts +++ b/sync-for-payables/src/sdk/models/shared/bankaccountstatus.ts @@ -1,23 +1,53 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the bank account. + * @export */ export const BankAccountStatus = { - Active: "Active", - Archived: "Archived", + Active: 'Active', + Archived: 'Archived' } as const; -/** - * The current status of the bank account. - */ -export type BankAccountStatus = ClosedEnum; +export type BankAccountStatus = typeof BankAccountStatus[keyof typeof BankAccountStatus]; + + +export function instanceOfBankAccountStatus(value: any): boolean { + for (const key in BankAccountStatus) { + if (Object.prototype.hasOwnProperty.call(BankAccountStatus, key)) { + if (BankAccountStatus[key as keyof typeof BankAccountStatus] === value) { + return true; + } + } + } + return false; +} + +export function BankAccountStatusFromJSON(json: any): BankAccountStatus { + return BankAccountStatusFromJSONTyped(json, false); +} + +export function BankAccountStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountStatus { + return json as BankAccountStatus; +} + +export function BankAccountStatusToJSON(value?: BankAccountStatus | null): any { + return value as any; +} + +export function BankAccountStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): BankAccountStatus { + return value as BankAccountStatus; +} -/** @internal */ -export const BankAccountStatus$inboundSchema: z.ZodNativeEnum< - typeof BankAccountStatus -> = z.nativeEnum(BankAccountStatus); diff --git a/sync-for-payables/src/sdk/models/shared/bankaccounttype.ts b/sync-for-payables/src/sdk/models/shared/bankaccounttype.ts index 469044734..04591984d 100644 --- a/sync-for-payables/src/sdk/models/shared/bankaccounttype.ts +++ b/sync-for-payables/src/sdk/models/shared/bankaccounttype.ts @@ -1,36 +1,56 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * 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. + * @export */ export const BankAccountType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' } as const; -/** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ -export type BankAccountType = ClosedEnum; - -/** @internal */ -export const BankAccountType$inboundSchema: z.ZodNativeEnum< - typeof BankAccountType -> = z.nativeEnum(BankAccountType); -/** @internal */ -export const BankAccountType$outboundSchema: z.ZodNativeEnum< - typeof BankAccountType -> = BankAccountType$inboundSchema; +export type BankAccountType = typeof BankAccountType[keyof typeof BankAccountType]; + + +export function instanceOfBankAccountType(value: any): boolean { + for (const key in BankAccountType) { + if (Object.prototype.hasOwnProperty.call(BankAccountType, key)) { + if (BankAccountType[key as keyof typeof BankAccountType] === value) { + return true; + } + } + } + return false; +} + +export function BankAccountTypeFromJSON(json: any): BankAccountType { + return BankAccountTypeFromJSONTyped(json, false); +} + +export function BankAccountTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountType { + return json as BankAccountType; +} + +export function BankAccountTypeToJSON(value?: BankAccountType | null): any { + return value as any; +} + +export function BankAccountTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): BankAccountType { + return value as BankAccountType; +} + diff --git a/sync-for-payables/src/sdk/models/shared/bill.ts b/sync-for-payables/src/sdk/models/shared/bill.ts index 636ced5d6..82c796aa5 100644 --- a/sync-for-payables/src/sdk/models/shared/bill.ts +++ b/sync-for-payables/src/sdk/models/shared/bill.ts @@ -1,126 +1,1068 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BillStatus } from './billstatus'; +import { + BillStatusFromJSON, + BillStatusFromJSONTyped, + BillStatusToJSON, + BillStatusToJSONTyped, +} from './billstatus'; +import type { SupplierRef } from './supplierref'; +import { + SupplierRefFromJSON, + SupplierRefFromJSONTyped, + SupplierRefToJSON, + SupplierRefToJSONTyped, +} from './supplierref'; +import type { BillLineItem } from './billlineitem'; +import { + BillLineItemFromJSON, + BillLineItemFromJSONTyped, + BillLineItemToJSON, + BillLineItemToJSONTyped, +} from './billlineitem'; + +/** + * Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * @export + * @interface Bill */ +export interface Bill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { BillLineItem, BillLineItem$inboundSchema } from "./billlineitem.js"; -import { BillStatus, BillStatus$inboundSchema } from "./billstatus.js"; -import { SupplierRef, SupplierRef$inboundSchema } from "./supplierref.js"; /** - * Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * Check if a given object implements the Bill interface. */ -export type Bill = { - /** - * Identifier for the bill, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * User-friendly reference for the bill. - */ - reference?: string | null | undefined; - /** - * Reference to the supplier the record relates to. - */ - supplierRef: SupplierRef; - issueDate: string; - dueDate: string; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - /** - * Array of Bill line items. - */ - lineItems?: Array | null | undefined; - /** - * Current state of the bill. If creating a bill the status must be `Open`. - */ - status: BillStatus; - /** - * Amount of the bill, including tax. - */ - totalAmount?: Decimal$ | number | undefined; - /** - * Amount outstanding on the bill. - */ - amountDue?: Decimal$ | number | null | undefined; - sourceModifiedDate?: string | undefined; -}; - -/** @internal */ -export const Bill$inboundSchema: z.ZodType = z - .object({ - id: z.string().optional(), - reference: z.nullable(z.string()).optional(), - supplierRef: SupplierRef$inboundSchema, - issueDate: z.string(), - dueDate: z.string(), - currency: z.string(), - currencyRate: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - lineItems: z.nullable(z.array(BillLineItem$inboundSchema)).optional(), - status: BillStatus$inboundSchema, - totalAmount: z.number().transform(v => new Decimal$(v)).optional(), - amountDue: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - sourceModifiedDate: z.string().optional(), - }); - -export function billFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Bill$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Bill' from JSON`, - ); +export function instanceOfBill(value: object): value is Bill { + if (!('supplierRef' in value) || value['supplierRef'] === undefined) return false; + if (!('issueDate' in value) || value['issueDate'] === undefined) return false; + if (!('dueDate' in value) || value['dueDate'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function BillFromJSON(json: any): Bill { + return BillFromJSONTyped(json, false); +} + +export function BillFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bill { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'reference': json['reference'] == null ? undefined : json['reference'], + 'supplierRef': SupplierRefFromJSON(json['supplierRef']), + 'issueDate': json['issueDate'], + 'dueDate': json['dueDate'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'lineItems': json['lineItems'] == null ? undefined : ((json['lineItems'] as Array).map(BillLineItemFromJSON)), + 'status': BillStatusFromJSON(json['status']), + 'totalAmount': json['totalAmount'] == null ? undefined : toDecimal(json['totalAmount']), + 'amountDue': json['amountDue'] == null ? undefined : toDecimal(json['amountDue']), + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function BillToJSON(json: any): Bill { + return BillToJSONTyped(json, false); +} + +export function BillToJSONTyped(value?: Bill | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'reference': value['reference'], + 'supplierRef': SupplierRefToJSON(value['supplierRef']), + 'issueDate': value['issueDate'], + 'dueDate': value['dueDate'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'lineItems': value['lineItems'] == null ? undefined : ((value['lineItems'] as Array).map(BillLineItemToJSON)), + 'status': BillStatusToJSON(value['status']), + 'totalAmount': fromDecimal(value['totalAmount']), + 'amountDue': fromDecimal(value['amountDue']), + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface BillCreateResponseBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + +export interface BillEventWebhookBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + +export interface BillUpdateResponseBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + +export interface BillsListResponseBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + +export interface CreateBillResponseBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + +export interface ListBillsResponseBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; +} + +export interface UpdateBillResponseBill { + /** + * Identifier for the bill, unique for the company in the accounting software. + * @type {string} + * @memberof Bill + */ + id?: string; + /** + * User-friendly reference for the bill. + * @type {string} + * @memberof Bill + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof Bill + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof Bill + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof Bill + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof Bill + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof Bill + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof Bill + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof Bill + */ + status: BillStatus; + /** + * Amount of the bill, including tax. + * @type {number} + * @memberof Bill + */ + totalAmount?: Decimal | number; + /** + * Amount outstanding on the bill. + * @type {number} + * @memberof Bill + */ + amountDue?: Decimal | number | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Bill + */ + sourceModifiedDate?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/billaccountref.ts b/sync-for-payables/src/sdk/models/shared/billaccountref.ts index 592626318..0981ef535 100644 --- a/sync-for-payables/src/sdk/models/shared/billaccountref.ts +++ b/sync-for-payables/src/sdk/models/shared/billaccountref.ts @@ -1,53 +1,74 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Reference to the account to which the line item is linked. + * @export + * @interface BillAccountRef */ -export type BillAccountRef = { - /** - * 'id' from the Accounts data type. - */ - id?: string | undefined; -}; - -/** @internal */ -export const BillAccountRef$inboundSchema: z.ZodType< - BillAccountRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), -}); -/** @internal */ -export type BillAccountRef$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const BillAccountRef$outboundSchema: z.ZodType< - BillAccountRef$Outbound, - z.ZodTypeDef, - BillAccountRef -> = z.object({ - id: z.string().optional(), -}); - -export function billAccountRefToJSON(billAccountRef: BillAccountRef): string { - return JSON.stringify(BillAccountRef$outboundSchema.parse(billAccountRef)); +export interface BillAccountRef { + /** + * 'id' from the Accounts data type. + * @type {string} + * @memberof BillAccountRef + */ + id?: string; } -export function billAccountRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BillAccountRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BillAccountRef' from JSON`, - ); + +/** + * Check if a given object implements the BillAccountRef interface. + */ +export function instanceOfBillAccountRef(value: object): value is BillAccountRef { + return true; +} + +export function BillAccountRefFromJSON(json: any): BillAccountRef { + return BillAccountRefFromJSONTyped(json, false); +} + +export function BillAccountRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillAccountRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function BillAccountRefToJSON(json: any): BillAccountRef { + return BillAccountRefToJSONTyped(json, false); +} + +export function BillAccountRefToJSONTyped(value?: BillAccountRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface BillBillAccountRef { + /** + * 'id' from the Accounts data type. + * @type {string} + * @memberof BillAccountRef + */ + id?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/billlineitem.ts b/sync-for-payables/src/sdk/models/shared/billlineitem.ts index 4a8c9d46f..80665583c 100644 --- a/sync-for-payables/src/sdk/models/shared/billlineitem.ts +++ b/sync-for-payables/src/sdk/models/shared/billlineitem.ts @@ -1,126 +1,399 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BillAccountRef } from './billaccountref'; import { - BillAccountRef, - BillAccountRef$inboundSchema, - BillAccountRef$Outbound, - BillAccountRef$outboundSchema, -} from "./billaccountref.js"; + BillAccountRefFromJSON, + BillAccountRefFromJSONTyped, + BillAccountRefToJSON, + BillAccountRefToJSONTyped, +} from './billaccountref'; +import type { TrackingRef } from './trackingref'; import { - BillTaxRateRef, - BillTaxRateRef$inboundSchema, - BillTaxRateRef$Outbound, - BillTaxRateRef$outboundSchema, -} from "./billtaxrateref.js"; + TrackingRefFromJSON, + TrackingRefFromJSONTyped, + TrackingRefToJSON, + TrackingRefToJSONTyped, +} from './trackingref'; +import type { BillTaxRateRef } from './billtaxrateref'; import { - TrackingRef, - TrackingRef$inboundSchema, - TrackingRef$Outbound, - TrackingRef$outboundSchema, -} from "./trackingref.js"; + BillTaxRateRefFromJSON, + BillTaxRateRefFromJSONTyped, + BillTaxRateRefToJSON, + BillTaxRateRefToJSONTyped, +} from './billtaxrateref'; + +/** + * + * @export + * @interface BillLineItem + */ +export interface BillLineItem { + /** + * Friendly name of the goods or services received. + * @type {string} + * @memberof BillLineItem + */ + description?: string | null; + /** + * Unit price of the goods or service. + * @type {number} + * @memberof BillLineItem + */ + unitAmount?: Decimal | number; + /** + * Number of units of goods or services received. + * @type {number} + * @memberof BillLineItem + */ + quantity?: Decimal | number; + /** + * Amount of tax applied to the line item. + * @type {number} + * @memberof BillLineItem + */ + taxAmount?: Decimal | number; + /** + * + * @type {BillAccountRef} + * @memberof BillLineItem + */ + accountRef?: BillAccountRef; + /** + * Total amount of the line, including tax. + * @type {number} + * @memberof BillLineItem + */ + totalAmount?: Decimal | number | null; + /** + * + * @type {BillTaxRateRef} + * @memberof BillLineItem + */ + taxRateRef?: BillTaxRateRef; + /** + * + * @type {Array} + * @memberof BillLineItem + */ + trackingRefs?: Array | null; +} + +/** + * Check if a given object implements the BillLineItem interface. + */ +export function instanceOfBillLineItem(value: object): value is BillLineItem { + return true; +} + +export function BillLineItemFromJSON(json: any): BillLineItem { + return BillLineItemFromJSONTyped(json, false); +} + +export function BillLineItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillLineItem { + if (json == null) { + return json; + } + return { + + 'description': json['description'] == null ? undefined : json['description'], + 'unitAmount': json['unitAmount'] == null ? undefined : toDecimal(json['unitAmount']), + 'quantity': json['quantity'] == null ? undefined : toDecimal(json['quantity']), + 'taxAmount': json['taxAmount'] == null ? undefined : toDecimal(json['taxAmount']), + 'accountRef': json['accountRef'] == null ? undefined : BillAccountRefFromJSON(json['accountRef']), + 'totalAmount': json['totalAmount'] == null ? undefined : toDecimal(json['totalAmount']), + 'taxRateRef': json['taxRateRef'] == null ? undefined : BillTaxRateRefFromJSON(json['taxRateRef']), + 'trackingRefs': json['trackingRefs'] == null ? undefined : ((json['trackingRefs'] as Array).map(TrackingRefFromJSON)), + }; +} + +export function BillLineItemToJSON(json: any): BillLineItem { + return BillLineItemToJSONTyped(json, false); +} + +export function BillLineItemToJSONTyped(value?: BillLineItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'unitAmount': fromDecimal(value['unitAmount']), + 'quantity': fromDecimal(value['quantity']), + 'taxAmount': fromDecimal(value['taxAmount']), + 'accountRef': BillAccountRefToJSON(value['accountRef']), + 'totalAmount': fromDecimal(value['totalAmount']), + 'taxRateRef': BillTaxRateRefToJSON(value['taxRateRef']), + 'trackingRefs': value['trackingRefs'] == null ? undefined : ((value['trackingRefs'] as Array).map(TrackingRefToJSON)), + }; +} -export type BillLineItem = { - /** - * Friendly name of the goods or services received. - */ - description?: string | null | undefined; - /** - * Unit price of the goods or service. - */ - unitAmount?: Decimal$ | number | undefined; - /** - * Number of units of goods or services received. - */ - quantity?: Decimal$ | number | undefined; - /** - * Amount of tax applied to the line item. - */ - taxAmount?: Decimal$ | number | undefined; - /** - * Reference to the account to which the line item is linked. - */ - accountRef?: BillAccountRef | undefined; - /** - * Total amount of the line, including tax. - */ - totalAmount?: Decimal$ | number | null | undefined; - /** - * Reference to the tax rate to which the line item is linked. - */ - taxRateRef?: BillTaxRateRef | undefined; - trackingRefs?: Array | null | undefined; -}; -/** @internal */ -export const BillLineItem$inboundSchema: z.ZodType< - BillLineItem, - z.ZodTypeDef, - unknown -> = z.object({ - description: z.nullable(z.string()).optional(), - unitAmount: z.number().transform(v => new Decimal$(v)).optional(), - quantity: z.number().transform(v => new Decimal$(v)).optional(), - taxAmount: z.number().transform(v => new Decimal$(v)).optional(), - accountRef: BillAccountRef$inboundSchema.optional(), - totalAmount: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - taxRateRef: BillTaxRateRef$inboundSchema.optional(), - trackingRefs: z.nullable(z.array(TrackingRef$inboundSchema)).optional(), -}); -/** @internal */ -export type BillLineItem$Outbound = { - description?: string | null | undefined; - unitAmount?: number | undefined; - quantity?: number | undefined; - taxAmount?: number | undefined; - accountRef?: BillAccountRef$Outbound | undefined; - totalAmount?: number | null | undefined; - taxRateRef?: BillTaxRateRef$Outbound | undefined; - trackingRefs?: Array | null | undefined; -}; +export interface BillBillLineItem { + /** + * Friendly name of the goods or services received. + * @type {string} + * @memberof BillLineItem + */ + description?: string | null; + /** + * Unit price of the goods or service. + * @type {number} + * @memberof BillLineItem + */ + unitAmount?: Decimal | number; + /** + * Number of units of goods or services received. + * @type {number} + * @memberof BillLineItem + */ + quantity?: Decimal | number; + /** + * Amount of tax applied to the line item. + * @type {number} + * @memberof BillLineItem + */ + taxAmount?: Decimal | number; + /** + * + * @type {BillAccountRef} + * @memberof BillLineItem + */ + accountRef?: BillAccountRef; + /** + * Total amount of the line, including tax. + * @type {number} + * @memberof BillLineItem + */ + totalAmount?: Decimal | number | null; + /** + * + * @type {BillTaxRateRef} + * @memberof BillLineItem + */ + taxRateRef?: BillTaxRateRef; + /** + * + * @type {Array} + * @memberof BillLineItem + */ + trackingRefs?: Array | null; +} -/** @internal */ -export const BillLineItem$outboundSchema: z.ZodType< - BillLineItem$Outbound, - z.ZodTypeDef, - BillLineItem -> = z.object({ - description: z.nullable(z.string()).optional(), - unitAmount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - quantity: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - taxAmount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - accountRef: BillAccountRef$outboundSchema.optional(), - totalAmount: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - taxRateRef: BillTaxRateRef$outboundSchema.optional(), - trackingRefs: z.nullable(z.array(TrackingRef$outboundSchema)).optional(), -}); +export interface BillCreateResponseBillLineItem { + /** + * Friendly name of the goods or services received. + * @type {string} + * @memberof BillLineItem + */ + description?: string | null; + /** + * Unit price of the goods or service. + * @type {number} + * @memberof BillLineItem + */ + unitAmount?: Decimal | number; + /** + * Number of units of goods or services received. + * @type {number} + * @memberof BillLineItem + */ + quantity?: Decimal | number; + /** + * Amount of tax applied to the line item. + * @type {number} + * @memberof BillLineItem + */ + taxAmount?: Decimal | number; + /** + * + * @type {BillAccountRef} + * @memberof BillLineItem + */ + accountRef?: BillAccountRef; + /** + * Total amount of the line, including tax. + * @type {number} + * @memberof BillLineItem + */ + totalAmount?: Decimal | number | null; + /** + * + * @type {BillTaxRateRef} + * @memberof BillLineItem + */ + taxRateRef?: BillTaxRateRef; + /** + * + * @type {Array} + * @memberof BillLineItem + */ + trackingRefs?: Array | null; +} -export function billLineItemToJSON(billLineItem: BillLineItem): string { - return JSON.stringify(BillLineItem$outboundSchema.parse(billLineItem)); +export interface BillUpdateResponseBillLineItem { + /** + * Friendly name of the goods or services received. + * @type {string} + * @memberof BillLineItem + */ + description?: string | null; + /** + * Unit price of the goods or service. + * @type {number} + * @memberof BillLineItem + */ + unitAmount?: Decimal | number; + /** + * Number of units of goods or services received. + * @type {number} + * @memberof BillLineItem + */ + quantity?: Decimal | number; + /** + * Amount of tax applied to the line item. + * @type {number} + * @memberof BillLineItem + */ + taxAmount?: Decimal | number; + /** + * + * @type {BillAccountRef} + * @memberof BillLineItem + */ + accountRef?: BillAccountRef; + /** + * Total amount of the line, including tax. + * @type {number} + * @memberof BillLineItem + */ + totalAmount?: Decimal | number | null; + /** + * + * @type {BillTaxRateRef} + * @memberof BillLineItem + */ + taxRateRef?: BillTaxRateRef; + /** + * + * @type {Array} + * @memberof BillLineItem + */ + trackingRefs?: Array | null; } -export function billLineItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BillLineItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BillLineItem' from JSON`, - ); + +export interface CreateBillResponseBillLineItem { + /** + * Friendly name of the goods or services received. + * @type {string} + * @memberof BillLineItem + */ + description?: string | null; + /** + * Unit price of the goods or service. + * @type {number} + * @memberof BillLineItem + */ + unitAmount?: Decimal | number; + /** + * Number of units of goods or services received. + * @type {number} + * @memberof BillLineItem + */ + quantity?: Decimal | number; + /** + * Amount of tax applied to the line item. + * @type {number} + * @memberof BillLineItem + */ + taxAmount?: Decimal | number; + /** + * + * @type {BillAccountRef} + * @memberof BillLineItem + */ + accountRef?: BillAccountRef; + /** + * Total amount of the line, including tax. + * @type {number} + * @memberof BillLineItem + */ + totalAmount?: Decimal | number | null; + /** + * + * @type {BillTaxRateRef} + * @memberof BillLineItem + */ + taxRateRef?: BillTaxRateRef; + /** + * + * @type {Array} + * @memberof BillLineItem + */ + trackingRefs?: Array | null; +} + +export interface UpdateBillResponseBillLineItem { + /** + * Friendly name of the goods or services received. + * @type {string} + * @memberof BillLineItem + */ + description?: string | null; + /** + * Unit price of the goods or service. + * @type {number} + * @memberof BillLineItem + */ + unitAmount?: Decimal | number; + /** + * Number of units of goods or services received. + * @type {number} + * @memberof BillLineItem + */ + quantity?: Decimal | number; + /** + * Amount of tax applied to the line item. + * @type {number} + * @memberof BillLineItem + */ + taxAmount?: Decimal | number; + /** + * + * @type {BillAccountRef} + * @memberof BillLineItem + */ + accountRef?: BillAccountRef; + /** + * Total amount of the line, including tax. + * @type {number} + * @memberof BillLineItem + */ + totalAmount?: Decimal | number | null; + /** + * + * @type {BillTaxRateRef} + * @memberof BillLineItem + */ + taxRateRef?: BillTaxRateRef; + /** + * + * @type {Array} + * @memberof BillLineItem + */ + trackingRefs?: Array | null; } diff --git a/sync-for-payables/src/sdk/models/shared/billmappingoptions.ts b/sync-for-payables/src/sdk/models/shared/billmappingoptions.ts index 24bcf3518..6dbb61cac 100644 --- a/sync-for-payables/src/sdk/models/shared/billmappingoptions.ts +++ b/sync-for-payables/src/sdk/models/shared/billmappingoptions.ts @@ -1,47 +1,223 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { TaxRateMappingOption } from './taxratemappingoption'; +import { mapValues } from '../../../runtime'; +import type { Pagination } from './pagination'; import { - AccountMappingOption, - AccountMappingOption$inboundSchema, -} from "./accountmappingoption.js"; -import { Pagination, Pagination$inboundSchema } from "./pagination.js"; + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './pagination'; +import type { AccountMappingOption } from './accountmappingoption'; import { - TaxRateMappingOption, - TaxRateMappingOption$inboundSchema, -} from "./taxratemappingoption.js"; + AccountMappingOptionFromJSON, + AccountMappingOptionFromJSONTyped, + AccountMappingOptionToJSON, + AccountMappingOptionToJSONTyped, +} from './accountmappingoption'; /** * The bill mapping options for a company's accounting software. + * @export + * @interface BillMappingOptions */ -export type BillMappingOptions = { - accounts?: Array | undefined; - taxRates?: Array | undefined; - pagination?: Pagination | undefined; -}; - -/** @internal */ -export const BillMappingOptions$inboundSchema: z.ZodType< - BillMappingOptions, - z.ZodTypeDef, - unknown -> = z.object({ - accounts: z.array(z.nullable(AccountMappingOption$inboundSchema)).optional(), - taxRates: z.array(TaxRateMappingOption$inboundSchema).optional(), - pagination: Pagination$inboundSchema.optional(), -}); - -export function billMappingOptionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BillMappingOptions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BillMappingOptions' from JSON`, - ); +export interface BillMappingOptions { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the BillMappingOptions interface. + */ +export function instanceOfBillMappingOptions(value: object): value is BillMappingOptions { + return true; +} + +export function BillMappingOptionsFromJSON(json: any): BillMappingOptions { + return BillMappingOptionsFromJSONTyped(json, false); +} + +export function BillMappingOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillMappingOptions { + if (json == null) { + return json; + } + return { + + 'accounts': json['accounts'] == null ? undefined : ((json['accounts'] as Array).map(AccountMappingOptionFromJSON)), + 'taxRates': json['taxRates'] == null ? undefined : json['taxRates'], + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function BillMappingOptionsToJSON(json: any): BillMappingOptions { + return BillMappingOptionsToJSONTyped(json, false); +} + +export function BillMappingOptionsToJSONTyped(value?: BillMappingOptions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accounts': value['accounts'] == null ? undefined : ((value['accounts'] as Array).map(AccountMappingOptionToJSON)), + 'taxRates': value['taxRates'], + 'pagination': PaginationToJSON(value['pagination']), + }; +} + + +export interface BillMappingOptionsMappingOptionsBills { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; +} + +export interface GetMappingOptionsBillsResponseBillMappingOptions { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; +} + +export interface GetMappingOptionsBillsResponseMappingOptionsBills { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; +} + +export interface MappingOptionsBills { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; +} + +export interface MappingOptionsBillsGetResponseBillMappingOptions { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; +} + +export interface MappingOptionsBillsGetResponseMappingOptionsBills { + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + accounts?: Array; + /** + * + * @type {Array} + * @memberof BillMappingOptions + */ + taxRates?: Array; + /** + * + * @type {Pagination} + * @memberof BillMappingOptions + */ + pagination?: Pagination; } diff --git a/sync-for-payables/src/sdk/models/shared/billpayment.ts b/sync-for-payables/src/sdk/models/shared/billpayment.ts index 9bd476116..42cdfa9e7 100644 --- a/sync-for-payables/src/sdk/models/shared/billpayment.ts +++ b/sync-for-payables/src/sdk/models/shared/billpayment.ts @@ -1,94 +1,285 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BillPaymentAccountRef } from './billpaymentaccountref'; import { - BillPaymentAccountRef, - BillPaymentAccountRef$inboundSchema, -} from "./billpaymentaccountref.js"; + BillPaymentAccountRefFromJSON, + BillPaymentAccountRefFromJSONTyped, + BillPaymentAccountRefToJSON, + BillPaymentAccountRefToJSONTyped, +} from './billpaymentaccountref'; -export type BillPayment = { - /** - * Identifier for the bill payment, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Amount of the payment in the bill currency. - */ - amount?: Decimal$ | number | undefined; - date?: string | undefined; - /** - * Additional information associated with the payment. - */ - reference?: string | null | undefined; - /** - * Reference to the bank account / credit card which you are using to pay the bill. - */ - accountRef?: BillPaymentAccountRef | undefined; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; -}; +/** + * + * @export + * @interface BillPayment + */ +export interface BillPayment { + /** + * Identifier for the bill payment, unique for the company in the accounting software. + * @type {string} + * @memberof BillPayment + */ + id?: string; + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPayment + */ + amount?: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPayment + */ + date?: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPayment + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPayment + */ + accountRef?: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPayment + */ + currencyRate?: Decimal | number | null; +} + +/** + * Check if a given object implements the BillPayment interface. + */ +export function instanceOfBillPayment(value: object): value is BillPayment { + return true; +} + +export function BillPaymentFromJSON(json: any): BillPayment { + return BillPaymentFromJSONTyped(json, false); +} + +export function BillPaymentFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillPayment { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'amount': json['amount'] == null ? undefined : toDecimal(json['amount']), + 'date': json['date'] == null ? undefined : json['date'], + 'reference': json['reference'] == null ? undefined : json['reference'], + 'accountRef': json['accountRef'] == null ? undefined : BillPaymentAccountRefFromJSON(json['accountRef']), + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + }; +} + +export function BillPaymentToJSON(json: any): BillPayment { + return BillPaymentToJSONTyped(json, false); +} + +export function BillPaymentToJSONTyped(value?: BillPayment | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @internal */ -export const BillPayment$inboundSchema: z.ZodType< - BillPayment, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - amount: z.number().transform(v => new Decimal$(v)).optional(), - date: z.string().optional(), - reference: z.nullable(z.string()).optional(), - accountRef: BillPaymentAccountRef$inboundSchema.optional(), - currencyRate: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), -}); + return { + + 'id': value['id'], + 'amount': fromDecimal(value['amount']), + 'date': value['date'], + 'reference': value['reference'], + 'accountRef': BillPaymentAccountRefToJSON(value['accountRef']), + 'currencyRate': fromDecimal(value['currencyRate']), + }; +} + + +export interface BillPaymentCreateResponseBillPayment { + /** + * Identifier for the bill payment, unique for the company in the accounting software. + * @type {string} + * @memberof BillPayment + */ + id?: string; + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPayment + */ + amount?: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPayment + */ + date?: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPayment + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPayment + */ + accountRef?: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPayment + */ + currencyRate?: Decimal | number | null; +} -export function billPaymentFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BillPayment$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BillPayment' from JSON`, - ); +export interface CreateBillPaymentResponseBillPayment { + /** + * Identifier for the bill payment, unique for the company in the accounting software. + * @type {string} + * @memberof BillPayment + */ + id?: string; + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPayment + */ + amount?: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPayment + */ + date?: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPayment + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPayment + */ + accountRef?: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPayment + */ + currencyRate?: Decimal | number | null; } diff --git a/sync-for-payables/src/sdk/models/shared/billpaymentaccountref.ts b/sync-for-payables/src/sdk/models/shared/billpaymentaccountref.ts index 6397a853d..ee663ae42 100644 --- a/sync-for-payables/src/sdk/models/shared/billpaymentaccountref.ts +++ b/sync-for-payables/src/sdk/models/shared/billpaymentaccountref.ts @@ -1,57 +1,93 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Reference to the bank account / credit card which you are using to pay the bill. + * @export + * @interface BillPaymentAccountRef + */ +export interface BillPaymentAccountRef { + /** + * Unique ID of the bank account / credit card + * @type {string} + * @memberof BillPaymentAccountRef + */ + id: string; +} + +/** + * Check if a given object implements the BillPaymentAccountRef interface. */ -export type BillPaymentAccountRef = { - /** - * Unique ID of the bank account / credit card - */ - id: string; -}; - -/** @internal */ -export const BillPaymentAccountRef$inboundSchema: z.ZodType< - BillPaymentAccountRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), -}); -/** @internal */ -export type BillPaymentAccountRef$Outbound = { - id: string; -}; - -/** @internal */ -export const BillPaymentAccountRef$outboundSchema: z.ZodType< - BillPaymentAccountRef$Outbound, - z.ZodTypeDef, - BillPaymentAccountRef -> = z.object({ - id: z.string(), -}); - -export function billPaymentAccountRefToJSON( - billPaymentAccountRef: BillPaymentAccountRef, -): string { - return JSON.stringify( - BillPaymentAccountRef$outboundSchema.parse(billPaymentAccountRef), - ); -} -export function billPaymentAccountRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BillPaymentAccountRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BillPaymentAccountRef' from JSON`, - ); +export function instanceOfBillPaymentAccountRef(value: object): value is BillPaymentAccountRef { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function BillPaymentAccountRefFromJSON(json: any): BillPaymentAccountRef { + return BillPaymentAccountRefFromJSONTyped(json, false); +} + +export function BillPaymentAccountRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillPaymentAccountRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function BillPaymentAccountRefToJSON(json: any): BillPaymentAccountRef { + return BillPaymentAccountRefToJSONTyped(json, false); +} + +export function BillPaymentAccountRefToJSONTyped(value?: BillPaymentAccountRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface BillPaymentBillPaymentAccountRef { + /** + * Unique ID of the bank account / credit card + * @type {string} + * @memberof BillPaymentAccountRef + */ + id: string; +} + +export interface BillPaymentCreateResponseBillPaymentAccountRef { + /** + * Unique ID of the bank account / credit card + * @type {string} + * @memberof BillPaymentAccountRef + */ + id: string; +} + +export interface CreateBillPaymentResponseBillPaymentAccountRef { + /** + * Unique ID of the bank account / credit card + * @type {string} + * @memberof BillPaymentAccountRef + */ + id: string; } diff --git a/sync-for-payables/src/sdk/models/shared/billpaymentprototype.ts b/sync-for-payables/src/sdk/models/shared/billpaymentprototype.ts index 147e6551f..7adf07f6f 100644 --- a/sync-for-payables/src/sdk/models/shared/billpaymentprototype.ts +++ b/sync-for-payables/src/sdk/models/shared/billpaymentprototype.ts @@ -1,99 +1,332 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BillPaymentAccountRef } from './billpaymentaccountref'; import { - BillPaymentAccountRef, - BillPaymentAccountRef$Outbound, - BillPaymentAccountRef$outboundSchema, -} from "./billpaymentaccountref.js"; + BillPaymentAccountRefFromJSON, + BillPaymentAccountRefFromJSONTyped, + BillPaymentAccountRefToJSON, + BillPaymentAccountRefToJSONTyped, +} from './billpaymentaccountref'; -export type BillPaymentPrototype = { - /** - * Amount of the payment in the bill currency. - */ - amount: Decimal$ | number; - date: string; - /** - * Additional information associated with the payment. - */ - reference?: string | null | undefined; - /** - * Reference to the bank account / credit card which you are using to pay the bill. - */ - accountRef: BillPaymentAccountRef; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; -}; +/** + * + * @export + * @interface BillPaymentPrototype + */ +export interface BillPaymentPrototype { + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPaymentPrototype + */ + amount: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPaymentPrototype + */ + date: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPaymentPrototype + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPaymentPrototype + */ + accountRef: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPaymentPrototype + */ + currencyRate?: Decimal | number | null; +} -/** @internal */ -export type BillPaymentPrototype$Outbound = { - amount: number; - date: string; - reference?: string | null | undefined; - accountRef: BillPaymentAccountRef$Outbound; - currencyRate?: number | null | undefined; -}; +/** + * Check if a given object implements the BillPaymentPrototype interface. + */ +export function instanceOfBillPaymentPrototype(value: object): value is BillPaymentPrototype { + if (!('amount' in value) || value['amount'] === undefined) return false; + if (!('date' in value) || value['date'] === undefined) return false; + if (!('accountRef' in value) || value['accountRef'] === undefined) return false; + return true; +} -/** @internal */ -export const BillPaymentPrototype$outboundSchema: z.ZodType< - BillPaymentPrototype$Outbound, - z.ZodTypeDef, - BillPaymentPrototype -> = z.object({ - amount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - date: z.string(), - reference: z.nullable(z.string()).optional(), - accountRef: BillPaymentAccountRef$outboundSchema, - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), -}); +export function BillPaymentPrototypeFromJSON(json: any): BillPaymentPrototype { + return BillPaymentPrototypeFromJSONTyped(json, false); +} + +export function BillPaymentPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillPaymentPrototype { + if (json == null) { + return json; + } + return { + + 'amount': json['amount'], + 'date': json['date'], + 'reference': json['reference'] == null ? undefined : json['reference'], + 'accountRef': BillPaymentAccountRefFromJSON(json['accountRef']), + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + }; +} + +export function BillPaymentPrototypeToJSON(json: any): BillPaymentPrototype { + return BillPaymentPrototypeToJSONTyped(json, false); +} + +export function BillPaymentPrototypeToJSONTyped(value?: BillPaymentPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'amount': fromDecimal(value['amount']), + 'date': value['date'], + 'reference': value['reference'], + 'accountRef': BillPaymentAccountRefToJSON(value['accountRef']), + 'currencyRate': fromDecimal(value['currencyRate']), + }; +} + + +export interface BillPaymentCreateRequestBody { + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPaymentPrototype + */ + amount: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPaymentPrototype + */ + date: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPaymentPrototype + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPaymentPrototype + */ + accountRef: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPaymentPrototype + */ + currencyRate?: Decimal | number | null; +} + +export interface CreateBillPaymentBillPaymentPrototype { + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPaymentPrototype + */ + amount: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPaymentPrototype + */ + date: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPaymentPrototype + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPaymentPrototype + */ + accountRef: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPaymentPrototype + */ + currencyRate?: Decimal | number | null; +} -export function billPaymentPrototypeToJSON( - billPaymentPrototype: BillPaymentPrototype, -): string { - return JSON.stringify( - BillPaymentPrototype$outboundSchema.parse(billPaymentPrototype), - ); +export interface CreateBillPaymentRequestBody { + /** + * Amount of the payment in the bill currency. + * @type {number} + * @memberof BillPaymentPrototype + */ + amount: Decimal | number; + /** + * Date the bill payment was recorded in the accounting software. + * @type {string} + * @memberof BillPaymentPrototype + */ + date: string; + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPaymentPrototype + */ + reference?: string | null; + /** + * + * @type {BillPaymentAccountRef} + * @memberof BillPaymentPrototype + */ + accountRef: BillPaymentAccountRef; + /** + * 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. | + * @type {number} + * @memberof BillPaymentPrototype + */ + currencyRate?: Decimal | number | null; } diff --git a/sync-for-payables/src/sdk/models/shared/billprototype.ts b/sync-for-payables/src/sdk/models/shared/billprototype.ts index 3cecca220..842c771aa 100644 --- a/sync-for-payables/src/sdk/models/shared/billprototype.ts +++ b/sync-for-payables/src/sdk/models/shared/billprototype.ts @@ -1,122 +1,716 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BillStatus } from './billstatus'; import { - BillLineItem, - BillLineItem$Outbound, - BillLineItem$outboundSchema, -} from "./billlineitem.js"; -import { BillStatus, BillStatus$outboundSchema } from "./billstatus.js"; + BillStatusFromJSON, + BillStatusFromJSONTyped, + BillStatusToJSON, + BillStatusToJSONTyped, +} from './billstatus'; +import type { SupplierRef } from './supplierref'; import { - SupplierRef, - SupplierRef$Outbound, - SupplierRef$outboundSchema, -} from "./supplierref.js"; - -export type BillPrototype = { - /** - * User-friendly reference for the bill. - */ - reference?: string | null | undefined; - /** - * Reference to the supplier the record relates to. - */ - supplierRef: SupplierRef; - issueDate: string; - dueDate: string; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - /** - * Array of Bill line items. - */ - lineItems?: Array | null | undefined; - /** - * Current state of the bill. If creating a bill the status must be `Open`. - */ - status: BillStatus; -}; - -/** @internal */ -export type BillPrototype$Outbound = { - reference?: string | null | undefined; - supplierRef: SupplierRef$Outbound; - issueDate: string; - dueDate: string; - currency: string; - currencyRate?: number | null | undefined; - lineItems?: Array | null | undefined; - status: string; -}; - -/** @internal */ -export const BillPrototype$outboundSchema: z.ZodType< - BillPrototype$Outbound, - z.ZodTypeDef, - BillPrototype -> = z.object({ - reference: z.nullable(z.string()).optional(), - supplierRef: SupplierRef$outboundSchema, - issueDate: z.string(), - dueDate: z.string(), - currency: z.string(), - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - lineItems: z.nullable(z.array(BillLineItem$outboundSchema)).optional(), - status: BillStatus$outboundSchema, -}); - -export function billPrototypeToJSON(billPrototype: BillPrototype): string { - return JSON.stringify(BillPrototype$outboundSchema.parse(billPrototype)); + SupplierRefFromJSON, + SupplierRefFromJSONTyped, + SupplierRefToJSON, + SupplierRefToJSONTyped, +} from './supplierref'; +import type { BillLineItem } from './billlineitem'; +import { + BillLineItemFromJSON, + BillLineItemFromJSONTyped, + BillLineItemToJSON, + BillLineItemToJSONTyped, +} from './billlineitem'; + +/** + * + * @export + * @interface BillPrototype + */ +export interface BillPrototype { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; +} + + + +/** + * Check if a given object implements the BillPrototype interface. + */ +export function instanceOfBillPrototype(value: object): value is BillPrototype { + if (!('supplierRef' in value) || value['supplierRef'] === undefined) return false; + if (!('issueDate' in value) || value['issueDate'] === undefined) return false; + if (!('dueDate' in value) || value['dueDate'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function BillPrototypeFromJSON(json: any): BillPrototype { + return BillPrototypeFromJSONTyped(json, false); +} + +export function BillPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillPrototype { + if (json == null) { + return json; + } + return { + + 'reference': json['reference'] == null ? undefined : json['reference'], + 'supplierRef': SupplierRefFromJSON(json['supplierRef']), + 'issueDate': json['issueDate'], + 'dueDate': json['dueDate'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'lineItems': json['lineItems'] == null ? undefined : ((json['lineItems'] as Array).map(BillLineItemFromJSON)), + 'status': BillStatusFromJSON(json['status']), + }; +} + +export function BillPrototypeToJSON(json: any): BillPrototype { + return BillPrototypeToJSONTyped(json, false); +} + +export function BillPrototypeToJSONTyped(value?: BillPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'reference': value['reference'], + 'supplierRef': SupplierRefToJSON(value['supplierRef']), + 'issueDate': value['issueDate'], + 'dueDate': value['dueDate'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'lineItems': value['lineItems'] == null ? undefined : ((value['lineItems'] as Array).map(BillLineItemToJSON)), + 'status': BillStatusToJSON(value['status']), + }; +} + + +export interface BillCreateRequestBody { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; +} + +export interface BillUpdateRequestBody { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; +} + +export interface CreateBillBillPrototype { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; +} + +export interface CreateBillRequestBody { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; +} + +export interface UpdateBillBillPrototype { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; +} + +export interface UpdateBillRequestBody { + /** + * Additional information associated with the payment. + * @type {string} + * @memberof BillPrototype + */ + reference?: string | null; + /** + * + * @type {SupplierRef} + * @memberof BillPrototype + */ + supplierRef: SupplierRef; + /** + * Date of the bill as recorded in the accounting software. + * @type {string} + * @memberof BillPrototype + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof BillPrototype + */ + dueDate: string; + /** + * 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. + * @type {string} + * @memberof BillPrototype + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof BillPrototype + */ + currencyRate?: Decimal | number | null; + /** + * Array of Bill line items. + * @type {Array} + * @memberof BillPrototype + */ + lineItems?: Array | null; + /** + * + * @type {BillStatus} + * @memberof BillPrototype + */ + status: BillStatus; } diff --git a/sync-for-payables/src/sdk/models/shared/bills.ts b/sync-for-payables/src/sdk/models/shared/bills.ts index 3c3aea425..0c2e61ab9 100644 --- a/sync-for-payables/src/sdk/models/shared/bills.ts +++ b/sync-for-payables/src/sdk/models/shared/bills.ts @@ -1,32 +1,118 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Bill, Bill$inboundSchema } from "./bill.js"; -import { Pagination, Pagination$inboundSchema } from "./pagination.js"; - -export type Bills = { - results?: Array | undefined; - pagination?: Pagination | undefined; -}; - -/** @internal */ -export const Bills$inboundSchema: z.ZodType = z - .object({ - results: z.array(Bill$inboundSchema).optional(), - pagination: Pagination$inboundSchema.optional(), - }); - -export function billsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Bills$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Bills' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Pagination } from './pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './pagination'; +import type { Bill } from './bill'; +import { + BillFromJSON, + BillFromJSONTyped, + BillToJSON, + BillToJSONTyped, +} from './bill'; + +/** + * + * @export + * @interface Bills + */ +export interface Bills { + /** + * + * @type {Array} + * @memberof Bills + */ + results?: Array; + /** + * + * @type {Pagination} + * @memberof Bills + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the Bills interface. + */ +export function instanceOfBills(value: object): value is Bills { + return true; +} + +export function BillsFromJSON(json: any): Bills { + return BillsFromJSONTyped(json, false); +} + +export function BillsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bills { + if (json == null) { + return json; + } + return { + + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(BillFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function BillsToJSON(json: any): Bills { + return BillsToJSONTyped(json, false); +} + +export function BillsToJSONTyped(value?: Bills | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(BillToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + + +export interface BillsListResponseBills { + /** + * + * @type {Array} + * @memberof Bills + */ + results?: Array; + /** + * + * @type {Pagination} + * @memberof Bills + */ + pagination?: Pagination; +} + +export interface ListBillsResponseBills { + /** + * + * @type {Array} + * @memberof Bills + */ + results?: Array; + /** + * + * @type {Pagination} + * @memberof Bills + */ + pagination?: Pagination; } diff --git a/sync-for-payables/src/sdk/models/shared/billstatus.ts b/sync-for-payables/src/sdk/models/shared/billstatus.ts index 3db643f25..de1936c9a 100644 --- a/sync-for-payables/src/sdk/models/shared/billstatus.ts +++ b/sync-for-payables/src/sdk/models/shared/billstatus.ts @@ -1,29 +1,57 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Current state of the bill. If creating a bill the status must be `Open`. + * @export */ export const BillStatus = { - Unknown: "Unknown", - Open: "Open", - PartiallyPaid: "PartiallyPaid", - Paid: "Paid", - Void: "Void", - Draft: "Draft", + Unknown: 'Unknown', + Open: 'Open', + PartiallyPaid: 'PartiallyPaid', + Paid: 'Paid', + Void: 'Void', + Draft: 'Draft' } as const; -/** - * Current state of the bill. If creating a bill the status must be `Open`. - */ -export type BillStatus = ClosedEnum; - -/** @internal */ -export const BillStatus$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(BillStatus); -/** @internal */ -export const BillStatus$outboundSchema: z.ZodNativeEnum = - BillStatus$inboundSchema; +export type BillStatus = typeof BillStatus[keyof typeof BillStatus]; + + +export function instanceOfBillStatus(value: any): boolean { + for (const key in BillStatus) { + if (Object.prototype.hasOwnProperty.call(BillStatus, key)) { + if (BillStatus[key as keyof typeof BillStatus] === value) { + return true; + } + } + } + return false; +} + +export function BillStatusFromJSON(json: any): BillStatus { + return BillStatusFromJSONTyped(json, false); +} + +export function BillStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillStatus { + return json as BillStatus; +} + +export function BillStatusToJSON(value?: BillStatus | null): any { + return value as any; +} + +export function BillStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): BillStatus { + return value as BillStatus; +} + diff --git a/sync-for-payables/src/sdk/models/shared/billtaxrateref.ts b/sync-for-payables/src/sdk/models/shared/billtaxrateref.ts index b28f0fd51..02290b730 100644 --- a/sync-for-payables/src/sdk/models/shared/billtaxrateref.ts +++ b/sync-for-payables/src/sdk/models/shared/billtaxrateref.ts @@ -1,53 +1,74 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Reference to the tax rate to which the line item is linked. + * @export + * @interface BillTaxRateRef */ -export type BillTaxRateRef = { - /** - * Unique identifier for the tax rate in the accounting software. - */ - id?: string | undefined; -}; - -/** @internal */ -export const BillTaxRateRef$inboundSchema: z.ZodType< - BillTaxRateRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), -}); -/** @internal */ -export type BillTaxRateRef$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const BillTaxRateRef$outboundSchema: z.ZodType< - BillTaxRateRef$Outbound, - z.ZodTypeDef, - BillTaxRateRef -> = z.object({ - id: z.string().optional(), -}); - -export function billTaxRateRefToJSON(billTaxRateRef: BillTaxRateRef): string { - return JSON.stringify(BillTaxRateRef$outboundSchema.parse(billTaxRateRef)); +export interface BillTaxRateRef { + /** + * Unique identifier for the tax rate in the accounting software. + * @type {string} + * @memberof BillTaxRateRef + */ + id?: string; } -export function billTaxRateRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BillTaxRateRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BillTaxRateRef' from JSON`, - ); + +/** + * Check if a given object implements the BillTaxRateRef interface. + */ +export function instanceOfBillTaxRateRef(value: object): value is BillTaxRateRef { + return true; +} + +export function BillTaxRateRefFromJSON(json: any): BillTaxRateRef { + return BillTaxRateRefFromJSONTyped(json, false); +} + +export function BillTaxRateRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillTaxRateRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function BillTaxRateRefToJSON(json: any): BillTaxRateRef { + return BillTaxRateRefToJSONTyped(json, false); +} + +export function BillTaxRateRefToJSONTyped(value?: BillTaxRateRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface BillBillTaxRateRef { + /** + * Unique identifier for the tax rate in the accounting software. + * @type {string} + * @memberof BillTaxRateRef + */ + id?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/clientratelimitwebhook.ts b/sync-for-payables/src/sdk/models/shared/clientratelimitwebhook.ts index cdc40c0b8..64aa8d868 100644 --- a/sync-for-payables/src/sdk/models/shared/clientratelimitwebhook.ts +++ b/sync-for-payables/src/sdk/models/shared/clientratelimitwebhook.ts @@ -1,96 +1,115 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ClientRateLimitWebhookPayload } from './clientratelimitwebhookpayload'; import { - ClientRateLimitWebhookPayload, - ClientRateLimitWebhookPayload$inboundSchema, - ClientRateLimitWebhookPayload$Outbound, - ClientRateLimitWebhookPayload$outboundSchema, -} from "./clientratelimitwebhookpayload.js"; + ClientRateLimitWebhookPayloadFromJSON, + ClientRateLimitWebhookPayloadFromJSONTyped, + ClientRateLimitWebhookPayloadToJSON, + ClientRateLimitWebhookPayloadToJSONTyped, +} from './clientratelimitwebhookpayload'; -export type ClientRateLimitWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: string | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload | undefined; -}; +/** + * + * @export + * @interface ClientRateLimitWebhook + */ +export interface ClientRateLimitWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + eventType?: string; + /** + * 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 {string} + * @memberof ClientRateLimitWebhook + */ + generatedDate?: string; + /** + * + * @type {ClientRateLimitWebhookPayload} + * @memberof ClientRateLimitWebhook + */ + payload?: ClientRateLimitWebhookPayload; +} + +/** + * Check if a given object implements the ClientRateLimitWebhook interface. + */ +export function instanceOfClientRateLimitWebhook(value: object): value is ClientRateLimitWebhook { + return true; +} -/** @internal */ -export const ClientRateLimitWebhook$inboundSchema: z.ZodType< - ClientRateLimitWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ClientRateLimitWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload$Outbound | undefined; -}; +export function ClientRateLimitWebhookFromJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookFromJSONTyped(json, false); +} -/** @internal */ -export const ClientRateLimitWebhook$outboundSchema: z.ZodType< - ClientRateLimitWebhook$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$outboundSchema.optional(), -}); +export function ClientRateLimitWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ClientRateLimitWebhookPayloadFromJSON(json['payload']), + }; +} -export function clientRateLimitWebhookToJSON( - clientRateLimitWebhook: ClientRateLimitWebhook, -): string { - return JSON.stringify( - ClientRateLimitWebhook$outboundSchema.parse(clientRateLimitWebhook), - ); +export function ClientRateLimitWebhookToJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookToJSONTyped(json, false); } -export function clientRateLimitWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhook' from JSON`, - ); + +export function ClientRateLimitWebhookToJSONTyped(value?: ClientRateLimitWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ClientRateLimitWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/sync-for-payables/src/sdk/models/shared/clientratelimitwebhookpayload.ts b/sync-for-payables/src/sdk/models/shared/clientratelimitwebhookpayload.ts index 72605d624..508cd94c0 100644 --- a/sync-for-payables/src/sdk/models/shared/clientratelimitwebhookpayload.ts +++ b/sync-for-payables/src/sdk/models/shared/clientratelimitwebhookpayload.ts @@ -1,88 +1,138 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ClientRateLimitWebhookPayload + */ +export interface ClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * 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 {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; +} -export type ClientRateLimitWebhookPayload = { - /** - * The number of available requests per day. - */ - dailyQuota?: number | undefined; - /** - * Total number of requests remaining for your client. - */ - quotaRemaining?: number | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - expiryDate?: string | undefined; -}; +/** + * Check if a given object implements the ClientRateLimitWebhookPayload interface. + */ +export function instanceOfClientRateLimitWebhookPayload(value: object): value is ClientRateLimitWebhookPayload { + return true; +} -/** @internal */ -export const ClientRateLimitWebhookPayload$inboundSchema: z.ZodType< - ClientRateLimitWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); -/** @internal */ -export type ClientRateLimitWebhookPayload$Outbound = { - dailyQuota?: number | undefined; - quotaRemaining?: number | undefined; - expiryDate?: string | undefined; -}; +export function ClientRateLimitWebhookPayloadFromJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadFromJSONTyped(json, false); +} -/** @internal */ -export const ClientRateLimitWebhookPayload$outboundSchema: z.ZodType< - ClientRateLimitWebhookPayload$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhookPayload -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); +export function ClientRateLimitWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhookPayload { + if (json == null) { + return json; + } + return { + + 'dailyQuota': json['dailyQuota'] == null ? undefined : json['dailyQuota'], + 'quotaRemaining': json['quotaRemaining'] == null ? undefined : json['quotaRemaining'], + 'expiryDate': json['expiryDate'] == null ? undefined : json['expiryDate'], + }; +} -export function clientRateLimitWebhookPayloadToJSON( - clientRateLimitWebhookPayload: ClientRateLimitWebhookPayload, -): string { - return JSON.stringify( - ClientRateLimitWebhookPayload$outboundSchema.parse( - clientRateLimitWebhookPayload, - ), - ); +export function ClientRateLimitWebhookPayloadToJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadToJSONTyped(json, false); } -export function clientRateLimitWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhookPayload' from JSON`, - ); + +export function ClientRateLimitWebhookPayloadToJSONTyped(value?: ClientRateLimitWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dailyQuota': value['dailyQuota'], + 'quotaRemaining': value['quotaRemaining'], + 'expiryDate': value['expiryDate'], + }; +} + + +export interface ClientRateLimitWebhookClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * 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 {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/codatfile.ts b/sync-for-payables/src/sdk/models/shared/codatfile.ts index 0bc3490e3..39ee97b39 100644 --- a/sync-for-payables/src/sdk/models/shared/codatfile.ts +++ b/sync-for-payables/src/sdk/models/shared/codatfile.ts @@ -1,35 +1,15 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; +/* tslint:disable */ +/* eslint-disable */ export type CodatFile = { - fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Uint8Array; -}; - -/** @internal */ -export type CodatFile$Outbound = { - fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Uint8Array; + content: ReadableStream | Blob | ArrayBuffer | Uint8Array; + fileName: string; }; -/** @internal */ -export const CodatFile$outboundSchema: z.ZodType< - CodatFile$Outbound, - z.ZodTypeDef, - CodatFile -> = z.object({ - fileName: z.string(), - content: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Uint8Array), - ]), -}); +export function CodatFileFromJSON(json: any): CodatFile { + return json; +} -export function codatFileToJSON(codatFile: CodatFile): string { - return JSON.stringify(CodatFile$outboundSchema.parse(codatFile)); +export function CodatFileToJSON(value?: CodatFile | null): any { + return value; } diff --git a/sync-for-payables/src/sdk/models/shared/companies.ts b/sync-for-payables/src/sdk/models/shared/companies.ts index 0f308542e..5651c2ab3 100644 --- a/sync-for-payables/src/sdk/models/shared/companies.ts +++ b/sync-for-payables/src/sdk/models/shared/companies.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Company, Company$inboundSchema } from "./company.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Companies = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Companies$inboundSchema: z.ZodType< - Companies, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Company$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function companiesFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Companies$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Companies' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Company } from './company'; +import { + CompanyFromJSON, + CompanyFromJSONTyped, + CompanyToJSON, + CompanyToJSONTyped, +} from './company'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Companies + */ +export interface Companies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; +} + +/** + * Check if a given object implements the Companies interface. + */ +export function instanceOfCompanies(value: object): value is Companies { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function CompaniesFromJSON(json: any): Companies { + return CompaniesFromJSONTyped(json, false); +} + +export function CompaniesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Companies { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(CompanyFromJSON)), + }; +} + +export function CompaniesToJSON(json: any): Companies { + return CompaniesToJSONTyped(json, false); +} + +export function CompaniesToJSONTyped(value?: Companies | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(CompanyToJSON)), + }; +} + + +export interface CompaniesListResponseCompanies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; +} + +export interface ListCompaniesResponseCompanies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; } diff --git a/sync-for-payables/src/sdk/models/shared/company.ts b/sync-for-payables/src/sdk/models/shared/company.ts index 6c8aa2936..810a86873 100644 --- a/sync-for-payables/src/sdk/models/shared/company.ts +++ b/sync-for-payables/src/sdk/models/shared/company.ts @@ -1,131 +1,1432 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, -} from "./companyreference.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; /** - * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](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. - * - * @remarks - * + * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](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. + * @export + * @interface Company + */ +export interface Company { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +/** + * Check if a given object implements the Company interface. */ -export type Company = { - /** - * Unique identifier for your SMB in Codat. - */ - id: string; - /** - * The name of the company - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * 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. - */ - redirect: string; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - lastSync?: string | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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?: string | undefined; - /** - * Name of user that created the company in Codat. - */ - createdByUserName?: string | null | undefined; - /** - * An array of products that are currently enabled for the company. - */ - products?: Array | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; - referenceParentCompany?: CompanyReference | undefined; - /** - * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. - */ - referenceSubsidiaryCompanies?: Array | undefined; - dataConnections?: Array | undefined; -}; - -/** @internal */ -export const Company$inboundSchema: z.ZodType = - z.object({ - id: z.string(), - name: z.string(), - description: z.string().optional(), - redirect: z.string(), - lastSync: z.string().optional(), - created: z.string().optional(), - createdByUserName: z.nullable(z.string()).optional(), - products: z.array(z.string()).optional(), - tags: z.record(z.string()).optional(), - referenceParentCompany: CompanyReference$inboundSchema.optional(), - referenceSubsidiaryCompanies: z.array(CompanyReference$inboundSchema) - .optional(), - dataConnections: z.array(Connection$inboundSchema).optional(), - }); - -export function companyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Company$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Company' from JSON`, - ); +export function instanceOfCompany(value: object): value is Company { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyFromJSON(json: any): Company { + return CompanyFromJSONTyped(json, false); +} + +export function CompanyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Company { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + 'dataConnections': json['dataConnections'] == null ? undefined : ((json['dataConnections'] as Array).map(ConnectionFromJSON)), + }; +} + +export function CompanyToJSON(json: any): Company { + return CompanyToJSONTyped(json, false); +} + +export function CompanyToJSONTyped(value?: Company | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + 'dataConnections': value['dataConnections'] == null ? undefined : ((value['dataConnections'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface CompaniesCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompaniesListResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyCreateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyGetResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyReplaceResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyUpdateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CreateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface GetCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ListCompaniesResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ReplaceCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface UpdateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * 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 {string} + * @memberof Company + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; } diff --git a/sync-for-payables/src/sdk/models/shared/companyinformation.ts b/sync-for-payables/src/sdk/models/shared/companyinformation.ts index 57919ecf8..4970a7bd6 100644 --- a/sync-for-payables/src/sdk/models/shared/companyinformation.ts +++ b/sync-for-payables/src/sdk/models/shared/companyinformation.ts @@ -1,42 +1,103 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Gets the latest basic info for a company. + * @export + * @interface CompanyInformation + */ +export interface CompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; +} + +/** + * Check if a given object implements the CompanyInformation interface. */ -export type CompanyInformation = { - /** - * Name of the linked company. - */ - companyName?: string | null | undefined; - /** - * Currency set in the accounting software of the linked company. Used by the currency rate. - */ - baseCurrency?: string | null | undefined; -}; - -/** @internal */ -export const CompanyInformation$inboundSchema: z.ZodType< - CompanyInformation, - z.ZodTypeDef, - unknown -> = z.object({ - companyName: z.nullable(z.string()).optional(), - baseCurrency: z.nullable(z.string()).optional(), -}); - -export function companyInformationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyInformation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyInformation' from JSON`, - ); +export function instanceOfCompanyInformation(value: object): value is CompanyInformation { + return true; +} + +export function CompanyInformationFromJSON(json: any): CompanyInformation { + return CompanyInformationFromJSONTyped(json, false); +} + +export function CompanyInformationFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyInformation { + if (json == null) { + return json; + } + return { + + 'companyName': json['companyName'] == null ? undefined : json['companyName'], + 'baseCurrency': json['baseCurrency'] == null ? undefined : json['baseCurrency'], + }; +} + +export function CompanyInformationToJSON(json: any): CompanyInformation { + return CompanyInformationToJSONTyped(json, false); +} + +export function CompanyInformationToJSONTyped(value?: CompanyInformation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyName': value['companyName'], + 'baseCurrency': value['baseCurrency'], + }; +} + + +export interface CompanyInformationGetResponseCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; +} + +export interface GetCompanyInformationResponseCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; } diff --git a/sync-for-payables/src/sdk/models/shared/companyreference.ts b/sync-for-payables/src/sdk/models/shared/companyreference.ts index 403e37ef7..c9bce23f1 100644 --- a/sync-for-payables/src/sdk/models/shared/companyreference.ts +++ b/sync-for-payables/src/sdk/models/shared/companyreference.ts @@ -1,83 +1,435 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CompanyReferenceLinks } from './companyreferencelinks'; +import { + CompanyReferenceLinksFromJSON, + CompanyReferenceLinksFromJSONTyped, + CompanyReferenceLinksToJSON, + CompanyReferenceLinksToJSONTyped, +} from './companyreferencelinks'; + +/** + * + * @export + * @interface CompanyReference + */ +export interface CompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} /** - * A collection of links for the company. + * Check if a given object implements the CompanyReference interface. */ -export type CompanyReferenceLinks = { - /** - * Link to the company page in the portal. - */ - portal?: string | undefined; -}; - -export type CompanyReference = { - /** - * Unique identifier for your SMB in Codat. - */ - id?: string | undefined; - /** - * The name of the company - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of links for the company. - */ - links?: CompanyReferenceLinks | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$inboundSchema: z.ZodType< - CompanyReferenceLinks, - z.ZodTypeDef, - unknown -> = z.object({ - portal: z.string().optional(), -}); - -export function companyReferenceLinksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyReferenceLinks$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReferenceLinks' from JSON`, - ); -} - -/** @internal */ -export const CompanyReference$inboundSchema: z.ZodType< - CompanyReference, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - links: z.lazy(() => CompanyReferenceLinks$inboundSchema).optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyReferenceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyReference$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReference' from JSON`, - ); +export function instanceOfCompanyReference(value: object): value is CompanyReference { + return true; +} + +export function CompanyReferenceFromJSON(json: any): CompanyReference { + return CompanyReferenceFromJSONTyped(json, false); +} + +export function CompanyReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReference { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'links': json['links'] == null ? undefined : CompanyReferenceLinksFromJSON(json['links']), + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyReferenceToJSON(json: any): CompanyReference { + return CompanyReferenceToJSONTyped(json, false); +} + +export function CompanyReferenceToJSONTyped(value?: CompanyReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'links': CompanyReferenceLinksToJSON(value['links']), + 'tags': value['tags'], + }; +} + + +export interface CompaniesCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCreateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyGetResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyUpdateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface GetCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; } diff --git a/sync-for-payables/src/sdk/models/shared/companyreferencelinks.ts b/sync-for-payables/src/sdk/models/shared/companyreferencelinks.ts new file mode 100644 index 000000000..ca022ba3d --- /dev/null +++ b/sync-for-payables/src/sdk/models/shared/companyreferencelinks.ts @@ -0,0 +1,146 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * A collection of links for the company. + * @export + * @interface CompanyReferenceLinks + */ +export interface CompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +/** + * Check if a given object implements the CompanyReferenceLinks interface. + */ +export function instanceOfCompanyReferenceLinks(value: object): value is CompanyReferenceLinks { + return true; +} + +export function CompanyReferenceLinksFromJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksFromJSONTyped(json, false); +} + +export function CompanyReferenceLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReferenceLinks { + if (json == null) { + return json; + } + return { + + 'portal': json['portal'] == null ? undefined : json['portal'], + }; +} + +export function CompanyReferenceLinksToJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksToJSONTyped(json, false); +} + +export function CompanyReferenceLinksToJSONTyped(value?: CompanyReferenceLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'portal': value['portal'], + }; +} + + +export interface CompanyCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyCreateResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyGetResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyReplaceResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyUpdateResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CreateCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface GetCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface ReplaceCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface UpdateCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} diff --git a/sync-for-payables/src/sdk/models/shared/companyrequestbody.ts b/sync-for-payables/src/sdk/models/shared/companyrequestbody.ts index 5e438635a..68eaba30a 100644 --- a/sync-for-payables/src/sdk/models/shared/companyrequestbody.ts +++ b/sync-for-payables/src/sdk/models/shared/companyrequestbody.ts @@ -1,46 +1,208 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyRequestBody = { - /** - * Name of company being connected. - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyRequestBody$Outbound = { - name: string; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyRequestBody$outboundSchema: z.ZodType< - CompanyRequestBody$Outbound, - z.ZodTypeDef, - CompanyRequestBody -> = z.object({ - name: z.string(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyRequestBodyToJSON( - companyRequestBody: CompanyRequestBody, -): string { - return JSON.stringify( - CompanyRequestBody$outboundSchema.parse(companyRequestBody), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyRequestBody + */ +export interface CompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyRequestBody interface. + */ +export function instanceOfCompanyRequestBody(value: object): value is CompanyRequestBody { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function CompanyRequestBodyFromJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyFromJSONTyped(json, false); +} + +export function CompanyRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyRequestBody { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyRequestBodyToJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyToJSONTyped(json, false); +} + +export function CompanyRequestBodyToJSONTyped(value?: CompanyRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyCreateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; } diff --git a/sync-for-payables/src/sdk/models/shared/companyupdaterequest.ts b/sync-for-payables/src/sdk/models/shared/companyupdaterequest.ts index 442b7a78c..04f94cd70 100644 --- a/sync-for-payables/src/sdk/models/shared/companyupdaterequest.ts +++ b/sync-for-payables/src/sdk/models/shared/companyupdaterequest.ts @@ -1,46 +1,144 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyUpdateRequest = { - /** - * Name of company being connected. - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyUpdateRequest$Outbound = { - name?: string | undefined; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyUpdateRequest$outboundSchema: z.ZodType< - CompanyUpdateRequest$Outbound, - z.ZodTypeDef, - CompanyUpdateRequest -> = z.object({ - name: z.string().optional(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyUpdateRequestToJSON( - companyUpdateRequest: CompanyUpdateRequest, -): string { - return JSON.stringify( - CompanyUpdateRequest$outboundSchema.parse(companyUpdateRequest), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyUpdateRequest + */ +export interface CompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyUpdateRequest interface. + */ +export function instanceOfCompanyUpdateRequest(value: object): value is CompanyUpdateRequest { + return true; +} + +export function CompanyUpdateRequestFromJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestFromJSONTyped(json, false); +} + +export function CompanyUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyUpdateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyUpdateRequestToJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestToJSONTyped(json, false); +} + +export function CompanyUpdateRequestToJSONTyped(value?: CompanyUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyUpdateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyCompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; } diff --git a/sync-for-payables/src/sdk/models/shared/connection.ts b/sync-for-payables/src/sdk/models/shared/connection.ts index 7a8022769..9ccb331da 100644 --- a/sync-for-payables/src/sdk/models/shared/connection.ts +++ b/sync-for-payables/src/sdk/models/shared/connection.ts @@ -1,164 +1,2257 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { SourceType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import type { DataConnectionStatus } from './dataconnectionstatus'; import { - DataConnectionError, - DataConnectionError$inboundSchema, -} from "./dataconnectionerror.js"; + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './dataconnectionstatus'; +import type { DataConnectionError } from './dataconnectionerror'; import { - DataConnectionStatus, - DataConnectionStatus$inboundSchema, -} from "./dataconnectionstatus.js"; - -/** - * The type of platform of the connection. - */ -export const SourceType = { - Accounting: "Accounting", - Banking: "Banking", - BankFeed: "BankFeed", - Commerce: "Commerce", - Expense: "Expense", - Other: "Other", - Unknown: "Unknown", -} as const; -/** - * The type of platform of the connection. - */ -export type SourceType = ClosedEnum; + DataConnectionErrorFromJSON, + DataConnectionErrorFromJSONTyped, + DataConnectionErrorToJSON, + DataConnectionErrorToJSONTyped, +} from './dataconnectionerror'; /** - * A connection represents a [company's](https://docs.codat.io/sync-for-payables-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - * - * @remarks - * + * A connection represents a [company's](https://docs.codat.io/sync-for-payables-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). + * @export + * @interface Connection + */ +export interface Connection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + + +/** + * @export */ -export type Connection = { - /** - * Unique identifier for a company's data connection. - */ - id: string; - /** - * A Codat ID representing the integration. - */ - integrationId: string; - /** - * 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. - */ - integrationKey?: string | undefined; - /** - * 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`. - */ - sourceId: string; - /** - * The type of platform of the connection. - */ - sourceType: SourceType; - /** - * Name of integration connected to company. - */ - platformName: string; - /** - * The link URL your customers can use to authorize access to their business application. - */ - linkUrl: string; - /** - * The current authorization status of the data connection. - */ - status: DataConnectionStatus; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - lastSync?: string | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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: string; - dataConnectionErrors?: Array | null | undefined; - connectionInfo?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const SourceType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(SourceType); - -/** @internal */ -export const Connection$inboundSchema: z.ZodType< - Connection, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - integrationId: z.string(), - integrationKey: z.string().optional(), - sourceId: z.string(), - sourceType: SourceType$inboundSchema, - platformName: z.string(), - linkUrl: z.string(), - status: DataConnectionStatus$inboundSchema, - lastSync: z.string().optional(), - created: z.string(), - dataConnectionErrors: z.nullable(z.array(DataConnectionError$inboundSchema)) - .optional(), - connectionInfo: z.nullable(z.record(z.any())).optional(), -}); - -export function connectionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connection$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connection' from JSON`, - ); +export const ConnectionSourceTypeEnum = { + Accounting: 'Accounting', + Banking: 'Banking', + BankFeed: 'BankFeed', + Commerce: 'Commerce', + Expense: 'Expense', + Other: 'Other', + Unknown: 'Unknown' +} as const; +export type ConnectionSourceTypeEnum = typeof ConnectionSourceTypeEnum[keyof typeof ConnectionSourceTypeEnum]; + + +/** + * Check if a given object implements the Connection interface. + */ +export function instanceOfConnection(value: object): value is Connection { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('integrationId' in value) || value['integrationId'] === undefined) return false; + if (!('sourceId' in value) || value['sourceId'] === undefined) return false; + if (!('sourceType' in value) || value['sourceType'] === undefined) return false; + if (!('platformName' in value) || value['platformName'] === undefined) return false; + if (!('linkUrl' in value) || value['linkUrl'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('created' in value) || value['created'] === undefined) return false; + return true; +} + +export function ConnectionFromJSON(json: any): Connection { + return ConnectionFromJSONTyped(json, false); +} + +export function ConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connection { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'], + 'integrationId': json['integrationId'], + 'integrationKey': json['integrationKey'] == null ? undefined : json['integrationKey'], + 'sourceId': json['sourceId'], + 'sourceType': json['sourceType'], + 'platformName': json['platformName'], + 'linkUrl': json['linkUrl'], + 'status': DataConnectionStatusFromJSON(json['status']), + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'], + 'dataConnectionErrors': json['dataConnectionErrors'] == null ? undefined : ((json['dataConnectionErrors'] as Array).map(DataConnectionErrorFromJSON)), + 'connectionInfo': json['connectionInfo'] == null ? undefined : json['connectionInfo'], + }; +} + +export function ConnectionToJSON(json: any): Connection { + return ConnectionToJSONTyped(json, false); +} + +export function ConnectionToJSONTyped(value?: Connection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'integrationId': value['integrationId'], + 'integrationKey': value['integrationKey'], + 'sourceId': value['sourceId'], + 'sourceType': value['sourceType'], + 'platformName': value['platformName'], + 'linkUrl': value['linkUrl'], + 'status': DataConnectionStatusToJSON(value['status']), + 'lastSync': value['lastSync'], + 'created': value['created'], + 'dataConnectionErrors': value['dataConnectionErrors'] == null ? undefined : ((value['dataConnectionErrors'] as Array).map(DataConnectionErrorToJSON)), + 'connectionInfo': value['connectionInfo'], + }; +} + + +export interface CompanyConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyReplaceResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyUpdateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionUnlinkResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsListResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ListConnectionsResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ReplaceCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UnlinkConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UpdateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * 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. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * 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`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * 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 {string} + * @memberof Connection + */ + lastSync?: string; + /** + * 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 {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; } diff --git a/sync-for-payables/src/sdk/models/shared/connections.ts b/sync-for-payables/src/sdk/models/shared/connections.ts index 1278d54c3..3f6462182 100644 --- a/sync-for-payables/src/sdk/models/shared/connections.ts +++ b/sync-for-payables/src/sdk/models/shared/connections.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Connections = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Connections$inboundSchema: z.ZodType< - Connections, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Connection$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function connectionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connections$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connections' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Connections + */ +export interface Connections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +/** + * Check if a given object implements the Connections interface. + */ +export function instanceOfConnections(value: object): value is Connections { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function ConnectionsFromJSON(json: any): Connections { + return ConnectionsFromJSONTyped(json, false); +} + +export function ConnectionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connections { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(ConnectionFromJSON)), + }; +} + +export function ConnectionsToJSON(json: any): Connections { + return ConnectionsToJSONTyped(json, false); +} + +export function ConnectionsToJSONTyped(value?: Connections | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface ConnectionsListResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +export interface ListConnectionsResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; } diff --git a/sync-for-payables/src/sdk/models/shared/dataconnectionerror.ts b/sync-for-payables/src/sdk/models/shared/dataconnectionerror.ts index 1cb816d0f..c9de212f5 100644 --- a/sync-for-payables/src/sdk/models/shared/dataconnectionerror.ts +++ b/sync-for-payables/src/sdk/models/shared/dataconnectionerror.ts @@ -1,112 +1,678 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { ErrorStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface DataConnectionError */ +export interface DataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * @export */ -export const ErrorStatus = { - Active: "Active", - Resolved: "Resolved", +export const DataConnectionErrorStatusEnum = { + Active: 'Active', + Resolved: 'Resolved' } as const; +export type DataConnectionErrorStatusEnum = typeof DataConnectionErrorStatusEnum[keyof typeof DataConnectionErrorStatusEnum]; + + /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * Check if a given object implements the DataConnectionError interface. */ -export type ErrorStatus = ClosedEnum; - -export type DataConnectionError = { - /** - * The HTTP status code returned by the source platform when the error occurred. - */ - statusCode?: string | undefined; - /** - * A non-numeric status code/text returned by the source platform when the error occurred. - */ - statusText?: string | undefined; - /** - * A message about a error returned by Codat. - */ - errorMessage?: string | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - erroredOnUtc?: string | undefined; - /** - * The current status of a transient error. Null statuses indicate that the error is not transient. - */ - status?: ErrorStatus | null | undefined; - /** - * 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: - * - * @remarks - * - * ``` - * 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. - */ - resolvedOnUtc?: string | undefined; -}; - -/** @internal */ -export const ErrorStatus$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(ErrorStatus); - -/** @internal */ -export const DataConnectionError$inboundSchema: z.ZodType< - DataConnectionError, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.string().optional(), - statusText: z.string().optional(), - errorMessage: z.string().optional(), - erroredOnUtc: z.string().optional(), - status: z.nullable(ErrorStatus$inboundSchema).optional(), - resolvedOnUtc: z.string().optional(), -}); - -export function dataConnectionErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataConnectionError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataConnectionError' from JSON`, - ); +export function instanceOfDataConnectionError(value: object): value is DataConnectionError { + return true; +} + +export function DataConnectionErrorFromJSON(json: any): DataConnectionError { + return DataConnectionErrorFromJSONTyped(json, false); +} + +export function DataConnectionErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionError { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'statusText': json['statusText'] == null ? undefined : json['statusText'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'erroredOnUtc': json['erroredOnUtc'] == null ? undefined : json['erroredOnUtc'], + 'status': json['status'] == null ? undefined : json['status'], + 'resolvedOnUtc': json['resolvedOnUtc'] == null ? undefined : json['resolvedOnUtc'], + }; +} + +export function DataConnectionErrorToJSON(json: any): DataConnectionError { + return DataConnectionErrorToJSONTyped(json, false); +} + +export function DataConnectionErrorToJSONTyped(value?: DataConnectionError | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'statusText': value['statusText'], + 'errorMessage': value['errorMessage'], + 'erroredOnUtc': value['erroredOnUtc'], + 'status': value['status'], + 'resolvedOnUtc': value['resolvedOnUtc'], + }; +} + + +export interface ConnectionCreateResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionGetResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionUnlinkResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface CreateConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface GetConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface UnlinkConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * 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 {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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 {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/dataconnectionstatus.ts b/sync-for-payables/src/sdk/models/shared/dataconnectionstatus.ts index 88889c800..169e50179 100644 --- a/sync-for-payables/src/sdk/models/shared/dataconnectionstatus.ts +++ b/sync-for-payables/src/sdk/models/shared/dataconnectionstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current authorization status of the data connection. + * @export */ export const DataConnectionStatus = { - PendingAuth: "PendingAuth", - Linked: "Linked", - Unlinked: "Unlinked", - Deauthorized: "Deauthorized", + PendingAuth: 'PendingAuth', + Linked: 'Linked', + Unlinked: 'Unlinked', + Deauthorized: 'Deauthorized' } as const; -/** - * The current authorization status of the data connection. - */ -export type DataConnectionStatus = ClosedEnum; - -/** @internal */ -export const DataConnectionStatus$inboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = z.nativeEnum(DataConnectionStatus); -/** @internal */ -export const DataConnectionStatus$outboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = DataConnectionStatus$inboundSchema; +export type DataConnectionStatus = typeof DataConnectionStatus[keyof typeof DataConnectionStatus]; + + +export function instanceOfDataConnectionStatus(value: any): boolean { + for (const key in DataConnectionStatus) { + if (Object.prototype.hasOwnProperty.call(DataConnectionStatus, key)) { + if (DataConnectionStatus[key as keyof typeof DataConnectionStatus] === value) { + return true; + } + } + } + return false; +} + +export function DataConnectionStatusFromJSON(json: any): DataConnectionStatus { + return DataConnectionStatusFromJSONTyped(json, false); +} + +export function DataConnectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return json as DataConnectionStatus; +} + +export function DataConnectionStatusToJSON(value?: DataConnectionStatus | null): any { + return value as any; +} + +export function DataConnectionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return value as DataConnectionStatus; +} + diff --git a/sync-for-payables/src/sdk/models/shared/errorvalidation.ts b/sync-for-payables/src/sdk/models/shared/errorvalidation.ts index dc97b86b1..b69ebb1f3 100644 --- a/sync-for-payables/src/sdk/models/shared/errorvalidation.ts +++ b/sync-for-payables/src/sdk/models/shared/errorvalidation.ts @@ -1,40 +1,96 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ErrorValidationItem } from './errorvalidationitem'; import { - ErrorValidationItem, - ErrorValidationItem$inboundSchema, -} from "./errorvalidationitem.js"; + ErrorValidationItemFromJSON, + ErrorValidationItemFromJSONTyped, + ErrorValidationItemToJSON, + ErrorValidationItemToJSONTyped, +} from './errorvalidationitem'; /** * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + * @export + * @interface ErrorValidation + */ +export interface ErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the ErrorValidation interface. */ -export type ErrorValidation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const ErrorValidation$inboundSchema: z.ZodType< - ErrorValidation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), - warnings: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), -}); - -export function errorValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidation' from JSON`, - ); +export function instanceOfErrorValidation(value: object): value is ErrorValidation { + return true; +} + +export function ErrorValidationFromJSON(json: any): ErrorValidation { + return ErrorValidationFromJSONTyped(json, false); +} + +export function ErrorValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ErrorValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ErrorValidationItemFromJSON)), + }; +} + +export function ErrorValidationToJSON(json: any): ErrorValidation { + return ErrorValidationToJSONTyped(json, false); +} + +export function ErrorValidationToJSONTyped(value?: ErrorValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ErrorValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ErrorValidationItemToJSON)), + }; +} + + +export interface ErrorMessageErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; } diff --git a/sync-for-payables/src/sdk/models/shared/errorvalidationitem.ts b/sync-for-payables/src/sdk/models/shared/errorvalidationitem.ts index cd21ec230..2151638d8 100644 --- a/sync-for-payables/src/sdk/models/shared/errorvalidationitem.ts +++ b/sync-for-payables/src/sdk/models/shared/errorvalidationitem.ts @@ -1,44 +1,102 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ErrorValidationItem = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ErrorValidationItem$inboundSchema: z.ZodType< - ErrorValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function errorValidationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ErrorValidationItem + */ +export interface ErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ErrorValidationItem interface. + */ +export function instanceOfErrorValidationItem(value: object): value is ErrorValidationItem { + return true; +} + +export function ErrorValidationItemFromJSON(json: any): ErrorValidationItem { + return ErrorValidationItemFromJSONTyped(json, false); +} + +export function ErrorValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidationItem { + if (json == null) { + return json; + } + return { + + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ErrorValidationItemToJSON(json: any): ErrorValidationItem { + return ErrorValidationItemToJSONTyped(json, false); +} + +export function ErrorValidationItemToJSONTyped(value?: ErrorValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface ErrorMessageErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; } diff --git a/sync-for-payables/src/sdk/models/shared/halref.ts b/sync-for-payables/src/sdk/models/shared/halref.ts index 921d594fb..53221e099 100644 --- a/sync-for-payables/src/sdk/models/shared/halref.ts +++ b/sync-for-payables/src/sdk/models/shared/halref.ts @@ -1,31 +1,155 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type HalRef = { - /** - * Uri hypertext reference. - */ - href?: string | undefined; -}; - -/** @internal */ -export const HalRef$inboundSchema: z.ZodType = z - .object({ - href: z.string().optional(), - }); - -export function halRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => HalRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'HalRef' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface HalRef + */ +export interface HalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +/** + * Check if a given object implements the HalRef interface. + */ +export function instanceOfHalRef(value: object): value is HalRef { + return true; +} + +export function HalRefFromJSON(json: any): HalRef { + return HalRefFromJSONTyped(json, false); +} + +export function HalRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): HalRef { + if (json == null) { + return json; + } + return { + + 'href': json['href'] == null ? undefined : json['href'], + }; +} + +export function HalRefToJSON(json: any): HalRef { + return HalRefToJSONTyped(json, false); +} + +export function HalRefToJSONTyped(value?: HalRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'href': value['href'], + }; +} + + +export interface CompaniesHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CompaniesListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListCompaniesResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListConnectionsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PaginationInformationHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PagingInfoHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PullOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PushOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/index.ts b/sync-for-payables/src/sdk/models/shared/index.ts index 2d6c3711f..2fb93c725 100644 --- a/sync-for-payables/src/sdk/models/shared/index.ts +++ b/sync-for-payables/src/sdk/models/shared/index.ts @@ -1,53 +1,57 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./accountmappingoption.js"; -export * from "./accountstatus.js"; -export * from "./address.js"; -export * from "./addresstype.js"; -export * from "./attachment.js"; -export * from "./attachmentupload.js"; -export * from "./bankaccount.js"; -export * from "./bankaccountmappingoption.js"; -export * from "./bankaccountprototype.js"; -export * from "./bankaccountstatus.js"; -export * from "./bankaccounttype.js"; -export * from "./bill.js"; -export * from "./billaccountref.js"; -export * from "./billlineitem.js"; -export * from "./billmappingoptions.js"; -export * from "./billpayment.js"; -export * from "./billpaymentaccountref.js"; -export * from "./billpaymentprototype.js"; -export * from "./billprototype.js"; -export * from "./bills.js"; -export * from "./billstatus.js"; -export * from "./billtaxrateref.js"; -export * from "./clientratelimitwebhook.js"; -export * from "./clientratelimitwebhookpayload.js"; -export * from "./codatfile.js"; -export * from "./companies.js"; -export * from "./company.js"; -export * from "./companyinformation.js"; -export * from "./companyreference.js"; -export * from "./companyrequestbody.js"; -export * from "./companyupdaterequest.js"; -export * from "./connection.js"; -export * from "./connections.js"; -export * from "./dataconnectionerror.js"; -export * from "./dataconnectionstatus.js"; -export * from "./errorvalidation.js"; -export * from "./errorvalidationitem.js"; -export * from "./halref.js"; -export * from "./links.js"; -export * from "./pagination.js"; -export * from "./paymentmappingoptions.js"; -export * from "./security.js"; -export * from "./supplier.js"; -export * from "./supplierprototype.js"; -export * from "./supplierref.js"; -export * from "./suppliers.js"; -export * from "./supplierstatus.js"; -export * from "./taxratemappingoption.js"; -export * from "./trackingref.js"; +export * from './accountmappingoption'; +export * from './accountstatus'; +export * from './address'; +export * from './addresstype'; +export * from './attachment'; +export * from './attachmentupload'; +export * from './bankaccount'; +export * from './bankaccountmappingoption'; +export * from './bankaccountprototype'; +export * from './bankaccountstatus'; +export * from './bankaccounttype'; +export * from './bill'; +export * from './billaccountref'; +export * from './billlineitem'; +export * from './billmappingoptions'; +export * from './billpayment'; +export * from './billpaymentaccountref'; +export * from './billpaymentprototype'; +export * from './billprototype'; +export * from './billstatus'; +export * from './billtaxrateref'; +export * from './bills'; +export * from './clientratelimitwebhook'; +export * from './clientratelimitwebhookpayload'; +export * from './codatfile'; +export * from './companies'; +export * from './company'; +export * from './companyinformation'; +export * from './companyreference'; +export * from './companyreferencelinks'; +export * from './companyrequestbody'; +export * from './companyupdaterequest'; +export * from './connection'; +export * from './connections'; +export * from './dataconnectionerror'; +export * from './dataconnectionstatus'; +export * from './errorvalidation'; +export * from './errorvalidationitem'; +export * from './halref'; +export * from './links'; +export * from './pagination'; +export * from './paymentmappingoptions'; +export * from './supplier'; +export * from './supplierprototype'; +export * from './supplierref'; +export * from './supplierstatus'; +export * from './suppliers'; +export * from './taxratemappingoption'; +export * from './trackingref'; +export { DataType } from '../_speakeasy_enums'; +export { ErrorStatus } from '../_speakeasy_enums'; +export { SourceType } from '../_speakeasy_enums'; +export { TaxRateStatus } from '../_speakeasy_enums'; +export type { Security } from '../../../lib/sdkconfig'; diff --git a/sync-for-payables/src/sdk/models/shared/links.ts b/sync-for-payables/src/sdk/models/shared/links.ts index 751d7d00e..52555e3b9 100644 --- a/sync-for-payables/src/sdk/models/shared/links.ts +++ b/sync-for-payables/src/sdk/models/shared/links.ts @@ -1,35 +1,369 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { HalRef, HalRef$inboundSchema } from "./halref.js"; - -export type Links = { - self: HalRef; - current: HalRef; - next?: HalRef | undefined; - previous?: HalRef | undefined; -}; - -/** @internal */ -export const Links$inboundSchema: z.ZodType = z - .object({ - self: HalRef$inboundSchema, - current: HalRef$inboundSchema, - next: HalRef$inboundSchema.optional(), - previous: HalRef$inboundSchema.optional(), - }); - -export function linksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Links$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Links' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { HalRef } from './halref'; +import { + HalRefFromJSON, + HalRefFromJSONTyped, + HalRefToJSON, + HalRefToJSONTyped, +} from './halref'; + +/** + * + * @export + * @interface Links + */ +export interface Links { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +/** + * Check if a given object implements the Links interface. + */ +export function instanceOfLinks(value: object): value is Links { + if (!('self' in value) || value['self'] === undefined) return false; + if (!('current' in value) || value['current'] === undefined) return false; + return true; +} + +export function LinksFromJSON(json: any): Links { + return LinksFromJSONTyped(json, false); +} + +export function LinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): Links { + if (json == null) { + return json; + } + return { + + 'self': HalRefFromJSON(json['self']), + 'current': HalRefFromJSON(json['current']), + 'next': json['next'] == null ? undefined : HalRefFromJSON(json['next']), + 'previous': json['previous'] == null ? undefined : HalRefFromJSON(json['previous']), + }; +} + +export function LinksToJSON(json: any): Links { + return LinksToJSONTyped(json, false); +} + +export function LinksToJSONTyped(value?: Links | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'self': HalRefToJSON(value['self']), + 'current': HalRefToJSON(value['current']), + 'next': HalRefToJSON(value['next']), + 'previous': HalRefToJSON(value['previous']), + }; +} + + +export interface CompaniesLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CompaniesListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListCompaniesResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListConnectionsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PaginationInformationLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PagingInfoLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PullOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PushOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; } diff --git a/sync-for-payables/src/sdk/models/shared/pagination.ts b/sync-for-payables/src/sdk/models/shared/pagination.ts index 76c185a49..e02fb30d2 100644 --- a/sync-for-payables/src/sdk/models/shared/pagination.ts +++ b/sync-for-payables/src/sdk/models/shared/pagination.ts @@ -1,34 +1,299 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Pagination = { - /** - * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. - */ - continuationToken?: string | undefined; -}; - -/** @internal */ -export const Pagination$inboundSchema: z.ZodType< - Pagination, - z.ZodTypeDef, - unknown -> = z.object({ - continuationToken: z.string().optional(), -}); - -export function paginationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Pagination$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Pagination' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface Pagination + */ +export interface Pagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +/** + * Check if a given object implements the Pagination interface. + */ +export function instanceOfPagination(value: object): value is Pagination { + return true; +} + +export function PaginationFromJSON(json: any): Pagination { + return PaginationFromJSONTyped(json, false); +} + +export function PaginationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pagination { + if (json == null) { + return json; + } + return { + + 'continuationToken': json['continuationToken'] == null ? undefined : json['continuationToken'], + }; +} + +export function PaginationToJSON(json: any): Pagination { + return PaginationToJSONTyped(json, false); +} + +export function PaginationToJSONTyped(value?: Pagination | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'continuationToken': value['continuationToken'], + }; +} + + +export interface BillMappingOptionsPagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface BillMappingOptionsPaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface BillsListResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface BillsListResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface GetMappingOptionsBillsResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface GetMappingOptionsBillsResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface GetMappingOptionsPaymentsResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface GetMappingOptionsPaymentsResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface ListBillsResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface ListBillsResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface ListSuppliersResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface ListSuppliersResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsBillsGetResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsBillsGetResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsBillsPagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsBillsPaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsPaymentsGetResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsPaymentsGetResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsPaymentsPagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface MappingOptionsPaymentsPaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface PaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface PaginationPaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface PaymentMappingOptionsPagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface PaymentMappingOptionsPaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface SuppliersListResponsePagination { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; +} + +export interface SuppliersListResponsePaginationMetadata { + /** + * A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response. + * @type {string} + * @memberof Pagination + */ + continuationToken?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/paymentmappingoptions.ts b/sync-for-payables/src/sdk/models/shared/paymentmappingoptions.ts index a08a1d7f9..6f855a6d8 100644 --- a/sync-for-payables/src/sdk/models/shared/paymentmappingoptions.ts +++ b/sync-for-payables/src/sdk/models/shared/paymentmappingoptions.ts @@ -1,42 +1,178 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { Pagination } from './pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './pagination'; +import type { BankAccountMappingOption } from './bankaccountmappingoption'; import { - BankAccountMappingOption, - BankAccountMappingOption$inboundSchema, -} from "./bankaccountmappingoption.js"; -import { Pagination, Pagination$inboundSchema } from "./pagination.js"; + BankAccountMappingOptionFromJSON, + BankAccountMappingOptionFromJSONTyped, + BankAccountMappingOptionToJSON, + BankAccountMappingOptionToJSONTyped, +} from './bankaccountmappingoption'; /** * Gets the bill payments mapping options for a company's accounting software + * @export + * @interface PaymentMappingOptions */ -export type PaymentMappingOptions = { - bankAccounts?: Array | undefined; - pagination?: Pagination | undefined; -}; - -/** @internal */ -export const PaymentMappingOptions$inboundSchema: z.ZodType< - PaymentMappingOptions, - z.ZodTypeDef, - unknown -> = z.object({ - bankAccounts: z.array(z.nullable(BankAccountMappingOption$inboundSchema)) - .optional(), - pagination: Pagination$inboundSchema.optional(), -}); - -export function paymentMappingOptionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PaymentMappingOptions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PaymentMappingOptions' from JSON`, - ); +export interface PaymentMappingOptions { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the PaymentMappingOptions interface. + */ +export function instanceOfPaymentMappingOptions(value: object): value is PaymentMappingOptions { + return true; +} + +export function PaymentMappingOptionsFromJSON(json: any): PaymentMappingOptions { + return PaymentMappingOptionsFromJSONTyped(json, false); +} + +export function PaymentMappingOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentMappingOptions { + if (json == null) { + return json; + } + return { + + 'bankAccounts': json['bankAccounts'] == null ? undefined : ((json['bankAccounts'] as Array).map(BankAccountMappingOptionFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function PaymentMappingOptionsToJSON(json: any): PaymentMappingOptions { + return PaymentMappingOptionsToJSONTyped(json, false); +} + +export function PaymentMappingOptionsToJSONTyped(value?: PaymentMappingOptions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'bankAccounts': value['bankAccounts'] == null ? undefined : ((value['bankAccounts'] as Array).map(BankAccountMappingOptionToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + + +export interface GetMappingOptionsPaymentsResponseMappingOptionsPayments { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; +} + +export interface GetMappingOptionsPaymentsResponsePaymentMappingOptions { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; +} + +export interface MappingOptionsPayments { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; +} + +export interface MappingOptionsPaymentsGetResponseMappingOptionsPayments { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; +} + +export interface MappingOptionsPaymentsGetResponsePaymentMappingOptions { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; +} + +export interface PaymentMappingOptionsMappingOptionsPayments { + /** + * + * @type {Array} + * @memberof PaymentMappingOptions + */ + bankAccounts?: Array; + /** + * + * @type {Pagination} + * @memberof PaymentMappingOptions + */ + pagination?: Pagination; } diff --git a/sync-for-payables/src/sdk/models/shared/security.ts b/sync-for-payables/src/sdk/models/shared/security.ts deleted file mode 100644 index 675eaa582..000000000 --- a/sync-for-payables/src/sdk/models/shared/security.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; - -export type Security = { - authHeader: string; -}; - -/** @internal */ -export type Security$Outbound = { - auth_header: string; -}; - -/** @internal */ -export const Security$outboundSchema: z.ZodType< - Security$Outbound, - z.ZodTypeDef, - Security -> = z.object({ - authHeader: z.string(), -}).transform((v) => { - return remap$(v, { - authHeader: "auth_header", - }); -}); - -export function securityToJSON(security: Security): string { - return JSON.stringify(Security$outboundSchema.parse(security)); -} diff --git a/sync-for-payables/src/sdk/models/shared/supplier.ts b/sync-for-payables/src/sdk/models/shared/supplier.ts index ec286a0bb..843ab5d71 100644 --- a/sync-for-payables/src/sdk/models/shared/supplier.ts +++ b/sync-for-payables/src/sdk/models/shared/supplier.ts @@ -1,89 +1,592 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Address, Address$inboundSchema } from "./address.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { SupplierStatus } from './supplierstatus'; import { - SupplierStatus, - SupplierStatus$inboundSchema, -} from "./supplierstatus.js"; + SupplierStatusFromJSON, + SupplierStatusFromJSONTyped, + SupplierStatusToJSON, + SupplierStatusToJSONTyped, +} from './supplierstatus'; +import type { Address } from './address'; +import { + AddressFromJSON, + AddressFromJSONTyped, + AddressToJSON, + AddressToJSONTyped, +} from './address'; /** - * Suppliers are people or organizations that provide something, such as a product or service. Use the [List suppliers](https://docs.codat.io/sync-for-payables-v2-api#/operations/list-suppliers) endpoint to retrieve a list of all suppliers for a company. - * - * @remarks - * + * Suppliers are people or organizations that provide something, such as a product or service. Use the [List suppliers](https://docs.codat.io/sync-for-payables-v2-api#/operations/list-suppliers) endpoint to retrieve a list of all suppliers for a company. + * * Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-v2-api#/schemas/Bill). + * + * @export + * @interface Supplier */ -export type Supplier = { - /** - * Identifier for the supplier, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the supplier as recorded in the accounting system, typically the company name. - */ - supplierName?: string | undefined; - /** - * Name of the main contact for the supplier. - */ - contactName?: string | null | undefined; - /** - * Email address that the supplier may be contacted on. - */ - emailAddress?: string | null | undefined; - /** - * Phone number that the supplier may be contacted on. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array
| null | undefined; - /** - * Status of the supplier. - */ - status?: SupplierStatus | undefined; - /** - * Amount outstanding against the supplier. - */ - balance?: Decimal$ | number | null | undefined; - /** - * Default currency the supplier's transactional data is recorded in. - */ - defaultCurrency?: string | null | undefined; - sourceModifiedDate?: string | undefined; -}; - -/** @internal */ -export const Supplier$inboundSchema: z.ZodType< - Supplier, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - supplierName: z.string().optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Address$inboundSchema)).optional(), - status: SupplierStatus$inboundSchema.optional(), - balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), - defaultCurrency: z.nullable(z.string()).optional(), - sourceModifiedDate: z.string().optional(), -}); - -export function supplierFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Supplier$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Supplier' from JSON`, - ); +export interface Supplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the Supplier interface. + */ +export function instanceOfSupplier(value: object): value is Supplier { + return true; +} + +export function SupplierFromJSON(json: any): Supplier { + return SupplierFromJSONTyped(json, false); +} + +export function SupplierFromJSONTyped(json: any, ignoreDiscriminator: boolean): Supplier { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'supplierName': json['supplierName'] == null ? undefined : json['supplierName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(AddressFromJSON)), + 'status': json['status'] == null ? undefined : SupplierStatusFromJSON(json['status']), + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function SupplierToJSON(json: any): Supplier { + return SupplierToJSONTyped(json, false); +} + +export function SupplierToJSONTyped(value?: Supplier | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'supplierName': value['supplierName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(AddressToJSON)), + 'status': SupplierStatusToJSON(value['status']), + 'balance': fromDecimal(value['balance']), + 'defaultCurrency': value['defaultCurrency'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface CreateSupplierResponseSupplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; +} + +export interface ListSuppliersResponseSupplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; +} + +export interface SupplierCreateResponseSupplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; +} + +export interface SupplierUpdateResponseSupplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; +} + +export interface SuppliersListResponseSupplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; +} + +export interface UpdateSupplierResponseSupplier { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof Supplier + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status?: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof Supplier + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; } diff --git a/sync-for-payables/src/sdk/models/shared/supplierprototype.ts b/sync-for-payables/src/sdk/models/shared/supplierprototype.ts index 0354408f5..c7c3e4a3b 100644 --- a/sync-for-payables/src/sdk/models/shared/supplierprototype.ts +++ b/sync-for-payables/src/sdk/models/shared/supplierprototype.ts @@ -1,90 +1,447 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { SupplierStatus } from './supplierstatus'; import { - Address, - Address$Outbound, - Address$outboundSchema, -} from "./address.js"; + SupplierStatusFromJSON, + SupplierStatusFromJSONTyped, + SupplierStatusToJSON, + SupplierStatusToJSONTyped, +} from './supplierstatus'; +import type { Address } from './address'; import { - SupplierStatus, - SupplierStatus$outboundSchema, -} from "./supplierstatus.js"; - -export type SupplierPrototype = { - /** - * Name of the supplier as recorded in the accounting system, typically the company name. - */ - supplierName: string; - /** - * Name of the main contact for the supplier. - */ - contactName?: string | null | undefined; - /** - * Email address that the supplier may be contacted on. - */ - emailAddress?: string | null | undefined; - /** - * Phone number that the supplier may be contacted on. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array
| null | undefined; - /** - * Status of the supplier. - */ - status: SupplierStatus; - /** - * Amount outstanding against the supplier. - */ - balance?: Decimal$ | number | null | undefined; - /** - * Default currency the supplier's transactional data is recorded in. - */ - defaultCurrency?: string | null | undefined; -}; - -/** @internal */ -export type SupplierPrototype$Outbound = { - supplierName: string; - contactName?: string | null | undefined; - emailAddress?: string | null | undefined; - phone?: string | null | undefined; - addresses?: Array | null | undefined; - status: string; - balance?: number | null | undefined; - defaultCurrency?: string | null | undefined; -}; - -/** @internal */ -export const SupplierPrototype$outboundSchema: z.ZodType< - SupplierPrototype$Outbound, - z.ZodTypeDef, - SupplierPrototype -> = z.object({ - supplierName: z.string(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Address$outboundSchema)).optional(), - status: SupplierStatus$outboundSchema, - balance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - defaultCurrency: z.nullable(z.string()).optional(), -}); - -export function supplierPrototypeToJSON( - supplierPrototype: SupplierPrototype, -): string { - return JSON.stringify( - SupplierPrototype$outboundSchema.parse(supplierPrototype), - ); + AddressFromJSON, + AddressFromJSONTyped, + AddressToJSON, + AddressToJSONTyped, +} from './address'; + +/** + * + * @export + * @interface SupplierPrototype + */ +export interface SupplierPrototype { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; +} + + + +/** + * Check if a given object implements the SupplierPrototype interface. + */ +export function instanceOfSupplierPrototype(value: object): value is SupplierPrototype { + if (!('supplierName' in value) || value['supplierName'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function SupplierPrototypeFromJSON(json: any): SupplierPrototype { + return SupplierPrototypeFromJSONTyped(json, false); +} + +export function SupplierPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplierPrototype { + if (json == null) { + return json; + } + return { + + 'supplierName': json['supplierName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(AddressFromJSON)), + 'status': SupplierStatusFromJSON(json['status']), + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + }; +} + +export function SupplierPrototypeToJSON(json: any): SupplierPrototype { + return SupplierPrototypeToJSONTyped(json, false); +} + +export function SupplierPrototypeToJSONTyped(value?: SupplierPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'supplierName': value['supplierName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(AddressToJSON)), + 'status': SupplierStatusToJSON(value['status']), + 'balance': fromDecimal(value['balance']), + 'defaultCurrency': value['defaultCurrency'], + }; +} + + +export interface CreateSupplierRequestBody { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; +} + +export interface CreateSupplierSupplierPrototype { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; +} + +export interface SupplierCreateRequestBody { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; +} + +export interface SupplierUpdateRequestBody { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; +} + +export interface UpdateSupplierRequestBody { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; +} + +export interface UpdateSupplierSupplierPrototype { + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof SupplierPrototype + */ + supplierName: string; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof SupplierPrototype + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof SupplierPrototype + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array
} + * @memberof SupplierPrototype + */ + addresses?: Array
| null; + /** + * + * @type {SupplierStatus} + * @memberof SupplierPrototype + */ + status: SupplierStatus; + /** + * Amount outstanding against the supplier. + * @type {number} + * @memberof SupplierPrototype + */ + balance?: Decimal | number | null; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof SupplierPrototype + */ + defaultCurrency?: string | null; } diff --git a/sync-for-payables/src/sdk/models/shared/supplierref.ts b/sync-for-payables/src/sdk/models/shared/supplierref.ts index 43af97289..690823f6e 100644 --- a/sync-for-payables/src/sdk/models/shared/supplierref.ts +++ b/sync-for-payables/src/sdk/models/shared/supplierref.ts @@ -1,60 +1,164 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Reference to the supplier the record relates to. + * @export + * @interface SupplierRef */ -export type SupplierRef = { - /** - * The supplier's unique ID - */ - id: string; - /** - * The supplier's name - */ - supplierName?: string | null | undefined; -}; - -/** @internal */ -export const SupplierRef$inboundSchema: z.ZodType< - SupplierRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - supplierName: z.nullable(z.string()).optional(), -}); -/** @internal */ -export type SupplierRef$Outbound = { - id: string; - supplierName?: string | null | undefined; -}; - -/** @internal */ -export const SupplierRef$outboundSchema: z.ZodType< - SupplierRef$Outbound, - z.ZodTypeDef, - SupplierRef -> = z.object({ - id: z.string(), - supplierName: z.nullable(z.string()).optional(), -}); - -export function supplierRefToJSON(supplierRef: SupplierRef): string { - return JSON.stringify(SupplierRef$outboundSchema.parse(supplierRef)); -} -export function supplierRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SupplierRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupplierRef' from JSON`, - ); +export interface SupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; +} + +/** + * Check if a given object implements the SupplierRef interface. + */ +export function instanceOfSupplierRef(value: object): value is SupplierRef { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function SupplierRefFromJSON(json: any): SupplierRef { + return SupplierRefFromJSONTyped(json, false); +} + +export function SupplierRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplierRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'supplierName': json['supplierName'] == null ? undefined : json['supplierName'], + }; +} + +export function SupplierRefToJSON(json: any): SupplierRef { + return SupplierRefToJSONTyped(json, false); +} + +export function SupplierRefToJSONTyped(value?: SupplierRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'supplierName': value['supplierName'], + }; +} + + +export interface BillCreateResponseSupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; +} + +export interface BillEventWebhookSupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; +} + +export interface BillSupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; +} + +export interface BillUpdateResponseSupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; +} + +export interface CreateBillResponseSupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; +} + +export interface UpdateBillResponseSupplierRef { + /** + * The supplier's unique ID + * @type {string} + * @memberof SupplierRef + */ + id: string; + /** + * The supplier's name + * @type {string} + * @memberof SupplierRef + */ + supplierName?: string | null; } diff --git a/sync-for-payables/src/sdk/models/shared/suppliers.ts b/sync-for-payables/src/sdk/models/shared/suppliers.ts index 58e065122..c2d177701 100644 --- a/sync-for-payables/src/sdk/models/shared/suppliers.ts +++ b/sync-for-payables/src/sdk/models/shared/suppliers.ts @@ -1,35 +1,118 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Pagination, Pagination$inboundSchema } from "./pagination.js"; -import { Supplier, Supplier$inboundSchema } from "./supplier.js"; - -export type Suppliers = { - results?: Array | undefined; - pagination?: Pagination | undefined; -}; - -/** @internal */ -export const Suppliers$inboundSchema: z.ZodType< - Suppliers, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Supplier$inboundSchema).optional(), - pagination: Pagination$inboundSchema.optional(), -}); - -export function suppliersFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Suppliers$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Suppliers' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Pagination } from './pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './pagination'; +import type { Supplier } from './supplier'; +import { + SupplierFromJSON, + SupplierFromJSONTyped, + SupplierToJSON, + SupplierToJSONTyped, +} from './supplier'; + +/** + * + * @export + * @interface Suppliers + */ +export interface Suppliers { + /** + * + * @type {Array} + * @memberof Suppliers + */ + results?: Array; + /** + * + * @type {Pagination} + * @memberof Suppliers + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the Suppliers interface. + */ +export function instanceOfSuppliers(value: object): value is Suppliers { + return true; +} + +export function SuppliersFromJSON(json: any): Suppliers { + return SuppliersFromJSONTyped(json, false); +} + +export function SuppliersFromJSONTyped(json: any, ignoreDiscriminator: boolean): Suppliers { + if (json == null) { + return json; + } + return { + + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(SupplierFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function SuppliersToJSON(json: any): Suppliers { + return SuppliersToJSONTyped(json, false); +} + +export function SuppliersToJSONTyped(value?: Suppliers | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(SupplierToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + + +export interface ListSuppliersResponseSuppliers { + /** + * + * @type {Array} + * @memberof Suppliers + */ + results?: Array; + /** + * + * @type {Pagination} + * @memberof Suppliers + */ + pagination?: Pagination; +} + +export interface SuppliersListResponseSuppliers { + /** + * + * @type {Array} + * @memberof Suppliers + */ + results?: Array; + /** + * + * @type {Pagination} + * @memberof Suppliers + */ + pagination?: Pagination; } diff --git a/sync-for-payables/src/sdk/models/shared/supplierstatus.ts b/sync-for-payables/src/sdk/models/shared/supplierstatus.ts index 21b6220e1..8ad46eb44 100644 --- a/sync-for-payables/src/sdk/models/shared/supplierstatus.ts +++ b/sync-for-payables/src/sdk/models/shared/supplierstatus.ts @@ -1,28 +1,54 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of the supplier. + * @export */ export const SupplierStatus = { - Unknown: "Unknown", - Active: "Active", - Archived: "Archived", + Unknown: 'Unknown', + Active: 'Active', + Archived: 'Archived' } as const; -/** - * Status of the supplier. - */ -export type SupplierStatus = ClosedEnum; - -/** @internal */ -export const SupplierStatus$inboundSchema: z.ZodNativeEnum< - typeof SupplierStatus -> = z.nativeEnum(SupplierStatus); -/** @internal */ -export const SupplierStatus$outboundSchema: z.ZodNativeEnum< - typeof SupplierStatus -> = SupplierStatus$inboundSchema; +export type SupplierStatus = typeof SupplierStatus[keyof typeof SupplierStatus]; + + +export function instanceOfSupplierStatus(value: any): boolean { + for (const key in SupplierStatus) { + if (Object.prototype.hasOwnProperty.call(SupplierStatus, key)) { + if (SupplierStatus[key as keyof typeof SupplierStatus] === value) { + return true; + } + } + } + return false; +} + +export function SupplierStatusFromJSON(json: any): SupplierStatus { + return SupplierStatusFromJSONTyped(json, false); +} + +export function SupplierStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplierStatus { + return json as SupplierStatus; +} + +export function SupplierStatusToJSON(value?: SupplierStatus | null): any { + return value as any; +} + +export function SupplierStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): SupplierStatus { + return value as SupplierStatus; +} + diff --git a/sync-for-payables/src/sdk/models/shared/taxratemappingoption.ts b/sync-for-payables/src/sdk/models/shared/taxratemappingoption.ts index 0657c4a1b..c58e9c275 100644 --- a/sync-for-payables/src/sdk/models/shared/taxratemappingoption.ts +++ b/sync-for-payables/src/sdk/models/shared/taxratemappingoption.ts @@ -1,92 +1,284 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { TaxRateStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +/** + * + * @export + * @interface TaxRateMappingOption + */ +export interface TaxRateMappingOption { + /** + * Identifier for the tax rate, unique for the company in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + id?: string; + /** + * Codat-augmented name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + name?: string | null; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + code?: string | null; + /** + * See Effective tax rates description. + * @type {number} + * @memberof TaxRateMappingOption + */ + effectiveTaxRate?: Decimal | number | null; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingOption + */ + totalTaxRate?: Decimal | number | null; + /** + * Status of the tax rate in the accounting software. + * - `Active` - An active tax rate in use by a company. + * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + status?: TaxRateStatus; +} + /** - * Status of the tax rate in the accounting software. - * - * @remarks - * - `Active` - An active tax rate in use by a company. - * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * @export */ -export const TaxRateStatus = { - Active: "Active", - Archived: "Archived", +export const TaxRateMappingOptionStatusEnum = { + Active: 'Active', + Archived: 'Archived' } as const; +export type TaxRateMappingOptionStatusEnum = typeof TaxRateMappingOptionStatusEnum[keyof typeof TaxRateMappingOptionStatusEnum]; + + /** - * Status of the tax rate in the accounting software. - * - * @remarks - * - `Active` - An active tax rate in use by a company. - * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * Check if a given object implements the TaxRateMappingOption interface. */ -export type TaxRateStatus = ClosedEnum; +export function instanceOfTaxRateMappingOption(value: object): value is TaxRateMappingOption { + return true; +} -export type TaxRateMappingOption = { - /** - * Identifier for the tax rate, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Codat-augmented name of the tax rate in the accounting software. - */ - name?: string | null | undefined; - /** - * Code for the tax rate from the accounting software. - */ - code?: string | null | undefined; - /** - * See Effective tax rates description. - */ - effectiveTaxRate?: Decimal$ | number | null | undefined; - /** - * Total (not compounded) sum of the components of a tax rate. - */ - totalTaxRate?: Decimal$ | number | null | undefined; - /** - * Status of the tax rate in the accounting software. - * - * @remarks - * - `Active` - An active tax rate in use by a company. - * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. - */ - status?: TaxRateStatus | undefined; -}; +export function TaxRateMappingOptionFromJSON(json: any): TaxRateMappingOption { + return TaxRateMappingOptionFromJSONTyped(json, false); +} -/** @internal */ -export const TaxRateStatus$inboundSchema: z.ZodNativeEnum< - typeof TaxRateStatus -> = z.nativeEnum(TaxRateStatus); +export function TaxRateMappingOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaxRateMappingOption { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'code': json['code'] == null ? undefined : json['code'], + 'effectiveTaxRate': json['effectiveTaxRate'] == null ? undefined : toDecimal(json['effectiveTaxRate']), + 'totalTaxRate': json['totalTaxRate'] == null ? undefined : toDecimal(json['totalTaxRate']), + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function TaxRateMappingOptionToJSON(json: any): TaxRateMappingOption { + return TaxRateMappingOptionToJSONTyped(json, false); +} + +export function TaxRateMappingOptionToJSONTyped(value?: TaxRateMappingOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'code': value['code'], + 'effectiveTaxRate': fromDecimal(value['effectiveTaxRate']), + 'totalTaxRate': fromDecimal(value['totalTaxRate']), + 'status': value['status'], + }; +} -/** @internal */ -export const TaxRateMappingOption$inboundSchema: z.ZodType< - TaxRateMappingOption, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.nullable(z.string()).optional(), - code: z.nullable(z.string()).optional(), - effectiveTaxRate: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - totalTaxRate: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - status: TaxRateStatus$inboundSchema.optional(), -}); -export function taxRateMappingOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TaxRateMappingOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TaxRateMappingOption' from JSON`, - ); +export interface BillMappingOptionsTaxRateMappingOption { + /** + * Identifier for the tax rate, unique for the company in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + id?: string; + /** + * Codat-augmented name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + name?: string | null; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + code?: string | null; + /** + * See Effective tax rates description. + * @type {number} + * @memberof TaxRateMappingOption + */ + effectiveTaxRate?: Decimal | number | null; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingOption + */ + totalTaxRate?: Decimal | number | null; + /** + * Status of the tax rate in the accounting software. + * - `Active` - An active tax rate in use by a company. + * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + status?: TaxRateStatus; +} + +export interface GetMappingOptionsBillsResponseTaxRateMappingOption { + /** + * Identifier for the tax rate, unique for the company in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + id?: string; + /** + * Codat-augmented name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + name?: string | null; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + code?: string | null; + /** + * See Effective tax rates description. + * @type {number} + * @memberof TaxRateMappingOption + */ + effectiveTaxRate?: Decimal | number | null; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingOption + */ + totalTaxRate?: Decimal | number | null; + /** + * Status of the tax rate in the accounting software. + * - `Active` - An active tax rate in use by a company. + * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + status?: TaxRateStatus; +} + +export interface MappingOptionsBillsGetResponseTaxRateMappingOption { + /** + * Identifier for the tax rate, unique for the company in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + id?: string; + /** + * Codat-augmented name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + name?: string | null; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + code?: string | null; + /** + * See Effective tax rates description. + * @type {number} + * @memberof TaxRateMappingOption + */ + effectiveTaxRate?: Decimal | number | null; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingOption + */ + totalTaxRate?: Decimal | number | null; + /** + * Status of the tax rate in the accounting software. + * - `Active` - An active tax rate in use by a company. + * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + status?: TaxRateStatus; +} + +export interface MappingOptionsBillsTaxRateMappingOption { + /** + * Identifier for the tax rate, unique for the company in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + id?: string; + /** + * Codat-augmented name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + name?: string | null; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + code?: string | null; + /** + * See Effective tax rates description. + * @type {number} + * @memberof TaxRateMappingOption + */ + effectiveTaxRate?: Decimal | number | null; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingOption + */ + totalTaxRate?: Decimal | number | null; + /** + * Status of the tax rate in the accounting software. + * - `Active` - An active tax rate in use by a company. + * - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + * @type {string} + * @memberof TaxRateMappingOption + */ + status?: TaxRateStatus; } diff --git a/sync-for-payables/src/sdk/models/shared/trackingref.ts b/sync-for-payables/src/sdk/models/shared/trackingref.ts index 4ee5f0010..26386c1aa 100644 --- a/sync-for-payables/src/sdk/models/shared/trackingref.ts +++ b/sync-for-payables/src/sdk/models/shared/trackingref.ts @@ -1,84 +1,93 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bill pay (synchronous solution) + * The API reference for the synchronous Bill Pay solution. The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It\'s ideal for facilitating essential bill payment processes within your SMB\'s accounting software. [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations | Integration | Supported | |-------------------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Company information | View company profile from the source platform. | | Bills | Get, create, and update Bills. | | Bill payments | Get, create, and update Bill payments. | | Suppliers | Get, create, and update Suppliers. | | Bank accounts | Create a bank account for a given company\'s connection. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { DataType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface TrackingRef + */ +export interface TrackingRef { + /** + * Unique identifier of the linked tracking category or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference. + * @type {string} + * @memberof TrackingRef + */ + dataType?: DataType; + /** + * If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. + * @type {boolean} + * @memberof TrackingRef + */ + isBillable?: boolean; +} + /** - * The type of the linked reference. + * @export */ -export const DataType = { - TrackingCategories: "trackingCategories", - Customers: "customers", +export const TrackingRefDataTypeEnum = { + TrackingCategories: 'trackingCategories', + Customers: 'customers' } as const; +export type TrackingRefDataTypeEnum = typeof TrackingRefDataTypeEnum[keyof typeof TrackingRefDataTypeEnum]; + + /** - * The type of the linked reference. + * Check if a given object implements the TrackingRef interface. */ -export type DataType = ClosedEnum; +export function instanceOfTrackingRef(value: object): value is TrackingRef { + return true; +} -export type TrackingRef = { - /** - * Unique identifier of the linked tracking category or the unique identifier of the linked customer. - */ - id?: string | undefined; - /** - * The type of the linked reference. - */ - dataType?: DataType | undefined; - /** - * If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. - */ - isBillable?: boolean | undefined; -}; +export function TrackingRefFromJSON(json: any): TrackingRef { + return TrackingRefFromJSONTyped(json, false); +} -/** @internal */ -export const DataType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataType); -/** @internal */ -export const DataType$outboundSchema: z.ZodNativeEnum = - DataType$inboundSchema; +export function TrackingRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrackingRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'isBillable': json['isBillable'] == null ? undefined : json['isBillable'], + }; +} -/** @internal */ -export const TrackingRef$inboundSchema: z.ZodType< - TrackingRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - dataType: DataType$inboundSchema.optional(), - isBillable: z.boolean().optional(), -}); -/** @internal */ -export type TrackingRef$Outbound = { - id?: string | undefined; - dataType?: string | undefined; - isBillable?: boolean | undefined; -}; +export function TrackingRefToJSON(json: any): TrackingRef { + return TrackingRefToJSONTyped(json, false); +} -/** @internal */ -export const TrackingRef$outboundSchema: z.ZodType< - TrackingRef$Outbound, - z.ZodTypeDef, - TrackingRef -> = z.object({ - id: z.string().optional(), - dataType: DataType$outboundSchema.optional(), - isBillable: z.boolean().optional(), -}); +export function TrackingRefToJSONTyped(value?: TrackingRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function trackingRefToJSON(trackingRef: TrackingRef): string { - return JSON.stringify(TrackingRef$outboundSchema.parse(trackingRef)); -} -export function trackingRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TrackingRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TrackingRef' from JSON`, - ); + return { + + 'id': value['id'], + 'dataType': value['dataType'], + 'isBillable': value['isBillable'], + }; } + diff --git a/sync-for-payables/src/sdk/sdk.ts b/sync-for-payables/src/sdk/sdk.ts index 2da7d5fa2..aac59d827 100644 --- a/sync-for-payables/src/sdk/sdk.ts +++ b/sync-for-payables/src/sdk/sdk.ts @@ -1,68 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { validateWebhook } from "../funcs/validateWebhook.js"; -import { ClientSDK } from "../lib/sdks.js"; -import { BankAccounts } from "./bankaccounts.js"; -import { BillPayments } from "./billpayments.js"; -import { Bills } from "./bills.js"; -import { Companies } from "./companies.js"; -import { CompanyInformation } from "./companyinformation.js"; -import { Connections } from "./connections.js"; -import * as shared from "./models/shared/index.js"; -import { Suppliers } from "./suppliers.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CodatSyncPayables extends ClientSDK { - private _companies?: Companies; - get companies(): Companies { - return (this._companies ??= new Companies(this._options)); - } - - private _connections?: Connections; - get connections(): Connections { - return (this._connections ??= new Connections(this._options)); - } - - private _companyInformation?: CompanyInformation; - get companyInformation(): CompanyInformation { - return (this._companyInformation ??= new CompanyInformation(this._options)); - } - - private _bills?: Bills; - get bills(): Bills { - return (this._bills ??= new Bills(this._options)); - } - - private _billPayments?: BillPayments; - get billPayments(): BillPayments { - return (this._billPayments ??= new BillPayments(this._options)); - } - - private _suppliers?: Suppliers; - get suppliers(): Suppliers { - return (this._suppliers ??= new Suppliers(this._options)); - } - - private _bankAccounts?: BankAccounts; - get bankAccounts(): BankAccounts { - return (this._bankAccounts ??= new BankAccounts(this._options)); - } - - async validateWebhook({ - request, - }: { - request: { - body: string; - headers: Record | Headers; - url: string; - method: string; - } | Request; - }): Promise { - return unwrapAsync(validateWebhook( - this, - { request }, - )); - } -} +export * from "../sdk"; diff --git a/sync-for-payables/src/sdk/suppliers.ts b/sync-for-payables/src/sdk/suppliers.ts index 0ad27777d..0b038af81 100644 --- a/sync-for-payables/src/sdk/suppliers.ts +++ b/sync-for-payables/src/sdk/suppliers.ts @@ -1,114 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { suppliersCreate } from "../funcs/suppliersCreate.js"; -import { suppliersList } from "../funcs/suppliersList.js"; -import { suppliersUpdate } from "../funcs/suppliersUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Suppliers extends ClientSDK { - /** - * List suppliers - * - * @remarks - * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. - * - * For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Zoho Books | Yes | - */ - async list( - request: operations.ListSuppliersRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersList( - this, - request, - options, - )); - } - - /** - * Create supplier - * - * @remarks - * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Zoho Books | Yes | - */ - async create( - request: operations.CreateSupplierRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersCreate( - this, - request, - options, - )); - } - - /** - * Update supplier - * - * @remarks - * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * This is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - * | Oracle NetSuite | No | - * | Sage Intacct | No | - * | Zoho Books | No | - * - * ### Platform-specific behavior - * - * - **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating. - * - **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update. - */ - async update( - request: operations.UpdateSupplierRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersUpdate( - this, - request, - options, - )); - } -} +export { Suppliers } from "../apis/Suppliers"; diff --git a/sync-for-payables/src/sdk/types/async.ts b/sync-for-payables/src/sdk/types/async.ts index 689dba5de..208661e87 100644 --- a/sync-for-payables/src/sdk/types/async.ts +++ b/sync-for-payables/src/sdk/types/async.ts @@ -1,68 +1,51 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ export type APICall = - | { - status: "complete"; - request: Request; - response: Response; - } - | { - status: "request-error"; - request: Request; - response?: undefined; - } - | { - status: "invalid"; - request?: undefined; - response?: undefined; - }; + | { status: "complete"; request: Request; response: Response } + | { status: "request-error"; request: Request; response?: undefined } + | { status: "invalid"; request?: undefined; response?: undefined }; -export class APIPromise implements Promise { - readonly #promise: Promise<[T, APICall]>; - readonly #unwrapped: Promise; +export class APIPromise { + private readonly inner: Promise; - readonly [Symbol.toStringTag] = "APIPromise"; + constructor(inner: Promise) { + this.inner = inner; + } - constructor(p: [T, APICall] | Promise<[T, APICall]>) { - this.#promise = p instanceof Promise ? p : Promise.resolve(p); - this.#unwrapped = - p instanceof Promise - ? this.#promise.then(([value]) => value) - : Promise.resolve(p[0]); - } + then( + onfulfilled?: ((value: T) => R1 | PromiseLike) | null, + onrejected?: ((reason: unknown) => R2 | PromiseLike) | null, + ): Promise { + return this.inner.then(onfulfilled, onrejected); + } - then( - onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | null - | undefined, - onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | null - | undefined, - ): Promise { - return this.#promise.then( - onfulfilled ? ([value]) => onfulfilled(value) : void 0, - onrejected, - ); - } + catch(onrejected?: ((reason: unknown) => R | PromiseLike) | null): Promise { + return this.inner.catch(onrejected); + } - catch( - onrejected?: - | ((reason: any) => TResult | PromiseLike) - | null - | undefined, - ): Promise { - return this.#unwrapped.catch(onrejected); - } + finally(onfinally?: (() => void) | null): Promise { + return this.inner.then( + (value) => { + if (onfinally) { + onfinally(); + } + return value; + }, + (reason) => { + if (onfinally) { + onfinally(); + } + throw reason; + }, + ); + } - finally(onfinally?: (() => void) | null | undefined): Promise { - return this.#unwrapped.finally(onfinally); - } + $inspect(): Promise { + return this.inner; + } - $inspect(): Promise<[T, APICall]> { - return this.#promise; - } + get [Symbol.toStringTag](): string { + return "APIPromise"; + } } diff --git a/sync-for-payables/src/sdk/types/blobs.ts b/sync-for-payables/src/sdk/types/blobs.ts deleted file mode 100644 index cce2892d4..000000000 --- a/sync-for-payables/src/sdk/types/blobs.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export const blobLikeSchema: z.ZodType = z.custom< - Blob ->(isBlobLike, { - message: "expected a Blob, File or Blob-like object", - fatal: true, -}); - -export function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const name = val[Symbol.toStringTag]; - if (typeof name !== "string") { - return false; - } - if (name !== "Blob" && name !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} diff --git a/sync-for-payables/src/sdk/types/constdatetime.ts b/sync-for-payables/src/sdk/types/constdatetime.ts deleted file mode 100644 index fe62144ea..000000000 --- a/sync-for-payables/src/sdk/types/constdatetime.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function constDateTime( - val: string, -): z.ZodType { - return z.custom((v) => { - return ( - typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() - ); - }, `Value must be equivalent to ${val}`); -} diff --git a/sync-for-payables/src/sdk/types/decimal.ts b/sync-for-payables/src/sdk/types/decimal.ts index a7895d555..5dcba30f5 100644 --- a/sync-for-payables/src/sdk/types/decimal.ts +++ b/sync-for-payables/src/sdk/types/decimal.ts @@ -1,5 +1,3 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - +/* tslint:disable */ +/* eslint-disable */ export * from "decimal.js"; diff --git a/sync-for-payables/src/sdk/types/enums.ts b/sync-for-payables/src/sdk/types/enums.ts deleted file mode 100644 index aba0ffd2a..000000000 --- a/sync-for-payables/src/sdk/types/enums.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { Unrecognized, unrecognized } from "./unrecognized.js"; - -export type ClosedEnum>> = - T[keyof T]; -export type OpenEnum>> = - | T[keyof T] - | Unrecognized; - -export function inboundSchema>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - const options = Object.values(enumObj); - return z.union([ - ...options.map(x => z.literal(x)), - z.string().transform(x => unrecognized(x)), - ] as any); -} - -export function inboundSchemaInt>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - // For numeric enums, Object.values returns both numbers and string keys - const options = Object.values(enumObj).filter(v => typeof v === "number"); - return z.union([ - ...options.map(x => z.literal(x)), - z.number().int().transform(x => unrecognized(x)), - ] as any); -} - -export function outboundSchema>( - _: T, -): z.ZodType> { - return z.string() as any; -} - -export function outboundSchemaInt>( - _: T, -): z.ZodType> { - return z.number().int() as any; -} diff --git a/sync-for-payables/src/sdk/types/fp.ts b/sync-for-payables/src/sdk/types/fp.ts index ccbe51eac..84eb7e4f3 100644 --- a/sync-for-payables/src/sdk/types/fp.ts +++ b/sync-for-payables/src/sdk/types/fp.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * A monad that captures the result of a function call or an error if it was not - * successful. Railway programming, enabled by this type, can be a nicer - * alternative to traditional exception throwing because it allows functions to - * declare all _known_ errors with static types and then check for them - * exhaustively in application code. Thrown exception have a type of `unknown` - * and break out of regular control flow of programs making them harder to - * inspect and more verbose work with due to try-catch blocks. - */ -export type Result = - | { ok: true; value: T; error?: never } - | { ok: false; value?: never; error: E }; +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; -export function OK(value: V): Result { - return { ok: true, value }; +export function OK(value: T): Result { + return { ok: true, value }; } export function ERR(error: E): Result { - return { ok: false, error }; + return { ok: false, error }; } -/** - * unwrap is a convenience function for extracting a value from a result or - * throwing if there was an error. - */ export function unwrap(r: Result): T { - if (!r.ok) { + if (r.ok) { + return r.value; + } throw r.error; - } - return r.value; } -/** - * unwrapAsync is a convenience function for resolving a value from a Promise - * of a result or rejecting if an error occurred. - */ -export async function unwrapAsync( - pr: Promise>, -): Promise { - const r = await pr; - if (!r.ok) { - throw r.error; - } - - return r.value; +export async function unwrapAsync(pr: Promise>): Promise { + return unwrap(await pr); } diff --git a/sync-for-payables/src/sdk/types/index.ts b/sync-for-payables/src/sdk/types/index.ts index 19a7bd013..43093a397 100644 --- a/sync-for-payables/src/sdk/types/index.ts +++ b/sync-for-payables/src/sdk/types/index.ts @@ -1,13 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export { blobLikeSchema, isBlobLike } from "./blobs.js"; -export { Decimal } from "./decimal.js"; -export type { ClosedEnum, OpenEnum } from "./enums.js"; -export type { Result } from "./fp.js"; -export type { PageIterator, Paginator } from "./operations.js"; -export { createPageIterator } from "./operations.js"; -export { RFCDate } from "./rfcdate.js"; -export * from "./unrecognized.js"; -export type { WebhookRecipient } from "./webhooks.js"; +export * from './rfcdate'; +export * from './async'; +export * from './decimal'; +export * from './fp'; +export * from './operations'; diff --git a/sync-for-payables/src/sdk/types/operations.ts b/sync-for-payables/src/sdk/types/operations.ts index beb81e10f..b6d42c45c 100644 --- a/sync-for-payables/src/sdk/types/operations.ts +++ b/sync-for-payables/src/sdk/types/operations.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ import { Result } from "./fp.js"; @@ -101,5 +100,3 @@ function unwrapPaginator( }); }; } - -export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/sync-for-payables/src/sdk/types/rfcdate.ts b/sync-for-payables/src/sdk/types/rfcdate.ts index c79b3f53a..03939e51e 100644 --- a/sync-for-payables/src/sdk/types/rfcdate.ts +++ b/sync-for-payables/src/sdk/types/rfcdate.ts @@ -1,54 +1,22 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const dateRE = /^\d{4}-\d{2}-\d{2}$/; +/* tslint:disable */ +/* eslint-disable */ export class RFCDate { - private serialized: string; - - /** - * Creates a new RFCDate instance using today's date. - */ - static today(): RFCDate { - return new RFCDate(new Date()); - } + private date: string; - /** - * Creates a new RFCDate instance using the provided input. - * If a string is used then in must be in the format YYYY-MM-DD. - * - * @param date A Date object or a date string in YYYY-MM-DD format - * @example - * new RFCDate("2022-01-01") - * @example - * new RFCDate(new Date()) - */ - constructor(date: Date | string) { - if (typeof date === "string" && !dateRE.test(date)) { - throw new RangeError( - "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, - ); + constructor(date: Date | string) { + this.date = date instanceof Date ? date.toISOString().slice(0, 10) : date; } - const value = new Date(date); - if (isNaN(+value)) { - throw new RangeError("RFCDate: invalid date provided: " + date); + static today(): RFCDate { + return new RFCDate(new Date()); } - this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); - if (!dateRE.test(this.serialized)) { - throw new TypeError( - `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, - ); + toJSON(): string { + return this.date; } - } - toJSON(): string { - return this.toString(); - } - - toString(): string { - return this.serialized; - } + toString(): string { + return this.date; + } } diff --git a/sync-for-payables/src/sdk/types/streams.ts b/sync-for-payables/src/sdk/types/streams.ts deleted file mode 100644 index a0163e7a9..000000000 --- a/sync-for-payables/src/sdk/types/streams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isReadableStream( - val: unknown, -): val is ReadableStream { - if (typeof val !== "object" || val === null) { - return false; - } - - // Check for the presence of methods specific to ReadableStream - const stream = val as ReadableStream; - - // ReadableStream has methods like getReader, cancel, and tee - return ( - typeof stream.getReader === "function" && - typeof stream.cancel === "function" && - typeof stream.tee === "function" - ); -} diff --git a/sync-for-payables/src/sdk/types/unrecognized.ts b/sync-for-payables/src/sdk/types/unrecognized.ts deleted file mode 100644 index b7a2a13f3..000000000 --- a/sync-for-payables/src/sdk/types/unrecognized.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -declare const __brand: unique symbol; -export type Unrecognized = T & { [__brand]: "unrecognized" }; - -function unrecognized(value: T): Unrecognized { - globalCount++; - return value as Unrecognized; -} - -let globalCount = 0; -let refCount = 0; -export function startCountingUnrecognized() { - refCount++; - const start = globalCount; - return { - /** - * Ends counting and returns the delta. - * @param delta - If provided, only this amount is added to the parent counter - * (used for nested unions where we only want to record the winning option's count). - * If not provided, records all counts since start(). - */ - end: (delta?: number) => { - const count = globalCount - start; - // Reset globalCount back to start, then add only the specified delta - globalCount = start + (delta ?? count); - if (--refCount === 0) globalCount = 0; - return count; - }, - }; -} - -export { unrecognized }; diff --git a/sync-for-payables/src/sdk/types/webhooks.ts b/sync-for-payables/src/sdk/types/webhooks.ts deleted file mode 100644 index 9510d20c0..000000000 --- a/sync-for-payables/src/sdk/types/webhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type WebhookRecipient = { - url: string; -}; diff --git a/sync-for-payables/tsconfig.esm.json b/sync-for-payables/tsconfig.esm.json new file mode 100644 index 000000000..b98a6d38d --- /dev/null +++ b/sync-for-payables/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "include": ["src"], + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/sync-for-payables/tsconfig.json b/sync-for-payables/tsconfig.json index 76110f883..ffd54239f 100644 --- a/sync-for-payables/tsconfig.json +++ b/sync-for-payables/tsconfig.json @@ -1,41 +1,17 @@ { + "include": ["src"], "compilerOptions": { - "incremental": false, - "target": "ES2020", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "jsx": "react-jsx", - - "module": "Node16", - "moduleResolution": "Node16", - - "allowJs": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "rootDir": "src", - "outDir": ".", - - - // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json - "strict": true, - "allowUnusedLabels": false, - "allowUnreachableCode": false, - "exactOptionalPropertyTypes": true, - "useUnknownInCatchVariables": true, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noPropertyAccessFromIndexSignature": true, - "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "isolatedModules": true, - "checkJs": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "target": "es2018", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] }, - "include": ["src"], - "exclude": ["node_modules", "src/__tests__"] + "exclude": [ + "dist", + "node_modules" + ] }